diff --git a/CHANGES b/CHANGES index c81b958..dd63b0c 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,33 @@ +New in release 1.5.0 +==================== + +* Terminal window resizeable +* fix build fails with gcc-15/C23 +* fix statusline for small windows +* various issues caught by lintian solved +* fix old-style-definition warnings +* Minor fixes + + +New in release 1.4.2 +==================== +This release is dedicated to Sven Guckes (*1967-04-06 +2022-02-20). +Sven was an enthusiastic Linux explainer, his particular passion was the console tools. +I met Sven a couple of times. He always showed interest in the further development of +the bvi and liked to discuss new ideas. +R.I.P. Sven + +* :wq bug fixed +* Error-message if input no terminal +* Mixed licenses (SF bug #10) +* Segmentation fault occurs on undo (SF bug #11) +* Segmentation fault occurs on substitution in 32-bit systems (SF bug #12) +* ncursesw support +* Handling inputs larger than 2^31 bytes (SF bug #13) +* Some incorrect function prototypes in ANSI mode fixed (SF bug #14) +* Minor fixes + + New in release 1.4.1 ==================== @@ -10,7 +40,7 @@ New in release 1.4.1rc * Compile warning: implicit declaration of function ‘save_chk’ fixed (SF bug #9) * bmore seg fault on file not found fixed * set columns prevents filename display on the commandline fixed (SF bug #8) -* bmore new option -r +* bmore new option -r bvi new setting: set reverse Characters between 160 - 254 are displayed as "reverse video text" as used in some legacy systems (Atari, Commodore, Apple II, etc). @@ -109,9 +139,9 @@ New in release 1.3.0 * Reading of Block Special Files * New Command line options: +cmd - -b begin \ - -e end > for partial file read - -s size / + -b begin \ + -e end > for partial file read + -s size / * :e# bug fixed * Debian bug #68436 (Buffer overflow in io.c) fixed diff --git a/CREDITS b/CREDITS index 1a90751..cf930a1 100644 --- a/CREDITS +++ b/CREDITS @@ -1,7 +1,7 @@ Patches: -Guido sys_errlist -Christian "naddy" Weisgerber {Free,Open}BSD -Gunnar Larisch ^ZZ bug +Etienne Mollier gcc-15/C23 issues +Matthias Klose GCC-15 issues +Vincent Batts nit cleanup Peter J. Holzer setlocale Albert Chin-A-Young Makefile.in Ralf AIX fixes @@ -22,6 +22,10 @@ Josef Hinteregger ZZ write bug, lfs Richard Yao Buffer overflow at terminals > 255, ncurses with tinfo, configure fixed ~ operator dumps core Dave Keaton ASCII_DEL patch +Udo Hertrich-Jeromin ncursesw for tinycorelinux +Takashi Yano Segmentation fault occurs on undo, Segmentation fault occurs on substitution in 32-bit systems +Dominik Köppl Handling inputs larger than 2^31 bytes +Christopher Head Some incorrect function prototypes in ANSI mode Packages: diff --git a/Makefile.in b/Makefile.in index ebf25a6..81a596e 100644 --- a/Makefile.in +++ b/Makefile.in @@ -6,9 +6,9 @@ # "autoconf" program (constructs like "@foo@" will get replaced in the # actual Makefile. # -# Copyright (c) 1996-2019 by Gerhard Buergmann +# Copyright (c) 1996-2022 by Gerhard Buergmann # gerhard@puon.at -# +# # 1996-01-18 V 1.0.0 # 1999-01-15 V 1.1.0 # 1999-03-03 V 1.1.1 @@ -18,6 +18,7 @@ # 2003-07-03 V 1.3.2 # 2014-10-01 V 1.4.0 # 2019-01-30 V 1.4.1 +# 2022-02-08 V 1.4.2 # ############################################### @@ -55,7 +56,7 @@ all: bvi bmore bvi: $(OBJS) $(HEADER) $(CC) $(LDFLAGS) -o bvi $(OBJS) $(LIBS) -bmore: $(BMOBJ) +bmore: $(BMOBJ) bmore.h $(CC) $(LDFLAGS) -o bmore $(BMOBJ) $(LIBS) %.o: %.c $(INCLUDES) diff --git a/README b/README index 03c60c1..c6c2e2c 100644 --- a/README +++ b/README @@ -1,6 +1,6 @@ BVI - Binary visual editor ========================== -http://bvi.sourceforge.net/ +https/bvi.sourceforge.net/ This editor for binary files was written by Gerhard Buergmann and is distributed under the GPL (GNU Public License). @@ -9,12 +9,12 @@ and is distributed under the GPL (GNU Public License). How to compile ============== - You need the curses (ncurses) library for cursor movement on your system. + You need the curses (ncurses) library for cursor movement on your system. https://www.cyberciti.biz/faq/linux-install-ncurses-library-headers-on-debian-ubuntu-centos-fedora/ - gunzip -c bvi-1.4.1.src.tar.gz | tar xvf - - cd bvi-1.4.1 + gunzip -c bvi-1.5.0.src.tar.gz | tar xvf - + cd bvi-1.5.0 ./configure make make install @@ -32,14 +32,6 @@ To avoid this behaviour use: stty dsusp undef ---------------------------------------------------------------------------- -Subscribe to the bvi mailing for support, updates and other news: - - Send a blank email to bvi-subscribe@yahoogroups.com. You will receive a - subscription confirmation message. Simply reply this message and your - subscription will be complete. - - --------------------------------------------------------------------------- PLEASE send any bug reports (and fixes), code for new features, comments, questions, etc. (even flames) to: diff --git a/acconfig.h b/acconfig.h index 8941d4c..2eaf7ce 100644 --- a/acconfig.h +++ b/acconfig.h @@ -4,8 +4,10 @@ #undef HAVE_CURSES_H +#undef HAVE_NCURSESW_CURSES_H + #undef NO_SYSERRL #undef NEED_PUTC_CHAR -#undef HAVE_NCURSES_TERM_H +#undef HAVE_NCURSES_TERM_H diff --git a/bm_dos.c b/bm_dos.c index 29ccf8c..ba2ed25 100644 --- a/bm_dos.c +++ b/bm_dos.c @@ -126,7 +126,7 @@ cleartoeol() int vgetc() { - return ((char)bioskey(0)); + return ((char)bioskey(0)); } diff --git a/bm_unix.c b/bm_unix.c index dd5c92f..4ae043f 100644 --- a/bm_unix.c +++ b/bm_unix.c @@ -7,10 +7,11 @@ * 2010-06-02 V 1.3.4 * 2013-08-22 V 1.4.0 * 2019-10-09 V 1.4.1 + * 2025-07-19 V 1.5.0 * * NOTE: Edit this file with tabstop=4 ! * - * Copyright 1996-2019 by Gerhard Buergmann + * Copyright 1996-2025 by Gerhard Buergmann * gerhard@puon.at * * This program is free software; you can redistribute it and/or modify it @@ -64,8 +65,7 @@ putchr(char ch) #else int -putchr(ch) - int ch; +putchr(int ch) {return putchar(ch);} #endif @@ -116,7 +116,7 @@ initterm() no_intty = tcgetattr(fileno(stdin), &ostate); tcgetattr(fileno(stderr), &ostate); - + nstate = ostate; if (!no_tty) { ostate.c_lflag &= ~(ICANON|ECHO); @@ -143,8 +143,7 @@ reset_tty() void -sig(sig) - int sig; +sig(int sig) { reset_tty(); printf("\r\n"); @@ -156,12 +155,15 @@ sig(sig) * doshell() - run a command or an interactive shell */ void -doshell(cmd) - char *cmd; +doshell(char *cmd) { int ret; #ifndef DJGPP +#ifdef __STDC__ + char *getenv(const char *); +#else char *getenv(); +#endif char *shell; char cline[128]; #endif @@ -277,10 +279,7 @@ vgetc() * Copy contents of memory (with possible overlapping). */ char * -memmove(s1, s2, n) - char *s1; - char *s2; - size_t n; +memmove(char *s1, char *s2, size_t n) { bcopy(s2, s1, n); return(s1); diff --git a/bmore.1 b/bmore.1 index 94d0dc4..89ac7fe 100644 --- a/bmore.1 +++ b/bmore.1 @@ -1,4 +1,4 @@ -.TH BMORE 1 "30 Jan 2019" +.TH BMORE 1 "24 May 2025" .SH NAME bmore \- browse through a binary file .SH SYNOPSIS @@ -77,7 +77,7 @@ except that a header is printed before each file in a series. .SH OPTIONS .TP .B \-a -ASCII mode: no hex representation of the contents. Non printable +ASCII mode: no hex representation of the contents. Non printable characters are displayed as a dot (.) .TP .B \-c @@ -232,7 +232,7 @@ in the file remains unchanged. Regular expressions can be edited using erase and kill characters. Erasing back past the first column cancels the search command. .TP -.B \' +.B ' Single quote. Go to the point from which the last search started. If no search has been performed in the current file, go to the beginning of the file. diff --git a/bmore.c b/bmore.c index 0a577cc..49231b8 100644 --- a/bmore.c +++ b/bmore.c @@ -8,8 +8,10 @@ * 2004-01-09 V 1.3.2 * 2013-08-23 V 1.4.0 * 2019-01-22 V 1.4.1 + * 2023-03-06 V 1.4.2 + * 2025-07-19 V 1.5.0 * - * Copyright 1990-2019 by Gerhard Buergmann + * Copyright 1990-2025 by Gerhard Buergmann * gerhard@puon.at * * NOTE: Edit this file with tabstop=4 ! @@ -49,7 +51,7 @@ #include "bmore.h" -char *copyright = "GPL (C) 1990-2019 by Gerhard Buergmann"; +char *copyright = "GPL (C) 1990-2022 by Gerhard Buergmann"; int maxx, maxy; int mymaxx = 0, mymaxy = 0; @@ -85,7 +87,7 @@ int prompt = 1; char helppath[MAXCMD]; static char progname[10]; -static char cmdbuf[MAXCMD]; +static char cmdbuf[2 * MAXCMD]; static int cnt = 0; static int icnt = 0; static int smode; @@ -112,9 +114,7 @@ usage() int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { int ch, ch1; int colon = 0, last_ch = 0; @@ -140,7 +140,7 @@ main(argc, argv) #endif poi = strrchr(argv[0], DELIM); - + if (poi) strncpy(progname, ++poi, 9); else strncpy(progname, argv[0], 9); strtok(progname, "."); @@ -176,7 +176,7 @@ main(argc, argv) break; case 'r': r_flag++; break; - default: + default: usage(); } i++; @@ -339,7 +339,7 @@ main(argc, argv) fclose(curr_file); reset_tty(); exit(exval); - case ':' : + case ':' : switch (colon) { case 'f': prompt = 0; @@ -448,7 +448,7 @@ main(argc, argv) bytepos = screen_home; to_print = maxy; break; - case '\\': + case '\\': if (ascii_flag) { bmbeep(); break; @@ -459,13 +459,13 @@ main(argc, argv) if (rdline(ch, sstring)) break; } case 'n': /**** Search Next ****/ - case 'N': + case 'N': bmsearch(ch); /* to_print--; */ break; - case '\'': + case '\'': if (no_intty) { bmbeep(); } else { @@ -492,7 +492,7 @@ main(argc, argv) break; } while ((ch1 = getc(help_file)) != EOF) - putchar(ch1); + putchar(ch1); fclose(help_file); to_print = 0; break; @@ -501,13 +501,13 @@ main(argc, argv) if (!no_intty) { cleartoeol(); if (ch == 'v') { - sprintf(string, "bvi +%lu %s", - (unsigned long)(screen_home + + sprintf(string, "bvi +%lu %s", + (unsigned long)(screen_home + (maxy + 1) / 2 * out_len), name); } else { if (precount < 1) precount = bytepos - screen_home; sprintf(string, "bvi -b %lu -s %lu %s", - (unsigned long)screen_home, + (unsigned long)screen_home, (unsigned long)precount, name); } doshell(string); @@ -532,9 +532,7 @@ main(argc, argv) int -rdline(ch, sstring) - int ch; - char *sstring; +rdline(int ch, char *sstring) { int i = 0; int ch1 = 0; @@ -586,8 +584,7 @@ rdline(ch, sstring) void -do_next(n) - int n; +do_next(int n) { if (numfiles) { if (n == 1 && file_nr == numfiles) { @@ -613,8 +610,7 @@ do_next(n) int -open_file(name) - char *name; +open_file(char *name) { struct stat buf; @@ -635,9 +631,7 @@ open_file(name) void -putline(buf, num) - char *buf; - int num; +putline(char *buf, int num) { int print_pos; unsigned char ch; @@ -648,31 +642,31 @@ putline(buf, num) if (!ascii_flag) { for (print_pos = 0; print_pos < num; print_pos++) { ch = buf[print_pos]; - PRINTF("%02X ", ch); + PRINTF("%02X ", ch); } for (; print_pos < out_len; print_pos++) { - PRINTF(" "); + PRINTF(" "); } PRINTF(" "); } - + // ASCII section for (print_pos = 0; print_pos < num; print_pos++) { ++bytepos; ch = buf[print_pos]; if ((ch > 31) && (ch < 127)) { - PRINTF("%c", ch); + PRINTF("%c", ch); } else { if (r_flag) { if ((ch & 128) && ((ch > 159) && (ch < 255))) { if (!no_tty) highlight(); - PRINTF("%c", ch & 127); + PRINTF("%c", ch & 127); if (!no_tty) normal(); } else { - PRINTF("."); + PRINTF("."); } } else { - PRINTF("."); + PRINTF("."); } } } @@ -688,13 +682,12 @@ putline(buf, num) int -printout(lns) - int lns; +printout(int lns) { int c, num; int doub = 0; static int flag; - + if (c_flag) { clearscreen(); } @@ -754,9 +747,7 @@ nextchar() void -pushback(n, where) - int n; - char *where; +pushback(int n, char *where) { if (cnt) memmove(cmdbuf + n, cmdbuf, n); memcpy(cmdbuf, where, n); @@ -773,8 +764,7 @@ pushback(n, where) * 1 found */ int -bmregexec(scan) - char *scan; +bmregexec(char *scan) { char *act; int count, test; @@ -868,7 +858,7 @@ bmregexec(scan) pushback(1, --act); l--; } - } else { /* ".*" */ + } else { /* ".*" */ do { if ((test = nextchar()) == -1) return -5; *act++ = test; @@ -892,10 +882,7 @@ bmregexec(scan) int -sbracket(start, scan, count) - int start; - char *scan; - int count; +sbracket(int start, char *scan, int count) { if (*scan++ == '^') { if (!memchr(scan, start, --count)) return 0; @@ -907,8 +894,7 @@ sbracket(start, scan, count) void -bmsearch(ch) - int ch; +bmsearch(int ch) { int i; @@ -960,8 +946,7 @@ emsg(string); void -emsg(s) - char *s; +emsg(char *s) { putchar('\r'); cleartoeol(); diff --git a/bmore.h b/bmore.h index bb51745..e33439a 100644 --- a/bmore.h +++ b/bmore.h @@ -7,14 +7,15 @@ * 1999-08-21 V 1.2.0 final * 2000-05-31 V 1.3.0 beta * 2000-10-04 V 1.3.0 final - * 2002-01-16 V 1.3.1 + * 2002-01-16 V 1.3.1 * 2003-02-20 V 1.3.2 * 2010-03-28 V 1.3.4 * 2019-01-22 V 1.4.1 + * 2022-03-07 V 1.4.2 * * NOTE: Edit this file with tabstop=4 ! * - * Copyright 1996-2019 by Gerhard Buergmann + * Copyright 1996-2023 by Gerhard Buergmann * gerhard@puon.at * * This program is free software; you can redistribute it and/or modify it @@ -42,27 +43,30 @@ #if defined(__MSDOS__) && !defined(DJGPP) # include "patchlev.h" # include "dosconf.h" -# include +# include # include # include #else # include "patchlevel.h" # include "config.h" # include -# if HAVE_NCURSES_H -# include -# else -# include -# endif -# if HAVE_TERM_H +# if defined HAVE_NCURSESW_CURSES_H +# include +# include +# elif defined HAVE_NCURSESW_H +# include +# elif defined HAVE_NCURSES_CURSES_H +# include +# elif defined HAVE_NCURSES_H +# include +# elif defined HAVE_CURSES_H +# include +# else +# error "SysV or X/Open-compatible Curses header file required" +# endif +# if HAVE_TERM_H # include -# else -# if HAVE_NCURSES_TERM_H -# include -# else -# include -# endif -# endif +# endif #endif @@ -132,20 +136,20 @@ extern int no_tty, no_intty; -#ifdef ANSI +#if defined(ANSI) || defined(__STDC__) void initterm(void), set_tty(void), reset_tty(void); void cleartoeol(void), clearscreen(void), highlight(void); - void normal(void), bmbeep(void), home(void), sig(void); + void normal(void), bmbeep(void), home(void), sig(int); void doshell(char *), emsg(char *); void do_next(int); void bmsearch(int); void pushback(int, char *); - int open_file(void); - int printout(int), rdline(int, char *); - int nextchar(void), vgetc(void); + int open_file(char *); + int printout(int), rdline(int, char *); + int nextchar(void), vgetc(void); int sbracket(int, char *, int); int bmregexec(char *); - int ascii_comp(char *, char *), hex_comp(char *, char *); + int ascii_comp(char *, char *), hex_comp(char *, char *); void putline(char *, int); #else void initterm(), set_tty(), reset_tty(); diff --git a/bvi.1 b/bvi.1 index b0e7f33..3ac9cce 100644 --- a/bvi.1 +++ b/bvi.1 @@ -1,8 +1,8 @@ .rn '' }` -''' $RCSfile$$Revision$$Date$ -''' -''' $Log$ -''' +.\" $RCSfile$$Revision$$Date$ +.\" +.\" $Log$ +.\" .de Sh .br .if t .Sp @@ -31,12 +31,12 @@ .fi .. -''' -''' -''' Set up \*(-- to give an unbreakable dash; -''' string Tr holds user defined translation string. -''' Bell System Logo is used as a dummy character. -''' +.\" +.\" +.\" Set up \*(-- to give an unbreakable dash; +.\" string Tr holds user defined translation string. +.\" Bell System Logo is used as a dummy character. +.\" .tr \(*W-|\(bv\*(Tr .ie n \{\ .ds -- \(*W- @@ -45,10 +45,10 @@ .if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch .ds L" "" .ds R" "" -''' \*(M", \*(S", \*(N" and \*(T" are the equivalent of -''' \*(L" and \*(R", except that they are used on ".xx" lines, -''' such as .IP and .SH, which do another additional levels of -''' double-quote interpretation +.\" \*(M", \*(S", \*(N" and \*(T" are the equivalent of +.\" \*(L" and \*(R", except that they are used on ".xx" lines, +.\" such as .IP and .SH, which do another additional levels of +.\" double-quote interpretation .ds M" """ .ds S" """ .ds N" """"" @@ -79,9 +79,9 @@ 'br\} .\" If the F register is turned on, we'll generate .\" index entries out stderr for the following things: -.\" TH Title +.\" TH Title .\" SH Header -.\" Sh Subsection +.\" Sh Subsection .\" Ip Item .\" X<> Xref (embedded .\" Of course, you have to process the output yourself @@ -93,7 +93,7 @@ .nr % 0 .rr F .\} -.TH BVI 1 "BVI Version 1.4.1" "30/Jan/2019" "User Commands" +.TH BVI 1 "BVI Version 1.5.0" "31/May/2025" "User Commands" .IX Title "BVI 1" .UC .IX Name "bvi, bview - visual display editor for binary files" @@ -194,7 +194,7 @@ bvi, bview \- visual editor for binary files .SH "VERSION" .IX Header "VERSION" -bvi-1.4.1 +bvi-1.5.0 .SH "SYNOPSIS" .IX Header "SYNOPSIS" \fBbvi\fR\ \ \ [\fB\-R\fR]\ [\fB\-c\fR\ \fIcmd\fR]\ [\fB\-f\fR\ \fIscript\fR]\ [\fB\-s\fR\ \fIskip\fR]\ [\fB\-e\fR\ \fIend\fR]\ [\fB\-n\fR\ \fIlength\fR]\ \fIfile\fR... @@ -203,10 +203,10 @@ bvi-1.4.1 .IX Header "OPTIONS" .Ip "\fIfile\fR..." 4 .IX Item "\fIfile\fR..." -A list of filenames. The first one will be the current file and -will be read +A list of filenames. The first one will be the current file and +will be read into the buffer. The cursor will be positioned on the first line of -the buffer. You can get to the other files with the ":next" command. +the buffer. You can get to the other files with the ":next" command. .Ip "\fB\-R\fR" 4 .IX Item "\fB\-R\fR" \*(L"Readonly": The readonly flag is set for all the files, @@ -261,7 +261,7 @@ The byte offset (extreme left), the hex pane (middle), and an ascii pane (right) which shows as printable characters those bytes in the hex pane. On an 80 column terminal there will be sixteen hex values -and their ASCII values on each screen line. +and their ASCII values on each screen line. Note that (as one would expect) the first byte has the offset \*(L'0\*(R' (zero). .PP You can toggle between the hex and ascii windows with the tab key (TAB). @@ -270,10 +270,10 @@ position (offset) within the file. .PP No \*(L"lines\*(R" concept: Files are treated as one long stream of bytes. The characters -\*(L"newline\*(R" and \*(L"carriage return\*(R" are not special, id est they +\*(L"newline\*(R" and \*(L"carriage return\*(R" are not special, id est they never mark the end of lines. Therefore the lines on the screen do not represent lines in the usual way. Data is broken across screen lines -arbitarily. +arbitrarily. As a consequence there are no commands in bvi from ex or vi that are based on line numbers, eg \*(L"dd\*(R", \*(L"yy\*(R", \*(L'C\*(R', \*(L'S\*(R', \*(L'o\*(R', \*(L'O\*(R'. This also changes the meaning of \*(L"range\*(R" before the \*(L":write\*(R" command @@ -313,13 +313,13 @@ using these meta sequences: .Ve Additional search commands: Similar to the text search commands there are additional hex-search -functions \*(L'\e\*(R' and \*(L'#\*(R' which allow to search for any byte value. +functions \*(L'\e\*(R' and \*(L'#\*(R' which allow one to search for any byte value. Example: \*(L"\e62 76 69\*(R" will search for the string \*(L"bvi\*(R". Spaces between hex value are optional, so searching for \*(L"6775636B6573\*(R" will find \*(L"guckes\*(R". .PP Changing the length of data (insertion, deletion) moves the data to other addresses; -this is bad for many cases (eg. databases, program files) and is +this is bad for many cases (eg. databases, program files) and is thus disabled by default. You can enable this commands by typing .PP \f(CW :set memmove\fR @@ -334,11 +334,11 @@ Use ESC (escape) to cancel a partial (uncompleted) command. .PP Input Mode: .PP -Input is treated as replacement of current characters or +Input is treated as replacement of current characters or (after the end of the file) is appended to the current file. This mode is entered from command mode by typing one of \*(L'i\*(R', \*(L'I\*(R', \*(L'A\*(R', \*(L'r\*(R', or \*(L'R\*(R'. -You can enter the characters from the keyboard (in the ASCII window) or +You can enter the characters from the keyboard (in the ASCII window) or hexadecimal values (in the HEX window). Type TAB to switch between these two windows. Type ESC to finish the current input and return to command mode. @@ -346,8 +346,8 @@ Type CTRL\-C to cancel current command abnormally. .PP Command line mode (Last Line Mode or : mode): .PP -Similar to vi, this mode is entered by typing one of the -characters +Similar to vi, this mode is entered by typing one of the +characters : / ? \e # ! The command is terminated and executed by typing a carriage return; to cancel a partially typed command, type @@ -439,10 +439,10 @@ used within the following description of commands. You can insert/append/change bytes in ASCII/binary/decimal/ hexadecimal or octal representation. You can enter several (screen) lines of input. A line with only a period (.) in it -will terminate the command. You must not type in values greater +will terminate the command. You must not type in values greater than a byte value. This causes an abandonment of the command. Pressing the CR key does not insert a newline \- character into -the file. If you use ASCII mode you can use the special characters +the file. If you use ASCII mode you can use the special characters \en, \er, \et and \e0. .PP .Vb 3 @@ -507,7 +507,7 @@ the file. If you use ASCII mode you can use the special characters `\fIx\fR move cursor to mark \fIx\fR in HEX section \*(L'\*(R' move cursor to previous context in ASCII section `` move cursor to previous context in HEX section - + \fBLine positioning:\fR H jump to first line on screen ("top") L jump to last line on screen ("low") @@ -554,7 +554,7 @@ the file. If you use ASCII mode you can use the special characters rx replace current bte with char \*(L'x\*(R' R enter replace mode; for all subsequent input, the current byte is overwritten with the next - input character; leave replace mode with ESC. + input character; leave replace mode with ESC. .PP \fBMiscellaneous Operations:\fR TAB toggle between ASCII and HEX section @@ -583,8 +583,8 @@ the file. If you use ASCII mode you can use the special characters \& columns cm=16 on an 80 character wide terminal \& ignorecase noic Ignores letter case in searching \& magic nomagic Makes . [ * special in patterns -\& memmove nomm enables insert and delete commands -\& offset of=0 adds an offset to the diplayed addresses +\& memmove nomm enables insert and delete commands +\& offset of=0 adds an offset to the displayed addresses \& readonly noro If set, write fails unless you use ! after command \& reverse nore display otherwise-printable characters with their \& high bit set as reverse video @@ -606,7 +606,7 @@ bvi was developed by Gerhard Buergmann, Vienna, Austria \fIgerhard@puon.at\fR .SH "WWW" .IX Header "WWW" -Bvi\ Homepage:\ \ http://bvi.sourceforge.net/ +Bvi\ Homepage:\ \ https://bvi.sourceforge.net/ Vi\ Pages:\ \ \ \ \ \ http://www.guckes.net/vi/clones.php3 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (all\ about\ Vi\ and\ its\ clones) .SH "FILES" @@ -614,9 +614,6 @@ Vi\ Pages:\ \ \ \ \ \ http://www.guckes.net/vi/clones.php3 \fI\ $HOME/.bvirc\fR\ \ \ \ \ \ \ \ \ \ editor\ startup\ file .BR \fI\ ./.bvirc\fR\ \ \ \ \ \ \ \ \ \ \ \ \ \ editor\ startup\ file -.SH "BUGS" -.IX Header "BUGS" -Bvi does not update the screen when the terminal changes its size. .SH "SEE ALSO" .IX Header "SEE ALSO" \fIbmore\fR\|(1), \fIvi\fR\|(1), \fIstrings\fR\|(1), \fIascii\fR\|(5) diff --git a/bvi.c b/bvi.c index dcc1f85..50574ff 100644 --- a/bvi.c +++ b/bvi.c @@ -2,7 +2,7 @@ * * 1996-02-28 V 1.0.0 * 1999-01-27 V 1.1.0 - * 1999-04-22 V 1.1.1 + * 1999-04-22 V 1.1.1 * 1999-07-01 V 1.2.0 beta * 1999-10-22 V 1.2.0 final * 2000-05-10 V 1.3.0 alpha @@ -13,10 +13,12 @@ * 2013-08-23 V 1.4.0alpha * 2014-10-07 V 1.4.0 * 2019-10-12 V 1.4.1 + * 2023-03-06 V 1.4.2 + * 2025-07-19 V 1.5.0 * * NOTE: Edit this file with tabstop=4 ! * - * Copyright 1996-2019 by Gerhard Buergmann + * Copyright 1996-2025 by Gerhard Buergmann * gerhard@puon.at * * This program is free software; you can redistribute it and/or modify it @@ -33,6 +35,7 @@ */ #include +#include #include "bvi.h" #include "set.h" @@ -42,55 +45,56 @@ #endif -char *copyright = "(C) GPL 1996-2019 by Gerhard Buergmann"; +char *copyright = "(C) GPL 1996-2025 by Gerhard Buergmann"; jmp_buf env; /* context for `longjmp' function */ -int loc; -int maxx, maxy, x, xx, y; -int screen, status, statsize; +int loc; +int maxx, maxy, x, xx, y; +int screen, status, statsize; off_t size; -PTR mem = NULL; -PTR curpos; -PTR maxpos; -PTR pagepos; -PTR spos; +PTR mem = NULL; +PTR curpos; +PTR maxpos; +PTR pagepos; +PTR spos; char *name = NULL; char *shell; char string[MAXCMD+1]; char cmdstr[MAXCMD+1] = ""; FILE *Ausgabe_Datei; -int edits = 0; -int AnzAdd, Anzahl, Anzahl3; +int edits = 0; +int AnzAdd, Anzahl, Anzahl3; off_t filesize, memsize, undosize; - +int statusflag = 1; +int space = 2; long precount = -1; -int block_flag = 0; +int block_flag = 0; off_t block_begin, block_end, block_size; char **files; /* list of input files */ -int numfiles; /* number of input files */ -int curfile; /* number of the current file */ +int numfiles; /* number of input files */ +int curfile; /* number of the current file */ -int arrnum = 0; +int arrnum = 0; char numarr[MAXCMD+1]; /* string for collecting number */ char rep_buf[BUFFER]; -PTR current; -PTR last_motion; -PTR current_start; -PTR undo_start; +PTR current; +PTR last_motion; +PTR current_start; +PTR undo_start; off_t undo_count; off_t yanked = 0L; char *yank_buf = NULL; char *undo_buf = NULL; char *fname_buf = NULL; -PTR markbuf[26]; +PTR markbuf[26]; char addr_form[15]; @@ -98,8 +102,8 @@ char *nobytes = "No bytes@in the buffer"; static char progname[8]; static char line[MAXCMD+1]; -static int mark; -static int wrstat = 1; +static int mark; +static int wrstat = 1; void @@ -115,9 +119,7 @@ usage() int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { int ch; int lflag; @@ -145,6 +147,13 @@ main(argc, argv) /* This should be the beginners version */ } + if (isatty(fileno(stdin)) == 0) { + // Guckes + fprintf(stderr, "Input is not from a terminal\n"); + exit(1); + } + + while (n < argc) { switch (argv[n][0]) { case '-': @@ -239,7 +248,7 @@ main(argc, argv) break; case BLOCK_BEGIN|BLOCK_END|BLOCK_LEN: if (block_end - block_begin != block_size + 1) { - fprintf(stderr, "Ambigous block data\n"); + fprintf(stderr, "Ambiguous block data\n"); exit(1); } break; @@ -258,7 +267,9 @@ main(argc, argv) maxy = LINES; if (params[P_LI].flags & P_CHANGED) maxy = P(P_LI); P(P_SS) = maxy / 2; + /* We do not set P(P_LI) and P(P_CM) anymore, because 0 means "auto" P(P_LI) = maxy; + */ maxy--; keypad(stdscr, TRUE); scrollok(stdscr, TRUE); @@ -266,21 +277,21 @@ main(argc, argv) cbreak(); noecho(); - /* address column width */ - /* default is 8 + 2 blanks */ - /* if block_begin has 8 hex digits or more */ - /* reserve 1 hex digit more than required */ - char tmp[sizeof(block_begin) * 2 + 3]; - AnzAdd = sprintf(tmp, "%llX", (long long unsigned)block_begin) + 1; - if (AnzAdd < 8) - AnzAdd = 8; - if (AnzAdd > sizeof(block_begin) * 2) - AnzAdd = sizeof(block_begin) * 2; - sprintf(addr_form, "%%0%dllX ", AnzAdd); - AnzAdd = sprintf(tmp, addr_form, block_begin); + /* address column width */ + /* default is 8 + 2 blanks */ + /* if block_begin has 8 hex digits or more */ + /* reserve 1 hex digit more than required */ + char tmp[sizeof(block_begin) * 2 + 3]; + AnzAdd = sprintf(tmp, "%llX", (long long unsigned)block_begin) + 1; + if (AnzAdd < 8) AnzAdd = 8; + if (AnzAdd > sizeof(block_begin) * 2) AnzAdd = sizeof(block_begin) * 2; + sprintf(addr_form, "%%0%dllX ", AnzAdd); + AnzAdd = sprintf(tmp, addr_form, block_begin); - Anzahl = ((COLS - AnzAdd - 1) / 16) * 4; + Anzahl = ((COLS - AnzAdd - space) / 16) * 4; + /* P(P_CM) = Anzahl; + */ maxx = Anzahl * 4 + AnzAdd + 1; Anzahl3 = Anzahl * 3; statsize = 35; @@ -301,7 +312,7 @@ main(argc, argv) if (*cmdstr != '\0') docmdline(cmdstr); msg(fname_buf); - + /* main loop */ do { setjmp(env); @@ -319,6 +330,10 @@ main(argc, argv) else precount = -1; lflag = arrnum = 0; + if (statusflag == 0) { + statusflag = 1; + clearstr(); + } switch (ch) { case '^': x = AnzAdd; loc = HEX; @@ -417,7 +432,7 @@ main(argc, argv) x = AnzAdd - 1 + Anzahl3 + Anzahl; loc = ASCII; } break; - case ':' : clearstr(); + case ':' : clearstr(); addch(ch); refresh(); getcmdstr(cmdstr, 1); @@ -458,6 +473,18 @@ main(argc, argv) fileinfo(name); wrstat = 0; break; + case KEY_RESIZE: + if (P(P_CM) == 0) { + Anzahl = ((COLS - AnzAdd - space) / 4); + maxx = Anzahl * 4 + AnzAdd + 1; + Anzahl3 = Anzahl * 3; + status = Anzahl3 + Anzahl - statsize; + } + if (P(P_LI) == 0) { + screen = Anzahl * (maxy - 1); + maxy = LINES - 1; + P(P_SS) = maxy / 2; + } case BVICTRL('L'): /*** REDRAW SCREEN ***/ new_screen(); break; @@ -482,9 +509,9 @@ main(argc, argv) break; case ';': do_ft(0, 0); break; - case 'F': - case 'f': - case 't': + case 'F': + case 'f': + case 't': case 'T': do_ft(ch, 0); break; case 'G': last_motion = current; @@ -492,10 +519,10 @@ main(argc, argv) if ((precount < P(P_OF)) || (precount - P(P_OF)) > (filesize - 1L)) { beep(); - } else { + } else { setpage((PTR)(mem + precount - P(P_OF))); } - } else { + } else { setpage((PTR)(mem + filesize - 1L)); } break; @@ -726,8 +753,7 @@ main(argc, argv) off_t -calc_size(arg) - char *arg; +calc_size(char *arg) { off_t val; extern int errno; @@ -747,13 +773,13 @@ calc_size(arg) switch (*poi) { case 'k': case 'K': val *= 1024; - break; + break; case 'm': case 'M': val *= 1048576; - break; + break; case 'g': - case 'G': val *= 1024*1024*1024LL; - break; + case 'G': val *= 1024*1024*1024LL; + break; case '\0': break; default: usage(); } @@ -778,9 +804,7 @@ trunc_cur() int -do_append(count, buf) - off_t count; - char *buf; +do_append(off_t count, char *buf) { if (filesize + count > memsize) { if (enlarge(count + 100L)) return 1; @@ -797,8 +821,7 @@ do_append(count, buf) void -do_tilde(count) - off_t count; +do_tilde(off_t count) { if (filesize == 0L) return; undo_start = current; @@ -884,10 +907,7 @@ do_undo() void -do_over(loc, n, buf) - PTR loc; - off_t n; - PTR buf; +do_over(PTR loc, off_t n, PTR buf) { if (n < 1L) { emsg(nobytes); @@ -909,16 +929,13 @@ do_over(loc, n, buf) void -do_put(loc, n, buf) - PTR loc; - off_t n; - PTR buf; +do_put(PTR loc, off_t n, PTR buf) { if (n < 1L) { emsg(nobytes); return; } - if (loc > maxpos) { + if (loc >= maxpos) { beep(); return; } @@ -940,8 +957,7 @@ do_put(loc, n, buf) /* argument sig not used, because only SIGINT will be catched */ void -jmpproc(sig) - int sig; +jmpproc(int sig) { if (P(P_EB)) beep(); repaint(); @@ -952,8 +968,7 @@ jmpproc(sig) off_t -range(ch) - int ch; +range(int ch) { int ch1; long count; @@ -1024,7 +1039,7 @@ range(ch) - (off_t)P(P_OF)) > (filesize - 1L)) { beep(); return 0; - } else { + } else { if (mem + count < current) { return(mem + count - current); } else { @@ -1042,9 +1057,9 @@ range(ch) } end_addr = markbuf[mark - 'a']; if (end_addr == NULL) { - beep(); + beep(); return 0; - } + } if (end_addr < current) { return(end_addr - current); } else { diff --git a/bvi.h b/bvi.h index 0881ce7..978846c 100644 --- a/bvi.h +++ b/bvi.h @@ -12,10 +12,12 @@ * 2010-08-04 V 1.3.4 * 2014-10-01 V 1.4.0 * 2019-01-28 V 1.4.1 + * 2023-03-07 V 1.4.2 + * 2025-05-24 V 1.5.0 * * NOTE: Edit this file with tabstop=4 ! * - * Copyright 1996-2019 by Gerhard Buergmann + * Copyright 1996-2025 by Gerhard Buergmann * gerhard@puon.at * * This program is free software; you can redistribute it and/or modify it @@ -45,16 +47,24 @@ #if defined(__MSDOS__) && !defined(DJGPP) # include "patchlev.h" # include "dosconf.h" -# include "doscur.h" -# include +# include "doscur.h" +# include #else # include "patchlevel.h" # include "config.h" -#if HAVE_NCURSES_H -# include -#else -# include -#endif +#if defined HAVE_NCURSESW_CURSES_H + # include + #elif defined HAVE_NCURSESW_H + # include + #elif defined HAVE_NCURSES_CURSES_H + # include + #elif defined HAVE_NCURSES_H + # include + #elif defined HAVE_CURSES_H + # include + #else + # error "SysV or X/Open-compatible Curses header file required" + #endif #endif /* defines for filemode */ @@ -120,14 +130,14 @@ # define ANSI # define PTR char huge * # define off_t long -# define DELIM '\\' -# define strncasecmp strnicmp -# define strcasecmp stricmp +# define DELIM '\\' +# define strncasecmp strnicmp +# define strcasecmp stricmp # define memcpy d_memcpy # define memmove d_memmove #else # define PTR char * -# define DELIM '/' +# define DELIM '/' #endif #define MAXCMD 255 @@ -155,27 +165,27 @@ extern char search_pat[]; extern long hl_spat; extern char pattern[]; extern char rep_buf[]; -extern int maxx, maxy, x, y; -extern int filemode, loc; -extern int edits, new; -extern int AnzAdd; -extern int Anzahl, Anzahl3; -extern int addr_flag; -extern int ignore_case, magic; -extern int screen, status, statsize; -extern PTR mem; -extern PTR maxpos; -extern PTR pagepos; -extern PTR undo_start; -extern PTR current_start; -extern PTR curpos; -extern PTR current; -extern PTR start_addr; -extern PTR end_addr; +extern int maxx, maxy, x, y; +extern int filemode, loc; +extern int edits, new; +extern int AnzAdd; +extern int Anzahl, Anzahl3; +extern int addr_flag; +extern int ignore_case, magic; +extern int screen, status, statsize; +extern PTR mem; +extern PTR maxpos; +extern PTR pagepos; +extern PTR undo_start; +extern PTR current_start; +extern PTR curpos; +extern PTR current; +extern PTR start_addr; +extern PTR end_addr; extern char *name, cmdstr[]; extern off_t filesize, memsize; -extern PTR markbuf[]; -extern PTR last_motion; +extern PTR markbuf[]; +extern PTR last_motion; extern off_t undo_count; extern off_t yanked; extern off_t undosize; @@ -183,14 +193,16 @@ extern char *copyright, *notfound; extern char *terminal; extern char *undo_buf; extern char *yank_buf; -extern int repl_count; +extern int repl_count; extern char string[]; extern char *shell; extern char *poi; -extern int smode; -extern int again; +extern int smode; +extern int again; extern int block_flag; extern off_t block_begin, block_end, block_size; +extern int statusflag; +extern int space; #ifndef S_ISDIR /* POSIX 1003.1 file type tests. */ #define S_ISDIR(m) ((m & 0170000) == 0040000) /* directory */ @@ -205,7 +217,7 @@ extern off_t block_begin, block_end, block_size; void d_memmove(PTR, PTR, off_t); #endif -#ifdef ANSI +#if defined(ANSI) || defined(__STDC__) off_t alloc_buf(off_t, char **), yd_addr(void); off_t range(int); void do_dot(void), do_exit(void), do_shell(void), do_undo(void); @@ -214,26 +226,26 @@ extern off_t block_begin, block_end, block_size; void do_mark(int, PTR), badcmd(char *), movebyte(void); void docmdline(char *), do_over(PTR, off_t, PTR), do_put(PTR, off_t, PTR); void jmpproc(int), printline(PTR, int); - int addfile(char *); - int bregexec(PTR, char *); - int chk_comm(int); - int doecmd(char *, int); - int do_append(off_t, char *), do_logic(int, char *); - int do_delete(off_t, PTR); - int doset(char *); - int do_substitution(int, char *, PTR, PTR); - int hexchar(void); - int outmsg(char *); - int save_chk(char *, char *, char *, int); - PTR searching(int, char *, PTR, PTR, int); - PTR wordsearch(PTR, char); - PTR backsearch(PTR, char); - PTR fsearch(PTR, PTR, char *); - PTR fsearch_end(PTR, PTR, char *, PTR *); - PTR rsearch(PTR, PTR, char *); - PTR end_word(PTR); - PTR calc_addr(char **, PTR); - PTR do_ft(int, int); + int addfile(char *); + PTR bregexec(PTR, char *); + int chk_comm(int); + int doecmd(char *, int); + int do_append(off_t, char *), do_logic(int, char *); + int do_delete(off_t, PTR); + int doset(char *); + int do_substitution(int, char *, PTR, PTR); + int hexchar(void); + int outmsg(char *); + int save_chk(char *, char *, char *, int); + PTR searching(int, char *, PTR, PTR, int); + PTR wordsearch(PTR, char); + PTR backsearch(PTR, char); + PTR fsearch(PTR, PTR, char *); + PTR fsearch_end(PTR, PTR, char *, PTR *); + PTR rsearch(PTR, PTR, char *); + PTR end_word(PTR); + PTR calc_addr(char **, PTR); + PTR do_ft(int, int); char *patcpy(char *, char *, char); void setpage(PTR), msg(char *), emsg(char *), smsg(char *); void usage(void), bvi_init(char *), statpos(void), setcur(void); @@ -244,43 +256,43 @@ extern off_t block_begin, block_end, block_size; off_t edit(int), load(char *); off_t calc_size(char *); int ascii_comp(char *, char *), hex_comp(char *, char *); - int cur_forw(int), cur_back(void); - int lineout(void), save(char *, PTR, PTR, int); - int at_least(char *, char *, int); - int vgetc(void), xpos(void), enlarge(off_t); - int getcmdstr(char *, int), read_rc(char *); - int wait_return(int); + int cur_forw(int), cur_back(void); + int lineout(void), save(char *, PTR, PTR, int); + int at_least(char *, char *, int); + int vgetc(void), xpos(void), enlarge(off_t); + int getcmdstr(char *, int), read_rc(char *); + int wait_return(int); #else - int addfile(); + int addfile(); off_t alloc_buf(), yd_addr(); off_t range(); off_t calc_size(); void do_mark(), badcmd(), movebyte(); void do_back(), do_ins_chg(); void jmpproc(), printline(); - int chk_comm(); + int chk_comm(); void docmdline(), do_over(), do_put(); - int doecmd(); + int doecmd(); void do_dot(), do_exit(), do_shell(), do_undo(); void do_tilde(), trunc_cur(); - int do_append(), do_logic(); - int do_delete(); - int doset(); - int do_substitution(); - int hexchar(); - int outmsg(); - int save_chk(); - PTR searching(); - PTR wordsearch(); - PTR backsearch(); + int do_append(), do_logic(); + int do_delete(); + int doset(); + int do_substitution(); + int hexchar(); + int outmsg(); + int save_chk(); + PTR searching(); + PTR wordsearch(); + PTR backsearch(); /* int bregexec(); */ - PTR bregexec(); - PTR fsearch(); - PTR fsearch_end(); - PTR rsearch(); - PTR end_word(); - PTR calc_addr(); - PTR do_ft(); + PTR bregexec(); + PTR fsearch(); + PTR fsearch_end(); + PTR rsearch(); + PTR end_word(); + PTR calc_addr(); + PTR do_ft(); char *patcpy(); void setpage(), msg(), emsg(), smsg(); void usage(), bvi_init(), statpos(), setcur(); @@ -290,9 +302,9 @@ extern off_t block_begin, block_end, block_size; void quit(), sysemsg(), do_z(), stuffin(); off_t edit(), load(); int ascii_comp(), hex_comp(); - int cur_forw(), cur_back(); - int lineout(), save(), at_least(), read_rc(); - int getcmdstr(), enlarge(); - int vgetc(), xpos(); - int wait_return(); + int cur_forw(), cur_back(); + int lineout(), save(), at_least(), read_rc(); + int getcmdstr(), enlarge(); + int vgetc(), xpos(); + int wait_return(); #endif diff --git a/comm.c b/comm.c index 6e0d884..51079ec 100644 --- a/comm.c +++ b/comm.c @@ -8,16 +8,18 @@ * 1999-09-10 V 1.2.0 final * 2000-03-03 V 1.3.0 beta * 2000-07-15 V 1.3.0 final - * 2001-10-10 V 1.3.1 + * 2001-10-10 V 1.3.1 * 2003-07-04 V 1.3.2 * 2005-08-17 V 1.3.3 * 2010-06-02 V 1.3.4 * 2014-01-28 V 1.4.0 * 2019-01-27 V 1.4.1 + * 2023-03-06 V 1.4.2 + * 2025-07-19 V 1.5.0 * * NOTE: Edit this file with tabstop=4 ! * - * Copyright 1996-2019 by Gerhard Buergmann + * Copyright 1996-2025 by Gerhard Buergmann * gerhard@puon.at * * This program is free software; you can redistribute it and/or modify it @@ -71,8 +73,8 @@ static char *c_argv[9]; char *nowrtmsg = "No write@since last change (:%s! overrides)"; char *morefiles = "more files@to edit"; -char *ambigous = "Ambigous|Too many file names"; -char *ambvalue = "Ambigous|Too many values"; +char *ambigous = "Ambiguous|Too many file names"; +char *ambvalue = "Ambiguous|Too many values"; char *extra = "Extra chars|Extra characters at end of command"; char *noaddr = "No address allowed@on this command"; char *noval = "No value@for binary operation"; @@ -87,7 +89,7 @@ extern char **files; /* used for "next" and "rewind" */ extern int numfiles, curfile; extern int errno; -static char oldbuf[CMDSZ]; /** for :!! command **/ +static char oldbuf[CMDSZ + 3]; /** for :!! command **/ /* @@ -97,8 +99,7 @@ static char oldbuf[CMDSZ]; /** for :!! command **/ * the environment variable "BVIINIT" (or eventually .bvirc). */ void -docmdline(cmdline) - char *cmdline; +docmdline(char *cmdline) { char buff[CMDSZ]; char cmdbuf[CMDSZ]; @@ -285,22 +286,22 @@ docmdline(cmdline) if ((c_argv[c_argc] = strtok(cmd, " \t")) != NULL) c_argc++; while ((c_argv[c_argc] = strtok(NULL, " \t")) != NULL) c_argc++; - if (c_argc > 1) { + if (c_argc > 1) { emsg(ambigous); return; } if (c_argc == 1) { - /* change '%' to Filename */ - while ((p = strchr(c_argv[0], '%')) != NULL && *(p-1) != '\\') { - if (name == NULL) { - emsg("No filename@to substitute for %"); - return; - } - *p = '\0'; - strcpy (oldbuf, c_argv[0]); - strcat (oldbuf, name); - strcat (oldbuf, p + 1); + /* change '%' to Filename */ + while ((p = strchr(c_argv[0], '%')) != NULL && *(p-1) != '\\') { + if (name == NULL) { + emsg("No filename@to substitute for %"); + return; + } + *p = '\0'; + strcpy (oldbuf, c_argv[0]); + strcat (oldbuf, name); + strcat (oldbuf, p + 1); c_argv[0] = oldbuf; - } + } } if (name == NULL && c_argc != 0) name = strdup(c_argv[0]); if (force) { @@ -308,7 +309,7 @@ docmdline(cmdline) else ok = save(c_argv[0], start_addr, end_addr, saveflag); } else { if (c_argc == 0) { - save_chk(name, start_addr, end_addr, saveflag); + ok = save_chk(name, start_addr, end_addr, saveflag); } else { if (!stat(c_argv[0], &buf)) { if (saveflag == WRITE) { @@ -628,11 +629,7 @@ yd_addr() /*********** Save file if not read only ********************/ int -save_chk(fname, start, end, flags) - char *fname; - char *start; - char *end; - int flags; +save_chk(char *fname, char *start, char *end, int flags) { if (P(P_RO)) { sprintf(string, "\"%s\" File is read only", name); @@ -656,9 +653,7 @@ do_exit() int -doecmd(arg, force) - char *arg; - int force; +doecmd(char *arg, int force) { char *tmp; @@ -721,33 +716,34 @@ clearstr() /**** displays an error message *****/ void -emsg(s) - char *s; +emsg(char *s) { int cnt; - int stchar; + /* + int stchar; - if (P(P_EB)) beep(); if (P(P_MO)) { stchar = statsize; } else { stchar = 0; } - + */ + if (P(P_EB)) beep(); + statusflag = 0; clearstr(); attrset(A_REVERSE); cnt = outmsg(s); attrset(A_NORMAL); - if (cnt >= (maxx - stchar)) { - addch('\n'); - wait_return(TRUE); } + if (cnt >= (maxx)) { + // addch('\n'); + wait_return(TRUE); + } } /*** System error message *****/ void -sysemsg(s) - char *s; +sysemsg(char *s) { char string[256]; @@ -763,8 +759,7 @@ sysemsg(s) /*** displays mode if showmode set *****/ void -smsg(s) - char *s; +smsg(char *s) { if (P(P_MO)) { msg(s); @@ -775,30 +770,30 @@ smsg(s) /************* displays s on status line *****************/ void -msg(s) - char *s; +msg(char *s) { + /* int stchar; if (P(P_MO)) { stchar = statsize; } else { stchar = 0; - } + }o*/ + statusflag = 0; clearstr(); - if (outmsg(s) >= (maxx - stchar)) { - addch('\n'); + if (outmsg(s) >= maxx) { + // addch('\n'); wait_return(TRUE); } } int -outmsg(s) - char *s; +outmsg(char *s) { char *poi; - int cnt = 0; + int cnt = 0; move(maxy, 0); poi = strchr(s, '|'); @@ -810,7 +805,7 @@ outmsg(s) cnt++; } } else { - if (poi) poi++; + if (poi) poi++; else poi = s; while (*poi) { if (*poi == '@') addch(' '); @@ -827,8 +822,7 @@ outmsg(s) * */ int -wait_return(flag) - int flag; +wait_return(int flag) { int c; @@ -851,8 +845,7 @@ wait_return(flag) int -chk_comm(flag) - int flag; +chk_comm(int flag) { if ((flag & NO_ADDR) && (addr_flag > 0)) { emsg(noaddr); return 1; } diff --git a/config.guess b/config.guess index 7f9ebbe..48a6846 100644 --- a/config.guess +++ b/config.guess @@ -1,12 +1,14 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2019 Free Software Foundation, Inc. +# Copyright 1992-2024 Free Software Foundation, Inc. -timestamp='2019-09-10' +# shellcheck disable=SC2006,SC2268 # see below for rationale + +timestamp='2024-07-27' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or +# 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 @@ -27,17 +29,25 @@ timestamp='2019-09-10' # 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/gitweb/?p=config.git;a=blob_plain;f=config.guess +# 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. +Output the configuration name of the system '$me' is run on. Options: -h, --help print this help, then exit @@ -50,13 +60,13 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2019 Free Software Foundation, Inc. +Copyright 1992-2024 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" -Try \`$me --help' for more information." +Try '$me --help' for more information." # Parse command line while test $# -gt 0 ; do @@ -84,13 +94,16 @@ if test $# != 0; then 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. +# 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. @@ -99,8 +112,10 @@ tmp= 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 + # 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 ; } || @@ -108,9 +123,9 @@ set_cc_for_build() { dummy=$tmp/dummy case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in ,,) echo "int x;" > "$dummy.c" - for driver in cc gcc c89 c99 ; do + for driver in cc gcc c17 c99 c89 ; do if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then - CC_FOR_BUILD="$driver" + CC_FOR_BUILD=$driver break fi done @@ -131,40 +146,57 @@ 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_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown -case "$UNAME_SYSTEM" in +case $UNAME_SYSTEM in Linux|GNU|GNU/*) - # If the system lacks a compiler, then just pick glibc. - # We could probably try harder. - LIBC=gnu + LIBC=unknown set_cc_for_build cat <<-EOF > "$dummy.c" + #if defined(__ANDROID__) + LIBC=android + #else #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc - #else + #elif defined(__GLIBC__) LIBC=gnu + #elif defined(__LLVM_LIBC__) + LIBC=llvm + #else + #include + /* First heuristic to detect musl libc. */ + #ifdef __DEFINED_va_list + LIBC=musl + #endif + #endif #endif EOF - eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`" + cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` + eval "$cc_set_libc" - # If ldd exists, use it to detect musl libc. - if command -v ldd >/dev/null && \ - ldd --version 2>&1 | grep -q ^musl - then - LIBC=musl + # 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 +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*, @@ -176,12 +208,12 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". - sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ - "/sbin/$sysctl" 2>/dev/null || \ - "/usr/sbin/$sysctl" 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 + case $UNAME_MACHINE_ARCH in + aarch64eb) machine=aarch64_be-unknown ;; armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; @@ -190,13 +222,13 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in 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=${arch}${endian}-unknown ;; - *) machine="$UNAME_MACHINE_ARCH"-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 + case $UNAME_MACHINE_ARCH in earm*) os=netbsdelf ;; @@ -217,7 +249,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in ;; esac # Determine ABI tags. - case "$UNAME_MACHINE_ARCH" in + case $UNAME_MACHINE_ARCH in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` @@ -228,7 +260,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in # 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 + case $UNAME_VERSION in Debian*) release='-gnu' ;; @@ -239,51 +271,57 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "$machine-${os}${release}${abi-}" - exit ;; + GUESS=$machine-${os}${release}${abi-} + ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` - echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE + ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` - echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" - exit ;; + 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\.//'` - echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE + ;; *:MidnightBSD:*:*) - echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE + ;; *:ekkoBSD:*:*) - echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE + ;; *:SolidBSD:*:*) - echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE-unknown-solidbsd$UNAME_RELEASE + ;; *:OS108:*:*) - echo "$UNAME_MACHINE"-unknown-os108_"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE-unknown-os108_$UNAME_RELEASE + ;; macppc:MirBSD:*:*) - echo powerpc-unknown-mirbsd"$UNAME_RELEASE" - exit ;; + GUESS=powerpc-unknown-mirbsd$UNAME_RELEASE + ;; *:MirBSD:*:*) - echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE-unknown-mirbsd$UNAME_RELEASE + ;; *:Sortix:*:*) - echo "$UNAME_MACHINE"-unknown-sortix - exit ;; + GUESS=$UNAME_MACHINE-unknown-sortix + ;; *:Twizzler:*:*) - echo "$UNAME_MACHINE"-unknown-twizzler - exit ;; + GUESS=$UNAME_MACHINE-unknown-twizzler + ;; *:Redox:*:*) - echo "$UNAME_MACHINE"-unknown-redox - exit ;; + GUESS=$UNAME_MACHINE-unknown-redox + ;; mips:OSF1:*.*) - echo mips-dec-osf1 - exit ;; + 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}'` @@ -297,7 +335,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in # 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 + case $ALPHA_CPU_TYPE in "EV4 (21064)") UNAME_MACHINE=alpha ;; "EV4.5 (21064)") @@ -334,117 +372,121 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. - echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`" - # Reset EXIT trap before exiting to avoid spurious non-zero exit code. - exitcode=$? - trap '' 0 - exit $exitcode ;; + 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:*) - echo m68k-unknown-sysv4 - exit ;; + GUESS=m68k-unknown-sysv4 + ;; *:[Aa]miga[Oo][Ss]:*:*) - echo "$UNAME_MACHINE"-unknown-amigaos - exit ;; + GUESS=$UNAME_MACHINE-unknown-amigaos + ;; *:[Mm]orph[Oo][Ss]:*:*) - echo "$UNAME_MACHINE"-unknown-morphos - exit ;; + GUESS=$UNAME_MACHINE-unknown-morphos + ;; *:OS/390:*:*) - echo i370-ibm-openedition - exit ;; + GUESS=i370-ibm-openedition + ;; *:z/VM:*:*) - echo s390-ibm-zvmoe - exit ;; + GUESS=s390-ibm-zvmoe + ;; *:OS400:*:*) - echo powerpc-ibm-os400 - exit ;; + GUESS=powerpc-ibm-os400 + ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix"$UNAME_RELEASE" - exit ;; + GUESS=arm-acorn-riscix$UNAME_RELEASE + ;; arm*:riscos:*:*|arm*:RISCOS:*:*) - echo arm-unknown-riscos - exit ;; + GUESS=arm-unknown-riscos + ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) - echo hppa1.1-hitachi-hiuxmpp - exit ;; + 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. - if test "`(/bin/universe) 2>/dev/null`" = att ; then - echo pyramid-pyramid-sysv3 - else - echo pyramid-pyramid-bsd - fi - exit ;; + case `(/bin/universe) 2>/dev/null` in + att) GUESS=pyramid-pyramid-sysv3 ;; + *) GUESS=pyramid-pyramid-bsd ;; + esac + ;; NILE*:*:*:dcosx) - echo pyramid-pyramid-svr4 - exit ;; + GUESS=pyramid-pyramid-svr4 + ;; DRS?6000:unix:4.0:6*) - echo sparc-icl-nx6 - exit ;; + GUESS=sparc-icl-nx6 + ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in - sparc) echo sparc-icl-nx7; exit ;; - esac ;; + sparc) GUESS=sparc-icl-nx7 ;; + esac + ;; s390x:SunOS:*:*) - echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL + ;; sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=sparc-hal-solaris2$SUN_REL + ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=sparc-sun-solaris2$SUN_REL + ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) - echo i386-pc-auroraux"$UNAME_RELEASE" - exit ;; + 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 [ "$CC_FOR_BUILD" != no_compiler_found ]; then + 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) | \ + (CCOPTS="" $CC_FOR_BUILD -m64 -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH=x86_64 fi fi - echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" - exit ;; + 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. - echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=sparc-sun-solaris3$SUN_REL + ;; sun4*:SunOS:*:*) - case "`/usr/bin/arch -k`" in + case `/usr/bin/arch -k` in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac - # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`" - exit ;; + # 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:*:*) - echo m68k-sun-sunos"$UNAME_RELEASE" - exit ;; + 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 + case `/bin/arch` in sun3) - echo m68k-sun-sunos"$UNAME_RELEASE" + GUESS=m68k-sun-sunos$UNAME_RELEASE ;; sun4) - echo sparc-sun-sunos"$UNAME_RELEASE" + GUESS=sparc-sun-sunos$UNAME_RELEASE ;; esac - exit ;; + ;; aushp:SunOS:*:*) - echo sparc-auspex-sunos"$UNAME_RELEASE" - exit ;; + 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 @@ -454,41 +496,41 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint"$UNAME_RELEASE" - exit ;; + GUESS=m68k-atari-mint$UNAME_RELEASE + ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint"$UNAME_RELEASE" - exit ;; + GUESS=m68k-atari-mint$UNAME_RELEASE + ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint"$UNAME_RELEASE" - exit ;; + GUESS=m68k-atari-mint$UNAME_RELEASE + ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint"$UNAME_RELEASE" - exit ;; + GUESS=m68k-milan-mint$UNAME_RELEASE + ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint"$UNAME_RELEASE" - exit ;; + GUESS=m68k-hades-mint$UNAME_RELEASE + ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint"$UNAME_RELEASE" - exit ;; + GUESS=m68k-unknown-mint$UNAME_RELEASE + ;; m68k:machten:*:*) - echo m68k-apple-machten"$UNAME_RELEASE" - exit ;; + GUESS=m68k-apple-machten$UNAME_RELEASE + ;; powerpc:machten:*:*) - echo powerpc-apple-machten"$UNAME_RELEASE" - exit ;; + GUESS=powerpc-apple-machten$UNAME_RELEASE + ;; RISC*:Mach:*:*) - echo mips-dec-mach_bsd4.3 - exit ;; + GUESS=mips-dec-mach_bsd4.3 + ;; RISC*:ULTRIX:*:*) - echo mips-dec-ultrix"$UNAME_RELEASE" - exit ;; + GUESS=mips-dec-ultrix$UNAME_RELEASE + ;; VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix"$UNAME_RELEASE" - exit ;; + GUESS=vax-dec-ultrix$UNAME_RELEASE + ;; 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix"$UNAME_RELEASE" - exit ;; + GUESS=clipper-intergraph-clix$UNAME_RELEASE + ;; mips:*:*:UMIPS | mips:*:*:RISCos) set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" @@ -516,82 +558,84 @@ EOF dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`"$dummy" "$dummyarg"` && { echo "$SYSTEM_NAME"; exit; } - echo mips-mips-riscos"$UNAME_RELEASE" - exit ;; + GUESS=mips-mips-riscos$UNAME_RELEASE + ;; Motorola:PowerMAX_OS:*:*) - echo powerpc-motorola-powermax - exit ;; + GUESS=powerpc-motorola-powermax + ;; Motorola:*:4.3:PL8-*) - echo powerpc-harris-powermax - exit ;; + GUESS=powerpc-harris-powermax + ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) - echo powerpc-harris-powermax - exit ;; + GUESS=powerpc-harris-powermax + ;; Night_Hawk:Power_UNIX:*:*) - echo powerpc-harris-powerunix - exit ;; + GUESS=powerpc-harris-powerunix + ;; m88k:CX/UX:7*:*) - echo m88k-harris-cxux7 - exit ;; + GUESS=m88k-harris-cxux7 + ;; m88k:*:4*:R4*) - echo m88k-motorola-sysv4 - exit ;; + GUESS=m88k-motorola-sysv4 + ;; m88k:*:3*:R3*) - echo m88k-motorola-sysv3 - exit ;; + GUESS=m88k-motorola-sysv3 + ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ] + if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110 then - if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \ - [ "$TARGET_BINARY_INTERFACE"x = x ] + if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \ + test "$TARGET_BINARY_INTERFACE"x = x then - echo m88k-dg-dgux"$UNAME_RELEASE" + GUESS=m88k-dg-dgux$UNAME_RELEASE else - echo m88k-dg-dguxbcs"$UNAME_RELEASE" + GUESS=m88k-dg-dguxbcs$UNAME_RELEASE fi else - echo i586-dg-dgux"$UNAME_RELEASE" + GUESS=i586-dg-dgux$UNAME_RELEASE fi - exit ;; + ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) - echo m88k-dolphin-sysv3 - exit ;; + GUESS=m88k-dolphin-sysv3 + ;; M88*:*:R3*:*) # Delta 88k system running SVR3 - echo m88k-motorola-sysv3 - exit ;; + GUESS=m88k-motorola-sysv3 + ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) - echo m88k-tektronix-sysv3 - exit ;; + GUESS=m88k-tektronix-sysv3 + ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) - echo m68k-tektronix-bsd - exit ;; + GUESS=m68k-tektronix-bsd + ;; *:IRIX*:*:*) - echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`" - exit ;; + 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. - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + GUESS=romp-ibm-aix # uname -m gives an 8 hex-code CPU id + ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) - echo i386-ibm-aix - exit ;; + GUESS=i386-ibm-aix + ;; ia64:AIX:*:*) - if [ -x /usr/bin/oslevel ] ; then + if test -x /usr/bin/oslevel ; then IBM_REV=`/usr/bin/oslevel` else - IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" + IBM_REV=$UNAME_VERSION.$UNAME_RELEASE fi - echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV" - exit ;; + 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() + int + main () { if (!__power_pc()) exit(1); @@ -601,16 +645,16 @@ EOF EOF if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` then - echo "$SYSTEM_NAME" + GUESS=$SYSTEM_NAME else - echo rs6000-ibm-aix3.2.5 + GUESS=rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then - echo rs6000-ibm-aix3.2.4 + GUESS=rs6000-ibm-aix3.2.4 else - echo rs6000-ibm-aix3.2 + GUESS=rs6000-ibm-aix3.2 fi - exit ;; + ;; *: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 @@ -618,56 +662,56 @@ EOF else IBM_ARCH=powerpc fi - if [ -x /usr/bin/lslpp ] ; then - IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | + 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" + IBM_REV=$UNAME_VERSION.$UNAME_RELEASE fi - echo "$IBM_ARCH"-ibm-aix"$IBM_REV" - exit ;; + GUESS=$IBM_ARCH-ibm-aix$IBM_REV + ;; *:AIX:*:*) - echo rs6000-ibm-aix - exit ;; + GUESS=rs6000-ibm-aix + ;; ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) - echo romp-ibm-bsd4.4 - exit ;; + GUESS=romp-ibm-bsd4.4 + ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to - exit ;; # report: romp-ibm BSD 4.3 + GUESS=romp-ibm-bsd$UNAME_RELEASE # 4.3 with uname added to + ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) - echo rs6000-bull-bosx - exit ;; + GUESS=rs6000-bull-bosx + ;; DPX/2?00:B.O.S.:*:*) - echo m68k-bull-sysv3 - exit ;; + GUESS=m68k-bull-sysv3 + ;; 9000/[34]??:4.3bsd:1.*:*) - echo m68k-hp-bsd - exit ;; + GUESS=m68k-hp-bsd + ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) - echo m68k-hp-bsd4.4 - exit ;; + GUESS=m68k-hp-bsd4.4 + ;; 9000/[34678]??:HP-UX:*:*) - HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` - case "$UNAME_MACHINE" in + HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` + case $UNAME_MACHINE in 9000/31?) HP_ARCH=m68000 ;; 9000/[34]??) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) - if [ -x /usr/bin/getconf ]; then + 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 + 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 + case $sc_kernel_bits in 32) HP_ARCH=hppa2.0n ;; 64) HP_ARCH=hppa2.0w ;; '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi - if [ "$HP_ARCH" = "" ]; then + if test "$HP_ARCH" = ""; then set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" @@ -675,7 +719,8 @@ EOF #include #include - int main () + int + main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); @@ -706,7 +751,7 @@ EOF test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac - if [ "$HP_ARCH" = hppa2.0w ] + if test "$HP_ARCH" = hppa2.0w then set_cc_for_build @@ -727,12 +772,12 @@ EOF HP_ARCH=hppa64 fi fi - echo "$HP_ARCH"-hp-hpux"$HPUX_REV" - exit ;; + GUESS=$HP_ARCH-hp-hpux$HPUX_REV + ;; ia64:HP-UX:*:*) - HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` - echo ia64-hp-hpux"$HPUX_REV" - exit ;; + 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" @@ -762,36 +807,36 @@ EOF EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } - echo unknown-hitachi-hiuxwe2 - exit ;; + GUESS=unknown-hitachi-hiuxwe2 + ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) - echo hppa1.1-hp-bsd - exit ;; + GUESS=hppa1.1-hp-bsd + ;; 9000/8??:4.3bsd:*:*) - echo hppa1.0-hp-bsd - exit ;; + GUESS=hppa1.0-hp-bsd + ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) - echo hppa1.0-hp-mpeix - exit ;; + GUESS=hppa1.0-hp-mpeix + ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) - echo hppa1.1-hp-osf - exit ;; + GUESS=hppa1.1-hp-osf + ;; hp8??:OSF1:*:*) - echo hppa1.0-hp-osf - exit ;; + GUESS=hppa1.0-hp-osf + ;; i*86:OSF1:*:*) - if [ -x /usr/sbin/sysversion ] ; then - echo "$UNAME_MACHINE"-unknown-osf1mk + if test -x /usr/sbin/sysversion ; then + GUESS=$UNAME_MACHINE-unknown-osf1mk else - echo "$UNAME_MACHINE"-unknown-osf1 + GUESS=$UNAME_MACHINE-unknown-osf1 fi - exit ;; + ;; parisc*:Lites*:*:*) - echo hppa1.1-hp-lites - exit ;; + GUESS=hppa1.1-hp-lites + ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) - echo c1-convex-bsd - exit ;; + GUESS=c1-convex-bsd + ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd @@ -799,17 +844,18 @@ EOF fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) - echo c34-convex-bsd - exit ;; + GUESS=c34-convex-bsd + ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) - echo c38-convex-bsd - exit ;; + GUESS=c38-convex-bsd + ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) - echo c4-convex-bsd - exit ;; + GUESS=c4-convex-bsd + ;; CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' - exit ;; + 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/' \ @@ -817,114 +863,155 @@ EOF -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) - echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' - exit ;; + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=t90-cray-unicos$CRAY_REL + ;; CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' - exit ;; + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=alphaev5-cray-unicosmk$CRAY_REL + ;; CRAY*SV1:*:*:*) - echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' - exit ;; + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=sv1-cray-unicos$CRAY_REL + ;; *:UNICOS/mp:*:*) - echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' - exit ;; + 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/ /_/'` - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; + 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/ /_/'` - echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; + GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} + ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE + ;; sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi"$UNAME_RELEASE" - exit ;; + GUESS=sparc-unknown-bsdi$UNAME_RELEASE + ;; *:BSD/OS:*:*) - echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" - exit ;; + 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 - echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabi + FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabi else - echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabihf + FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabihf fi - exit ;; + ;; *:FreeBSD:*:*) - UNAME_PROCESSOR=`/usr/bin/uname -p` - case "$UNAME_PROCESSOR" in + UNAME_PROCESSOR=`uname -p` + case $UNAME_PROCESSOR in amd64) UNAME_PROCESSOR=x86_64 ;; i386) UNAME_PROCESSOR=i586 ;; esac - echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" - exit ;; + FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL + ;; i*:CYGWIN*:*) - echo "$UNAME_MACHINE"-pc-cygwin - exit ;; + GUESS=$UNAME_MACHINE-pc-cygwin + ;; *:MINGW64*:*) - echo "$UNAME_MACHINE"-pc-mingw64 - exit ;; + GUESS=$UNAME_MACHINE-pc-mingw64 + ;; *:MINGW*:*) - echo "$UNAME_MACHINE"-pc-mingw32 - exit ;; + GUESS=$UNAME_MACHINE-pc-mingw32 + ;; *:MSYS*:*) - echo "$UNAME_MACHINE"-pc-msys - exit ;; + GUESS=$UNAME_MACHINE-pc-msys + ;; i*:PW*:*) - echo "$UNAME_MACHINE"-pc-pw32 - exit ;; + GUESS=$UNAME_MACHINE-pc-pw32 + ;; + *:SerenityOS:*:*) + GUESS=$UNAME_MACHINE-pc-serenity + ;; *:Interix*:*) - case "$UNAME_MACHINE" in + case $UNAME_MACHINE in x86) - echo i586-pc-interix"$UNAME_RELEASE" - exit ;; + GUESS=i586-pc-interix$UNAME_RELEASE + ;; authenticamd | genuineintel | EM64T) - echo x86_64-unknown-interix"$UNAME_RELEASE" - exit ;; + GUESS=x86_64-unknown-interix$UNAME_RELEASE + ;; IA64) - echo ia64-unknown-interix"$UNAME_RELEASE" - exit ;; + GUESS=ia64-unknown-interix$UNAME_RELEASE + ;; esac ;; i*:UWIN*:*) - echo "$UNAME_MACHINE"-pc-uwin - exit ;; + GUESS=$UNAME_MACHINE-pc-uwin + ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) - echo x86_64-pc-cygwin - exit ;; + GUESS=x86_64-pc-cygwin + ;; prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=powerpcle-unknown-solaris2$SUN_REL + ;; *:GNU:*:*) # the GNU system - echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`" - exit ;; + 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 - echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC" - exit ;; + GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"` + GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC + ;; + x86_64:[Mm]anagarm:*:*|i?86:[Mm]anagarm:*:*) + GUESS="$UNAME_MACHINE-pc-managarm-mlibc" + ;; + *:[Mm]anagarm:*:*) + GUESS="$UNAME_MACHINE-unknown-managarm-mlibc" + ;; *:Minix:*:*) - echo "$UNAME_MACHINE"-unknown-minix - exit ;; + GUESS=$UNAME_MACHINE-unknown-minix + ;; aarch64:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + set_cc_for_build + CPU=$UNAME_MACHINE + LIBCABI=$LIBC + if test "$CC_FOR_BUILD" != no_compiler_found; then + ABI=64 + sed 's/^ //' << EOF > "$dummy.c" + #ifdef __ARM_EABI__ + #ifdef __ARM_PCS_VFP + ABI=eabihf + #else + ABI=eabi + #endif + #endif +EOF + cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'` + eval "$cc_set_abi" + case $ABI in + eabi | eabihf) CPU=armv8l; LIBCABI=$LIBC$ABI ;; + esac + fi + GUESS=$CPU-unknown-linux-$LIBCABI + ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + 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 ;; @@ -935,60 +1022,72 @@ EOF esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC=gnulibc1 ; fi - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - arc:Linux:*:* | arceb:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + 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 - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + 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 - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi + GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi else - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf + GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf fi fi - exit ;; + ;; avr32*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; cris:Linux:*:*) - echo "$UNAME_MACHINE"-axis-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-axis-linux-$LIBC + ;; crisv32:Linux:*:*) - echo "$UNAME_MACHINE"-axis-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-axis-linux-$LIBC + ;; e2k:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; frv:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; hexagon:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; i*86:Linux:*:*) - echo "$UNAME_MACHINE"-pc-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-pc-linux-$LIBC + ;; ia64:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; k1om:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + kvx:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + kvx:cos:*:*) + GUESS=$UNAME_MACHINE-unknown-cos + ;; + kvx:mbr:*:*) + GUESS=$UNAME_MACHINE-unknown-mbr + ;; + loongarch32:Linux:*:* | loongarch64:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; m32r*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; m68*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; mips:Linux:*:* | mips64:Linux:*:*) set_cc_for_build IS_GLIBC=0 @@ -1033,113 +1132,135 @@ EOF #endif #endif EOF - eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'`" + 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:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; openrisc*:Linux:*:*) - echo or1k-unknown-linux-"$LIBC" - exit ;; + GUESS=or1k-unknown-linux-$LIBC + ;; or32:Linux:*:* | or1k*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; padre:Linux:*:*) - echo sparc-unknown-linux-"$LIBC" - exit ;; + GUESS=sparc-unknown-linux-$LIBC + ;; parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-"$LIBC" - exit ;; + 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*) echo hppa1.1-unknown-linux-"$LIBC" ;; - PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;; - *) echo hppa-unknown-linux-"$LIBC" ;; + PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;; + PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;; + *) GUESS=hppa-unknown-linux-$LIBC ;; esac - exit ;; + ;; ppc64:Linux:*:*) - echo powerpc64-unknown-linux-"$LIBC" - exit ;; + GUESS=powerpc64-unknown-linux-$LIBC + ;; ppc:Linux:*:*) - echo powerpc-unknown-linux-"$LIBC" - exit ;; + GUESS=powerpc-unknown-linux-$LIBC + ;; ppc64le:Linux:*:*) - echo powerpc64le-unknown-linux-"$LIBC" - exit ;; + GUESS=powerpc64le-unknown-linux-$LIBC + ;; ppcle:Linux:*:*) - echo powerpcle-unknown-linux-"$LIBC" - exit ;; - riscv32:Linux:*:* | riscv64:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=powerpcle-unknown-linux-$LIBC + ;; + riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; s390:Linux:*:* | s390x:Linux:*:*) - echo "$UNAME_MACHINE"-ibm-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-ibm-linux-$LIBC + ;; sh64*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; sh*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; sparc:Linux:*:* | sparc64:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; tile*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; vax:Linux:*:*) - echo "$UNAME_MACHINE"-dec-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-dec-linux-$LIBC + ;; x86_64:Linux:*:*) - echo "$UNAME_MACHINE"-pc-linux-"$LIBC" - exit ;; + 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:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + 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. - echo i386-sequent-sysv4 - exit ;; + 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. - echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION" - exit ;; + GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION + ;; i*86:OS/2:*:*) - # If we were able to find `uname', then EMX Unix compatibility + # If we were able to find 'uname', then EMX Unix compatibility # is probably installed. - echo "$UNAME_MACHINE"-pc-os2-emx - exit ;; + GUESS=$UNAME_MACHINE-pc-os2-emx + ;; i*86:XTS-300:*:STOP) - echo "$UNAME_MACHINE"-unknown-stop - exit ;; + GUESS=$UNAME_MACHINE-unknown-stop + ;; i*86:atheos:*:*) - echo "$UNAME_MACHINE"-unknown-atheos - exit ;; + GUESS=$UNAME_MACHINE-unknown-atheos + ;; i*86:syllable:*:*) - echo "$UNAME_MACHINE"-pc-syllable - exit ;; + GUESS=$UNAME_MACHINE-pc-syllable + ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) - echo i386-unknown-lynxos"$UNAME_RELEASE" - exit ;; + GUESS=i386-unknown-lynxos$UNAME_RELEASE + ;; i*86:*DOS:*:*) - echo "$UNAME_MACHINE"-pc-msdosdjgpp - exit ;; + 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 - echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL" + GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL else - echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL" + GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL fi - exit ;; + ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in @@ -1147,12 +1268,12 @@ EOF *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac - echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}" - exit ;; + 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 @@ -1162,11 +1283,11 @@ EOF && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 - echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL" + GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL else - echo "$UNAME_MACHINE"-pc-sysv32 + GUESS=$UNAME_MACHINE-pc-sysv32 fi - exit ;; + ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about @@ -1174,31 +1295,31 @@ EOF # 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. - echo i586-pc-msdosdjgpp - exit ;; + GUESS=i586-pc-msdosdjgpp + ;; Intel:Mach:3*:*) - echo i386-pc-mach3 - exit ;; + GUESS=i386-pc-mach3 + ;; paragon:*:*:*) - echo i860-intel-osf1 - exit ;; + GUESS=i860-intel-osf1 + ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4 + GUESS=i860-stardent-sysv$UNAME_RELEASE # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4 + GUESS=i860-unknown-sysv$UNAME_RELEASE # Unknown i860-SVR4 fi - exit ;; + ;; mini*:CTIX:SYS*5:*) # "miniframe" - echo m68010-convergent-sysv - exit ;; + GUESS=m68010-convergent-sysv + ;; mc68k:UNIX:SYSTEM5:3.51m) - echo m68k-convergent-sysv - exit ;; + GUESS=m68k-convergent-sysv + ;; M680?0:D-NIX:5.3:*) - echo m68k-diab-dnix - exit ;; + 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) @@ -1223,113 +1344,119 @@ EOF /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos"$UNAME_RELEASE" - exit ;; + GUESS=m68k-unknown-lynxos$UNAME_RELEASE + ;; mc68030:UNIX_System_V:4.*:*) - echo m68k-atari-sysv4 - exit ;; + GUESS=m68k-atari-sysv4 + ;; TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos"$UNAME_RELEASE" - exit ;; + GUESS=sparc-unknown-lynxos$UNAME_RELEASE + ;; rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos"$UNAME_RELEASE" - exit ;; + GUESS=rs6000-unknown-lynxos$UNAME_RELEASE + ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) - echo powerpc-unknown-lynxos"$UNAME_RELEASE" - exit ;; + GUESS=powerpc-unknown-lynxos$UNAME_RELEASE + ;; SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv"$UNAME_RELEASE" - exit ;; + GUESS=mips-dde-sysv$UNAME_RELEASE + ;; RM*:ReliantUNIX-*:*:*) - echo mips-sni-sysv4 - exit ;; + GUESS=mips-sni-sysv4 + ;; RM*:SINIX-*:*:*) - echo mips-sni-sysv4 - exit ;; + GUESS=mips-sni-sysv4 + ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo "$UNAME_MACHINE"-sni-sysv4 + GUESS=$UNAME_MACHINE-sni-sysv4 else - echo ns32k-sni-sysv + GUESS=ns32k-sni-sysv fi - exit ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + ;; + PENTIUM:*:4.0*:*) # Unisys 'ClearPath HMP IX 4000' SVR4/MP effort # says - echo i586-unisys-sysv4 - exit ;; + GUESS=i586-unisys-sysv4 + ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm - echo hppa1.1-stratus-sysv4 - exit ;; + GUESS=hppa1.1-stratus-sysv4 + ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. - echo i860-stratus-sysv4 - exit ;; + GUESS=i860-stratus-sysv4 + ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. - echo "$UNAME_MACHINE"-stratus-vos - exit ;; + GUESS=$UNAME_MACHINE-stratus-vos + ;; *:VOS:*:*) # From Paul.Green@stratus.com. - echo hppa1.1-stratus-vos - exit ;; + GUESS=hppa1.1-stratus-vos + ;; mc68*:A/UX:*:*) - echo m68k-apple-aux"$UNAME_RELEASE" - exit ;; + GUESS=m68k-apple-aux$UNAME_RELEASE + ;; news*:NEWS-OS:6*:*) - echo mips-sony-newsos6 - exit ;; + GUESS=mips-sony-newsos6 + ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) - if [ -d /usr/nec ]; then - echo mips-nec-sysv"$UNAME_RELEASE" + if test -d /usr/nec; then + GUESS=mips-nec-sysv$UNAME_RELEASE else - echo mips-unknown-sysv"$UNAME_RELEASE" + GUESS=mips-unknown-sysv$UNAME_RELEASE fi - exit ;; + ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. - echo powerpc-be-beos - exit ;; + GUESS=powerpc-be-beos + ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. - echo powerpc-apple-beos - exit ;; + GUESS=powerpc-apple-beos + ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. - echo i586-pc-beos - exit ;; + GUESS=i586-pc-beos + ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. - echo i586-pc-haiku - exit ;; - x86_64:Haiku:*:*) - echo x86_64-unknown-haiku - exit ;; + 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:*:*) - echo sx4-nec-superux"$UNAME_RELEASE" - exit ;; + GUESS=sx4-nec-superux$UNAME_RELEASE + ;; SX-5:SUPER-UX:*:*) - echo sx5-nec-superux"$UNAME_RELEASE" - exit ;; + GUESS=sx5-nec-superux$UNAME_RELEASE + ;; SX-6:SUPER-UX:*:*) - echo sx6-nec-superux"$UNAME_RELEASE" - exit ;; + GUESS=sx6-nec-superux$UNAME_RELEASE + ;; SX-7:SUPER-UX:*:*) - echo sx7-nec-superux"$UNAME_RELEASE" - exit ;; + GUESS=sx7-nec-superux$UNAME_RELEASE + ;; SX-8:SUPER-UX:*:*) - echo sx8-nec-superux"$UNAME_RELEASE" - exit ;; + GUESS=sx8-nec-superux$UNAME_RELEASE + ;; SX-8R:SUPER-UX:*:*) - echo sx8r-nec-superux"$UNAME_RELEASE" - exit ;; + GUESS=sx8r-nec-superux$UNAME_RELEASE + ;; SX-ACE:SUPER-UX:*:*) - echo sxace-nec-superux"$UNAME_RELEASE" - exit ;; + GUESS=sxace-nec-superux$UNAME_RELEASE + ;; Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody"$UNAME_RELEASE" - exit ;; + GUESS=powerpc-apple-rhapsody$UNAME_RELEASE + ;; *:Rhapsody:*:*) - echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE + ;; + arm64:Darwin:*:*) + GUESS=aarch64-apple-darwin$UNAME_RELEASE + ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` case $UNAME_PROCESSOR in @@ -1344,7 +1471,7 @@ EOF else set_cc_for_build fi - if [ "$CC_FOR_BUILD" != no_compiler_found ]; then + 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 @@ -1365,109 +1492,122 @@ EOF # uname -m returns i386 or x86_64 UNAME_PROCESSOR=$UNAME_MACHINE fi - echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" - exit ;; + 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 - echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE + ;; *:QNX:*:4*) - echo i386-pc-qnx - exit ;; + GUESS=i386-pc-qnx + ;; NEO-*:NONSTOP_KERNEL:*:*) - echo neo-tandem-nsk"$UNAME_RELEASE" - exit ;; + GUESS=neo-tandem-nsk$UNAME_RELEASE + ;; NSE-*:NONSTOP_KERNEL:*:*) - echo nse-tandem-nsk"$UNAME_RELEASE" - exit ;; + GUESS=nse-tandem-nsk$UNAME_RELEASE + ;; NSR-*:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk"$UNAME_RELEASE" - exit ;; + GUESS=nsr-tandem-nsk$UNAME_RELEASE + ;; NSV-*:NONSTOP_KERNEL:*:*) - echo nsv-tandem-nsk"$UNAME_RELEASE" - exit ;; + GUESS=nsv-tandem-nsk$UNAME_RELEASE + ;; NSX-*:NONSTOP_KERNEL:*:*) - echo nsx-tandem-nsk"$UNAME_RELEASE" - exit ;; + GUESS=nsx-tandem-nsk$UNAME_RELEASE + ;; *:NonStop-UX:*:*) - echo mips-compaq-nonstopux - exit ;; + GUESS=mips-compaq-nonstopux + ;; BS2000:POSIX*:*:*) - echo bs2000-siemens-sysv - exit ;; + GUESS=bs2000-siemens-sysv + ;; DS/*:UNIX_System_V:*:*) - echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE" - exit ;; + 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. - # shellcheck disable=SC2154 - if test "$cputype" = 386; then + if test "${cputype-}" = 386; then UNAME_MACHINE=i386 - else - UNAME_MACHINE="$cputype" + elif test "x${cputype-}" != x; then + UNAME_MACHINE=$cputype fi - echo "$UNAME_MACHINE"-unknown-plan9 - exit ;; + GUESS=$UNAME_MACHINE-unknown-plan9 + ;; *:TOPS-10:*:*) - echo pdp10-unknown-tops10 - exit ;; + GUESS=pdp10-unknown-tops10 + ;; *:TENEX:*:*) - echo pdp10-unknown-tenex - exit ;; + GUESS=pdp10-unknown-tenex + ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) - echo pdp10-dec-tops20 - exit ;; + GUESS=pdp10-dec-tops20 + ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) - echo pdp10-xkl-tops20 - exit ;; + GUESS=pdp10-xkl-tops20 + ;; *:TOPS-20:*:*) - echo pdp10-unknown-tops20 - exit ;; + GUESS=pdp10-unknown-tops20 + ;; *:ITS:*:*) - echo pdp10-unknown-its - exit ;; + GUESS=pdp10-unknown-its + ;; SEI:*:*:SEIUX) - echo mips-sei-seiux"$UNAME_RELEASE" - exit ;; + GUESS=mips-sei-seiux$UNAME_RELEASE + ;; *:DragonFly:*:*) - echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" - exit ;; + 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*) echo alpha-dec-vms ; exit ;; - I*) echo ia64-dec-vms ; exit ;; - V*) echo vax-dec-vms ; exit ;; + case $UNAME_MACHINE in + A*) GUESS=alpha-dec-vms ;; + I*) GUESS=ia64-dec-vms ;; + V*) GUESS=vax-dec-vms ;; esac ;; *:XENIX:*:SysV) - echo i386-pc-xenix - exit ;; + GUESS=i386-pc-xenix + ;; i*86:skyos:*:*) - echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`" - exit ;; + SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'` + GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL + ;; i*86:rdos:*:*) - echo "$UNAME_MACHINE"-pc-rdos - exit ;; - i*86:AROS:*:*) - echo "$UNAME_MACHINE"-pc-aros - exit ;; + GUESS=$UNAME_MACHINE-pc-rdos + ;; + i*86:Fiwix:*:*) + GUESS=$UNAME_MACHINE-pc-fiwix + ;; + *:AROS:*:*) + GUESS=$UNAME_MACHINE-unknown-aros + ;; x86_64:VMkernel:*:*) - echo "$UNAME_MACHINE"-unknown-esx - exit ;; + GUESS=$UNAME_MACHINE-unknown-esx + ;; amd64:Isilon\ OneFS:*:*) - echo x86_64-unknown-onefs - exit ;; + GUESS=x86_64-unknown-onefs + ;; *:Unleashed:*:*) - echo "$UNAME_MACHINE"-unknown-unleashed"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE + ;; + *:Ironclad:*:*) + GUESS=$UNAME_MACHINE-unknown-ironclad + ;; esac +# Do we have a guess based on uname results? +if test "x$GUESS" != x; then + echo "$GUESS" + exit +fi + # No uname command or uname output not recognized. set_cc_for_build cat > "$dummy.c" < "$dummy.c" </dev/null && SYSTEM_NAME=`$dummy` && +$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. @@ -1607,7 +1748,7 @@ test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; } echo "$0: unable to guess system type" >&2 -case "$UNAME_MACHINE:$UNAME_SYSTEM" in +case $UNAME_MACHINE:$UNAME_SYSTEM in mips:Linux | mips64:Linux) # If we got here on MIPS GNU/Linux, output extra information. cat >&2 <&2 < header file. */ -#undef HAVE_FCNTL_H - -/* Define if you have the header file. */ -#undef HAVE_INTTYPES_H - -/* Define if you have the `memmove' function. */ -#undef HAVE_MEMMOVE - -/* Define if you have the header file. */ -#undef HAVE_MEMORY_H - -/* Define if you have the header file. */ #undef HAVE_NCURSES_TERM_H -/* Define if you have the header file. */ +/* Define to 1 if you have the header file. */ +#undef HAVE_FCNTL_H + +/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */ +#undef HAVE_FSEEKO + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if your system has a GNU libc compatible `malloc' function, and + to 0 otherwise. */ +#undef HAVE_MALLOC + +/* Define to 1 if you have the `memmove' function. */ +#undef HAVE_MEMMOVE + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_NCURSES_TERM_H + +/* Define to 1 if your system has a GNU libc compatible `realloc' function, + and to 0 otherwise. */ +#undef HAVE_REALLOC + +/* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H -/* Define if you have the header file. */ +/* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H -/* Define if you have the `strdup' function. */ +/* Define to 1 if you have the `strdup' function. */ #undef HAVE_STRDUP -/* Define if you have the `strerror' function. */ +/* Define to 1 if you have the `strerror' function. */ #undef HAVE_STRERROR -/* Define if you have the header file. */ +/* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H -/* Define if you have the header file. */ +/* Define to 1 if you have the header file. */ #undef HAVE_STRING_H -/* Define if you have the `strtol' function. */ +/* Define to 1 if you have the `strtol' function. */ #undef HAVE_STRTOL -/* Define if you have the header file. */ +/* Define to 1 if you have the `strtoll' function. */ +#undef HAVE_STRTOLL + +/* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H -/* Define if you have the header file. */ +/* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H -/* Define if you have the header file. */ +/* Define to 1 if you have the header file. */ #undef HAVE_TERMCAP_H -/* Define if you have the header file. */ +/* Define to 1 if you have the header file. */ #undef HAVE_TERMIOS_H -/* Define if you have the header file. */ +/* Define to 1 if you have the header file. */ #undef HAVE_TERMIO_H -/* Define if you have the header file. */ +/* Define to 1 if you have the header file. */ #undef HAVE_TERM_H -/* Define if you have the header file. */ +/* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H -/* The size of a `int', as computed by sizeof. */ +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the home page for this package. */ +#undef PACKAGE_URL + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* The size of `int', as computed by sizeof. */ #undef SIZEOF_INT -/* The size of a `long', as computed by sizeof. */ +/* The size of `long', as computed by sizeof. */ #undef SIZEOF_LONG -/* The size of a `void *', as computed by sizeof. */ +/* The size of `long long', as computed by sizeof. */ +#undef SIZEOF_LONG_LONG + +/* The size of `void *', as computed by sizeof. */ #undef SIZEOF_VOID_P -/* Define if you have the ANSI C header files. */ +/* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +#undef _FILE_OFFSET_BITS + +/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */ +#undef _LARGEFILE_SOURCE + +/* Define for large files, on AIX-style hosts. */ +#undef _LARGE_FILES + +/* Define to rpl_malloc if the replacement function should be used. */ +#undef malloc + /* Define to `int' if does not define. */ #undef off_t +/* Define to rpl_realloc if the replacement function should be used. */ +#undef realloc + /* Define to `unsigned int' if does not define. */ #undef size_t diff --git a/config.sub b/config.sub index 0f2234c..4aaae46 100644 --- a/config.sub +++ b/config.sub @@ -1,12 +1,14 @@ #! /bin/sh # Configuration validation subroutine script. -# Copyright 1992-2019 Free Software Foundation, Inc. +# Copyright 1992-2024 Free Software Foundation, Inc. -timestamp='2019-06-30' +# shellcheck disable=SC2006,SC2268,SC2162 # see below for rationale + +timestamp='2024-05-27' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or +# 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 @@ -33,7 +35,7 @@ timestamp='2019-06-30' # 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/gitweb/?p=config.git;a=blob_plain;f=config.sub +# 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 @@ -50,6 +52,13 @@ timestamp='2019-06-30' # 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="\ @@ -67,13 +76,13 @@ Report bugs and patches to ." version="\ GNU config.sub ($timestamp) -Copyright 1992-2019 Free Software Foundation, Inc. +Copyright 1992-2024 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" -Try \`$me --help' for more information." +Try '$me --help' for more information." # Parse command line while test $# -gt 0 ; do @@ -111,75 +120,154 @@ case $# in esac # Split fields of configuration type -# shellcheck disable=SC2162 +saved_IFS=$IFS IFS="-" read field1 field2 field3 field4 <&2 + echo "Invalid configuration '$1': more than four components" >&2 exit 1 ;; *-*-*-*) basic_machine=$field1-$field2 - os=$field3-$field4 + 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-gnu* | linux-android* | linux-dietlibc \ - | linux-newlib* | linux-musl* | linux-uclibc* | uclinux-uclibc* \ - | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ - | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ - | storm-chaos* | os2-emx* | rtmk-nova*) + cloudabi*-eabi* \ + | kfreebsd*-gnu* \ + | knetbsd*-gnu* \ + | kopensolaris*-gnu* \ + | linux-* \ + | managarm-* \ + | netbsd*-eabi* \ + | netbsd*-gnu* \ + | nto-qnx* \ + | os2-emx* \ + | rtmk-nova* \ + | storm-chaos* \ + | uclinux-gnu* \ + | uclinux-uclibc* \ + | windows-* ) basic_machine=$field1 - os=$maybe_os + basic_os=$maybe_os ;; android-linux) basic_machine=$field1-unknown - os=linux-android + basic_os=linux-android ;; *) basic_machine=$field1-$field2 - os=$field3 + basic_os=$field3 ;; esac ;; *-*) - # A lone config we happen to match not fitting any pattern case $field1-$field2 in + # Shorthands that happen to contain a single dash + convex-c[12] | convex-c3[248]) + basic_machine=$field2-convex + basic_os= + ;; decstation-3100) basic_machine=mips-dec - os= + basic_os= ;; *-*) # Second component is usually, but not always the OS case $field2 in - # Prevent following clause from handling this valid os + # Do not treat sunos as a manufacturer sun*os*) basic_machine=$field1 - os=$field2 + 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) + 3100* \ + | 32* \ + | 3300* \ + | 3600* \ + | 7300* \ + | acorn \ + | altos* \ + | apollo \ + | apple \ + | atari \ + | att* \ + | axis \ + | be \ + | bull \ + | cbm \ + | ccur \ + | cisco \ + | commodore \ + | convergent* \ + | convex* \ + | cray \ + | crds \ + | dec* \ + | delta* \ + | dg \ + | digital \ + | dolphin \ + | encore* \ + | gould \ + | harris \ + | highlevel \ + | hitachi* \ + | hp \ + | ibm* \ + | intergraph \ + | isi* \ + | knuth \ + | masscomp \ + | microblaze* \ + | mips* \ + | motorola* \ + | ncr* \ + | news \ + | next \ + | ns \ + | oki \ + | omron* \ + | pc533* \ + | rebel \ + | rom68k \ + | rombug \ + | semi \ + | sequent* \ + | siemens \ + | sgi* \ + | siemens \ + | sim \ + | sni \ + | sony* \ + | stratus \ + | sun \ + | sun[234]* \ + | tektronix \ + | tti* \ + | ultra \ + | unicom* \ + | wec \ + | winbond \ + | wrs) basic_machine=$field1-$field2 - os= + basic_os= + ;; + zephyr*) + basic_machine=$field1-unknown + basic_os=$field2 ;; *) basic_machine=$field1 - os=$field2 + basic_os=$field2 ;; esac ;; @@ -191,447 +279,431 @@ case $1 in case $field1 in 386bsd) basic_machine=i386-pc - os=bsd + basic_os=bsd ;; a29khif) basic_machine=a29k-amd - os=udi + basic_os=udi ;; adobe68k) basic_machine=m68010-adobe - os=scout + basic_os=scout ;; alliant) basic_machine=fx80-alliant - os= + basic_os= ;; altos | altos3068) basic_machine=m68k-altos - os= + basic_os= ;; am29k) basic_machine=a29k-none - os=bsd + basic_os=bsd ;; amdahl) basic_machine=580-amdahl - os=sysv + basic_os=sysv ;; amiga) basic_machine=m68k-unknown - os= + basic_os= ;; amigaos | amigados) basic_machine=m68k-unknown - os=amigaos + basic_os=amigaos ;; amigaunix | amix) basic_machine=m68k-unknown - os=sysv4 + basic_os=sysv4 ;; apollo68) basic_machine=m68k-apollo - os=sysv + basic_os=sysv ;; apollo68bsd) basic_machine=m68k-apollo - os=bsd + basic_os=bsd ;; aros) basic_machine=i386-pc - os=aros + basic_os=aros ;; aux) basic_machine=m68k-apple - os=aux + basic_os=aux ;; balance) basic_machine=ns32k-sequent - os=dynix + basic_os=dynix ;; blackfin) basic_machine=bfin-unknown - os=linux + basic_os=linux ;; cegcc) basic_machine=arm-unknown - os=cegcc - ;; - convex-c1) - basic_machine=c1-convex - os=bsd - ;; - convex-c2) - basic_machine=c2-convex - os=bsd - ;; - convex-c32) - basic_machine=c32-convex - os=bsd - ;; - convex-c34) - basic_machine=c34-convex - os=bsd - ;; - convex-c38) - basic_machine=c38-convex - os=bsd + basic_os=cegcc ;; cray) basic_machine=j90-cray - os=unicos + basic_os=unicos ;; crds | unos) basic_machine=m68k-crds - os= + basic_os= ;; da30) basic_machine=m68k-da30 - os= + basic_os= ;; decstation | pmax | pmin | dec3100 | decstatn) basic_machine=mips-dec - os= + basic_os= ;; delta88) basic_machine=m88k-motorola - os=sysv3 + basic_os=sysv3 ;; dicos) basic_machine=i686-pc - os=dicos + basic_os=dicos ;; djgpp) basic_machine=i586-pc - os=msdosdjgpp + basic_os=msdosdjgpp ;; ebmon29k) basic_machine=a29k-amd - os=ebmon + basic_os=ebmon ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson - os=ose + basic_os=ose ;; gmicro) basic_machine=tron-gmicro - os=sysv + basic_os=sysv ;; go32) basic_machine=i386-pc - os=go32 + basic_os=go32 ;; h8300hms) basic_machine=h8300-hitachi - os=hms + basic_os=hms ;; h8300xray) basic_machine=h8300-hitachi - os=xray + basic_os=xray ;; h8500hms) basic_machine=h8500-hitachi - os=hms + basic_os=hms ;; harris) basic_machine=m88k-harris - os=sysv3 + basic_os=sysv3 ;; hp300 | hp300hpux) basic_machine=m68k-hp - os=hpux + basic_os=hpux ;; hp300bsd) basic_machine=m68k-hp - os=bsd + basic_os=bsd ;; hppaosf) basic_machine=hppa1.1-hp - os=osf + basic_os=osf ;; hppro) basic_machine=hppa1.1-hp - os=proelf + basic_os=proelf ;; i386mach) basic_machine=i386-mach - os=mach + basic_os=mach ;; isi68 | isi) basic_machine=m68k-isi - os=sysv + basic_os=sysv ;; m68knommu) basic_machine=m68k-unknown - os=linux + basic_os=linux ;; magnum | m3230) basic_machine=mips-mips - os=sysv + basic_os=sysv ;; merlin) basic_machine=ns32k-utek - os=sysv + basic_os=sysv ;; mingw64) basic_machine=x86_64-pc - os=mingw64 + basic_os=mingw64 ;; mingw32) basic_machine=i686-pc - os=mingw32 + basic_os=mingw32 ;; mingw32ce) basic_machine=arm-unknown - os=mingw32ce + basic_os=mingw32ce ;; monitor) basic_machine=m68k-rom68k - os=coff + basic_os=coff ;; morphos) basic_machine=powerpc-unknown - os=morphos + basic_os=morphos ;; moxiebox) basic_machine=moxie-unknown - os=moxiebox + basic_os=moxiebox ;; msdos) basic_machine=i386-pc - os=msdos + basic_os=msdos ;; msys) basic_machine=i686-pc - os=msys + basic_os=msys ;; mvs) basic_machine=i370-ibm - os=mvs + basic_os=mvs ;; nacl) basic_machine=le32-unknown - os=nacl + basic_os=nacl ;; ncr3000) basic_machine=i486-ncr - os=sysv4 + basic_os=sysv4 ;; netbsd386) basic_machine=i386-pc - os=netbsd + basic_os=netbsd ;; netwinder) basic_machine=armv4l-rebel - os=linux + basic_os=linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony - os=newsos + basic_os=newsos ;; news1000) basic_machine=m68030-sony - os=newsos + basic_os=newsos ;; necv70) basic_machine=v70-nec - os=sysv + basic_os=sysv ;; nh3000) basic_machine=m68k-harris - os=cxux + basic_os=cxux ;; nh[45]000) basic_machine=m88k-harris - os=cxux + basic_os=cxux ;; nindy960) basic_machine=i960-intel - os=nindy + basic_os=nindy ;; mon960) basic_machine=i960-intel - os=mon960 + basic_os=mon960 ;; nonstopux) basic_machine=mips-compaq - os=nonstopux + basic_os=nonstopux ;; os400) basic_machine=powerpc-ibm - os=os400 + basic_os=os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson - os=ose + basic_os=ose ;; os68k) basic_machine=m68k-none - os=os68k + basic_os=os68k ;; paragon) basic_machine=i860-intel - os=osf + basic_os=osf ;; parisc) basic_machine=hppa-unknown - os=linux + basic_os=linux + ;; + psp) + basic_machine=mipsallegrexel-sony + basic_os=psp ;; pw32) basic_machine=i586-unknown - os=pw32 + basic_os=pw32 ;; rdos | rdos64) basic_machine=x86_64-pc - os=rdos + basic_os=rdos ;; rdos32) basic_machine=i386-pc - os=rdos + basic_os=rdos ;; rom68k) basic_machine=m68k-rom68k - os=coff + basic_os=coff ;; sa29200) basic_machine=a29k-amd - os=udi + basic_os=udi ;; sei) basic_machine=mips-sei - os=seiux + basic_os=seiux ;; sequent) basic_machine=i386-sequent - os= + basic_os= ;; sps7) basic_machine=m68k-bull - os=sysv2 + basic_os=sysv2 ;; st2000) basic_machine=m68k-tandem - os= + basic_os= ;; stratus) basic_machine=i860-stratus - os=sysv4 + basic_os=sysv4 ;; sun2) basic_machine=m68000-sun - os= + basic_os= ;; sun2os3) basic_machine=m68000-sun - os=sunos3 + basic_os=sunos3 ;; sun2os4) basic_machine=m68000-sun - os=sunos4 + basic_os=sunos4 ;; sun3) basic_machine=m68k-sun - os= + basic_os= ;; sun3os3) basic_machine=m68k-sun - os=sunos3 + basic_os=sunos3 ;; sun3os4) basic_machine=m68k-sun - os=sunos4 + basic_os=sunos4 ;; sun4) basic_machine=sparc-sun - os= + basic_os= ;; sun4os3) basic_machine=sparc-sun - os=sunos3 + basic_os=sunos3 ;; sun4os4) basic_machine=sparc-sun - os=sunos4 + basic_os=sunos4 ;; sun4sol2) basic_machine=sparc-sun - os=solaris2 + basic_os=solaris2 ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun - os= + basic_os= ;; sv1) basic_machine=sv1-cray - os=unicos + basic_os=unicos ;; symmetry) basic_machine=i386-sequent - os=dynix + basic_os=dynix ;; t3e) basic_machine=alphaev5-cray - os=unicos + basic_os=unicos ;; t90) basic_machine=t90-cray - os=unicos + basic_os=unicos ;; toad1) basic_machine=pdp10-xkl - os=tops20 + basic_os=tops20 ;; tpf) basic_machine=s390x-ibm - os=tpf + basic_os=tpf ;; udi29k) basic_machine=a29k-amd - os=udi + basic_os=udi ;; ultra3) basic_machine=a29k-nyu - os=sym1 + basic_os=sym1 ;; v810 | necv810) basic_machine=v810-nec - os=none + basic_os=none ;; vaxv) basic_machine=vax-dec - os=sysv + basic_os=sysv ;; vms) basic_machine=vax-dec - os=vms + basic_os=vms ;; vsta) basic_machine=i386-pc - os=vsta + basic_os=vsta ;; vxworks960) basic_machine=i960-wrs - os=vxworks + basic_os=vxworks ;; vxworks68) basic_machine=m68k-wrs - os=vxworks + basic_os=vxworks ;; vxworks29k) basic_machine=a29k-wrs - os=vxworks + basic_os=vxworks ;; xbox) basic_machine=i686-pc - os=mingw32 + basic_os=mingw32 ;; ymp) basic_machine=ymp-cray - os=unicos + basic_os=unicos ;; *) basic_machine=$1 - os= + basic_os= ;; esac ;; @@ -683,27 +755,38 @@ case $basic_machine in bluegene*) cpu=powerpc vendor=ibm - os=cnk + basic_os=cnk ;; decsystem10* | dec10*) cpu=pdp10 vendor=dec - os=tops10 + basic_os=tops10 ;; decsystem20* | dec20*) cpu=pdp10 vendor=dec - os=tops20 + basic_os=tops20 ;; - delta | 3300 | motorola-3300 | motorola-delta \ - | 3300-motorola | delta-motorola) + delta | 3300 | delta-motorola | 3300-motorola | motorola-delta | motorola-3300) cpu=m68k vendor=motorola ;; - dpx2*) + # This used to be dpx2*, but that gets the RS6000-based + # DPX/20 and the x86-based DPX/2-100 wrong. See + # https://oldskool.silicium.org/stations/bull_dpx20.htm + # https://www.feb-patrimoine.com/english/bull_dpx2.htm + # https://www.feb-patrimoine.com/english/unix_and_bull.htm + dpx2 | dpx2[23]00 | dpx2[23]xx) cpu=m68k vendor=bull - os=sysv3 + ;; + dpx2100 | dpx21xx) + cpu=i386 + vendor=bull + ;; + dpx20) + cpu=rs6000 + vendor=bull ;; encore | umax | mmax) cpu=ns32k @@ -712,7 +795,7 @@ case $basic_machine in elxsi) cpu=elxsi vendor=elxsi - os=${os:-bsd} + basic_os=${basic_os:-bsd} ;; fx2800) cpu=i860 @@ -725,7 +808,7 @@ case $basic_machine in h3050r* | hiux*) cpu=hppa1.1 vendor=hitachi - os=hiuxwe2 + basic_os=hiuxwe2 ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) cpu=hppa1.0 @@ -768,36 +851,36 @@ case $basic_machine in i*86v32) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc - os=sysv32 + basic_os=sysv32 ;; i*86v4*) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc - os=sysv4 + basic_os=sysv4 ;; i*86v) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc - os=sysv + basic_os=sysv ;; i*86sol2) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc - os=solaris2 + basic_os=solaris2 ;; j90 | j90-cray) cpu=j90 vendor=cray - os=${os:-unicos} + basic_os=${basic_os:-unicos} ;; iris | iris4d) cpu=mips vendor=sgi - case $os in + case $basic_os in irix*) ;; *) - os=irix4 + basic_os=irix4 ;; esac ;; @@ -808,28 +891,16 @@ case $basic_machine in *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*) cpu=m68k vendor=atari - os=mint + basic_os=mint ;; news-3600 | risc-news) cpu=mips vendor=sony - os=newsos + basic_os=newsos ;; next | m*-next) cpu=m68k vendor=next - case $os in - openstep*) - ;; - nextstep*) - ;; - ns2*) - os=nextstep2 - ;; - *) - os=nextstep3 - ;; - esac ;; np1) cpu=np1 @@ -838,12 +909,12 @@ case $basic_machine in op50n-* | op60c-*) cpu=hppa1.1 vendor=oki - os=proelf + basic_os=proelf ;; pa-hitachi) cpu=hppa1.1 vendor=hitachi - os=hiuxwe2 + basic_os=hiuxwe2 ;; pbd) cpu=sparc @@ -880,12 +951,12 @@ case $basic_machine in sde) cpu=mipsisa32 vendor=sde - os=${os:-elf} + basic_os=${basic_os:-elf} ;; simso-wrs) cpu=sparclite vendor=wrs - os=vxworks + basic_os=vxworks ;; tower | tower-32) cpu=m68k @@ -902,7 +973,7 @@ case $basic_machine in w89k-*) cpu=hppa1.1 vendor=winbond - os=proelf + basic_os=proelf ;; none) cpu=none @@ -918,12 +989,13 @@ case $basic_machine in ;; *-*) - # shellcheck disable=SC2162 + saved_IFS=$IFS IFS="-" read cpu vendor <&2 + echo "Invalid configuration '$1': machine '$cpu-$vendor' not recognized" 1>&2 exit 1 ;; esac @@ -1275,8 +1491,53 @@ esac # Decode manufacturer-specific aliases for certain operating systems. -if [ x$os != x ] +if test x"$basic_os" != x then + +# First recognize some ad-hoc cases, or perhaps split kernel-os, or else just +# set os. +obj= +case $basic_os in + gnu/linux*) + kernel=linux + os=`echo "$basic_os" | sed -e 's|gnu/linux|gnu|'` + ;; + os2-emx) + kernel=os2 + os=`echo "$basic_os" | sed -e 's|os2-emx|emx|'` + ;; + nto-qnx*) + kernel=nto + os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'` + ;; + *-*) + saved_IFS=$IFS + IFS="-" read kernel os <&2 - exit 1 + # No normalization, but not necessarily accepted, that comes below. ;; esac + else # Here we handle the default operating systems that come with various machines. @@ -1528,42 +1744,54 @@ else # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. +kernel= +obj= case $cpu-$vendor in score-*) - os=elf + os= + obj=elf ;; spu-*) - os=elf + os= + obj=elf ;; *-acorn) os=riscix1.2 ;; arm*-rebel) - os=linux + kernel=linux + os=gnu ;; arm*-semi) - os=aout + os= + obj=aout ;; c4x-* | tic4x-*) - os=coff + os= + obj=coff ;; c8051-*) - os=elf + os= + obj=elf ;; clipper-intergraph) os=clix ;; hexagon-*) - os=elf + os= + obj=elf ;; tic54x-*) - os=coff + os= + obj=coff ;; tic55x-*) - os=coff + os= + obj=coff ;; tic6x-*) - os=coff + os= + obj=coff ;; # This must come before the *-dec entry. pdp10-*) @@ -1585,28 +1813,43 @@ case $cpu-$vendor in os=sunos3 ;; m68*-cisco) - os=aout + os= + obj=aout ;; mep-*) - os=elf + os= + obj=elf + ;; + # The -sgi and -siemens entries must be before the mips- entry + # or we get the wrong os. + *-sgi) + os=irix + ;; + *-siemens) + os=sysv4 ;; mips*-cisco) - os=elf + os= + obj=elf ;; - mips*-*) - os=elf + mips*-*|nanomips*-*) + os= + obj=elf ;; or32-*) - os=coff + os= + obj=coff ;; - *-tti) # must be before sparc entry or we get the wrong os. + # This must be before the sparc-* entry or we get the wrong os. + *-tti) os=sysv3 ;; sparc-* | *-sun) os=sunos4.1.1 ;; pru-*) - os=elf + os= + obj=elf ;; *-be) os=beos @@ -1630,7 +1873,7 @@ case $cpu-$vendor in os=hpux ;; *-hitachi) - os=hiux + os=hiuxwe2 ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=sysv @@ -1674,12 +1917,6 @@ case $cpu-$vendor in *-encore) os=bsd ;; - *-sgi) - os=irix - ;; - *-siemens) - os=sysv4 - ;; *-masscomp) os=rtu ;; @@ -1687,10 +1924,12 @@ case $cpu-$vendor in os=uxpv ;; *-rom68k) - os=coff + os= + obj=coff ;; *-*bug) - os=coff + os= + obj=coff ;; *-apple) os=macos @@ -1705,84 +1944,406 @@ case $cpu-$vendor in os=none ;; esac + fi +# Now, validate our (potentially fixed-up) individual pieces (OS, OBJ). + +case $os in + # Sometimes we do "kernel-libc", so those need to count as OSes. + llvm* | musl* | newlib* | relibc* | uclibc*) + ;; + # Likewise for "kernel-abi" + eabi* | gnueabi*) + ;; + # VxWorks passes extra cpu info in the 4th filed. + simlinux | simwindows | spe) + ;; + # See `case $cpu-$os` validation below + ghcjs) + ;; + # Now accept the basic system types. + # Each alternative MUST end in a * to match a version number. + abug \ + | aix* \ + | amdhsa* \ + | amigados* \ + | amigaos* \ + | android* \ + | aof* \ + | aos* \ + | aros* \ + | atheos* \ + | auroraux* \ + | aux* \ + | beos* \ + | bitrig* \ + | bme* \ + | bosx* \ + | bsd* \ + | cegcc* \ + | chorusos* \ + | chorusrdb* \ + | clix* \ + | cloudabi* \ + | cnk* \ + | conix* \ + | cos* \ + | cxux* \ + | cygwin* \ + | darwin* \ + | dgux* \ + | dicos* \ + | dnix* \ + | domain* \ + | dragonfly* \ + | drops* \ + | ebmon* \ + | ecoff* \ + | ekkobsd* \ + | emscripten* \ + | emx* \ + | es* \ + | fiwix* \ + | freebsd* \ + | fuchsia* \ + | genix* \ + | genode* \ + | glidix* \ + | gnu* \ + | go32* \ + | haiku* \ + | hcos* \ + | hiux* \ + | hms* \ + | hpux* \ + | ieee* \ + | interix* \ + | ios* \ + | iris* \ + | irix* \ + | ironclad* \ + | isc* \ + | its* \ + | l4re* \ + | libertybsd* \ + | lites* \ + | lnews* \ + | luna* \ + | lynxos* \ + | mach* \ + | macos* \ + | magic* \ + | mbr* \ + | midipix* \ + | midnightbsd* \ + | mingw32* \ + | mingw64* \ + | minix* \ + | mint* \ + | mirbsd* \ + | mks* \ + | mlibc* \ + | mmixware* \ + | mon960* \ + | morphos* \ + | moss* \ + | moxiebox* \ + | mpeix* \ + | mpw* \ + | msdos* \ + | msys* \ + | mvs* \ + | nacl* \ + | netbsd* \ + | netware* \ + | newsos* \ + | nextstep* \ + | nindy* \ + | nonstopux* \ + | nova* \ + | nsk* \ + | nucleus* \ + | nx6 \ + | nx7 \ + | oabi* \ + | ohos* \ + | onefs* \ + | openbsd* \ + | openedition* \ + | openstep* \ + | os108* \ + | os2* \ + | os400* \ + | os68k* \ + | os9* \ + | ose* \ + | osf* \ + | oskit* \ + | osx* \ + | palmos* \ + | phoenix* \ + | plan9* \ + | powermax* \ + | powerunix* \ + | proelf* \ + | psos* \ + | psp* \ + | ptx* \ + | pw32* \ + | qnx* \ + | rdos* \ + | redox* \ + | rhapsody* \ + | riscix* \ + | riscos* \ + | rtems* \ + | rtmk* \ + | rtu* \ + | scout* \ + | secbsd* \ + | sei* \ + | serenity* \ + | sim* \ + | skyos* \ + | solaris* \ + | solidbsd* \ + | sortix* \ + | storm-chaos* \ + | sunos \ + | sunos[34]* \ + | superux* \ + | syllable* \ + | sym* \ + | sysv* \ + | tenex* \ + | tirtos* \ + | toppers* \ + | tops10* \ + | tops20* \ + | tpf* \ + | tvos* \ + | twizzler* \ + | uclinux* \ + | udi* \ + | udk* \ + | ultrix* \ + | unicos* \ + | uniplus* \ + | unleashed* \ + | unos* \ + | uwin* \ + | uxpv* \ + | v88r* \ + |*vms* \ + | vos* \ + | vsta* \ + | vxsim* \ + | vxworks* \ + | wasi* \ + | watchos* \ + | wince* \ + | windiss* \ + | windows* \ + | winnt* \ + | xenix* \ + | xray* \ + | zephyr* \ + | zvmoe* ) + ;; + # This one is extra strict with allowed versions + sco3.2v2 | sco3.2v[4-9]* | sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + ;; + # This refers to builds using the UEFI calling convention + # (which depends on the architecture) and PE file format. + # Note that this is both a different calling convention and + # different file format than that of GNU-EFI + # (x86_64-w64-mingw32). + uefi) + ;; + none) + ;; + kernel* | msvc* ) + # Restricted further below + ;; + '') + if test x"$obj" = x + then + echo "Invalid configuration '$1': Blank OS only allowed with explicit machine code file format" 1>&2 + fi + ;; + *) + echo "Invalid configuration '$1': OS '$os' not recognized" 1>&2 + exit 1 + ;; +esac + +case $obj in + aout* | coff* | elf* | pe*) + ;; + '') + # empty is fine + ;; + *) + echo "Invalid configuration '$1': Machine code format '$obj' not recognized" 1>&2 + exit 1 + ;; +esac + +# Here we handle the constraint that a (synthetic) cpu and os are +# valid only in combination with each other and nowhere else. +case $cpu-$os in + # The "javascript-unknown-ghcjs" triple is used by GHC; we + # accept it here in order to tolerate that, but reject any + # variations. + javascript-ghcjs) + ;; + javascript-* | *-ghcjs) + echo "Invalid configuration '$1': cpu '$cpu' is not valid with os '$os$obj'" 1>&2 + exit 1 + ;; +esac + +# As a final step for OS-related things, validate the OS-kernel combination +# (given a valid OS), if there is a kernel. +case $kernel-$os-$obj in + linux-gnu*- | linux-android*- | linux-dietlibc*- | linux-llvm*- \ + | linux-mlibc*- | linux-musl*- | linux-newlib*- \ + | linux-relibc*- | linux-uclibc*- | linux-ohos*- ) + ;; + uclinux-uclibc*- | uclinux-gnu*- ) + ;; + managarm-mlibc*- | managarm-kernel*- ) + ;; + windows*-msvc*-) + ;; + -dietlibc*- | -llvm*- | -mlibc*- | -musl*- | -newlib*- | -relibc*- \ + | -uclibc*- ) + # These are just libc implementations, not actual OSes, and thus + # require a kernel. + echo "Invalid configuration '$1': libc '$os' needs explicit kernel." 1>&2 + exit 1 + ;; + -kernel*- ) + echo "Invalid configuration '$1': '$os' needs explicit kernel." 1>&2 + exit 1 + ;; + *-kernel*- ) + echo "Invalid configuration '$1': '$kernel' does not support '$os'." 1>&2 + exit 1 + ;; + *-msvc*- ) + echo "Invalid configuration '$1': '$os' needs 'windows'." 1>&2 + exit 1 + ;; + kfreebsd*-gnu*- | knetbsd*-gnu*- | netbsd*-gnu*- | kopensolaris*-gnu*-) + ;; + vxworks-simlinux- | vxworks-simwindows- | vxworks-spe-) + ;; + nto-qnx*-) + ;; + os2-emx-) + ;; + rtmk-nova-) + ;; + *-eabi*- | *-gnueabi*-) + ;; + none--*) + # None (no kernel, i.e. freestanding / bare metal), + # can be paired with an machine code file format + ;; + -*-) + # Blank kernel with real OS is always fine. + ;; + --*) + # Blank kernel and OS with real machine code file format is always fine. + ;; + *-*-*) + echo "Invalid configuration '$1': Kernel '$kernel' not known to work with OS '$os'." 1>&2 + exit 1 + ;; +esac + # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. case $vendor in unknown) - case $os in - riscix*) + case $cpu-$os in + *-riscix*) vendor=acorn ;; - sunos*) + *-sunos* | *-solaris*) vendor=sun ;; - cnk*|-aix*) + *-cnk* | *-aix*) vendor=ibm ;; - beos*) + *-beos*) vendor=be ;; - hpux*) + *-hpux*) vendor=hp ;; - mpeix*) + *-mpeix*) vendor=hp ;; - hiux*) + *-hiux*) vendor=hitachi ;; - unos*) + *-unos*) vendor=crds ;; - dgux*) + *-dgux*) vendor=dg ;; - luna*) + *-luna*) vendor=omron ;; - genix*) + *-genix*) vendor=ns ;; - clix*) + *-clix*) vendor=intergraph ;; - mvs* | opened*) + *-mvs* | *-opened*) vendor=ibm ;; - os400*) + *-os400*) vendor=ibm ;; - ptx*) + s390-* | s390x-*) + vendor=ibm + ;; + *-ptx*) vendor=sequent ;; - tpf*) + *-tpf*) vendor=ibm ;; - vxsim* | vxworks* | windiss*) + *-vxsim* | *-vxworks* | *-windiss*) vendor=wrs ;; - aux*) + *-aux*) vendor=apple ;; - hms*) + *-hms*) vendor=hitachi ;; - mpw* | macos*) + *-mpw* | *-macos*) vendor=apple ;; - *mint | mint[0-9]* | *MiNT | MiNT[0-9]*) + *-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*) vendor=atari ;; - vos*) + *-vos*) vendor=stratus ;; esac ;; esac -echo "$cpu-$vendor-$os" +echo "$cpu-$vendor${kernel:+-$kernel}${os:+-$os}${obj:+-$obj}" exit # Local variables: diff --git a/configure b/configure index af7d930..12d2990 100755 --- a/configure +++ b/configure @@ -1,11 +1,9 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.65. +# Generated by GNU Autoconf 2.69. # # -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation @@ -89,6 +87,7 @@ fi IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. +as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -133,6 +132,31 @@ export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh @@ -166,7 +190,8 @@ if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi -test x\$exitcode = x0 || exit 1" +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && @@ -211,14 +236,25 @@ IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : - # We cannot yet assume a decent shell, so we have to provide a - # neutralization value for shells without unset; and this also - # works around shells that cannot unset nonexistent variables. - BASH_ENV=/dev/null - ENV=/dev/null - (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 fi if test x$as_have_required = xno; then : @@ -316,10 +352,18 @@ $as_echo X"$as_dir" | test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take @@ -356,19 +400,19 @@ else fi # as_fn_arith -# as_fn_error ERROR [LINENO LOG_FD] -# --------------------------------- +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with status $?, using 1 if that was 0. +# script with STATUS, using 1 if that was 0. as_fn_error () { - as_status=$?; test $as_status -eq 0 && as_status=1 - if test "$3"; then - as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $1" >&2 + $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error @@ -441,6 +485,10 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). @@ -475,16 +523,16 @@ if (echo >conf$$.file) 2>/dev/null; then # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. + # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null @@ -496,28 +544,8 @@ else as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x +as_test_x='test -x' +as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -530,7 +558,7 @@ test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. -# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` @@ -633,6 +661,7 @@ infodir docdir oldincludedir includedir +runstatedir localstatedir sharedstatedir sysconfdir @@ -705,6 +734,7 @@ datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' +runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' @@ -729,8 +759,9 @@ do fi case $ac_option in - *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *) ac_optarg=yes ;; + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. @@ -775,7 +806,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error "invalid feature name: $ac_useropt" + as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -801,7 +832,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error "invalid feature name: $ac_useropt" + as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -956,6 +987,15 @@ do | -silent | --silent | --silen | --sile | --sil) silent=yes ;; + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1005,7 +1045,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error "invalid package name: $ac_useropt" + as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1021,7 +1061,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error "invalid package name: $ac_useropt" + as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1051,8 +1091,8 @@ do | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; - -*) as_fn_error "unrecognized option: \`$ac_option' -Try \`$0 --help' for more information." + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" ;; *=*) @@ -1060,7 +1100,7 @@ Try \`$0 --help' for more information." # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) - as_fn_error "invalid variable name: \`$ac_envvar'" ;; + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; @@ -1070,7 +1110,7 @@ Try \`$0 --help' for more information." $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac @@ -1078,13 +1118,13 @@ done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` - as_fn_error "missing argument to $ac_option" + as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; - fatal) as_fn_error "unrecognized options: $ac_unrecognized_opts" ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi @@ -1093,7 +1133,7 @@ fi for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir + libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -1107,7 +1147,7 @@ do [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac - as_fn_error "expected an absolute directory name for --$ac_var: $ac_val" + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' @@ -1121,8 +1161,6 @@ target=$target_alias if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - $as_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 @@ -1137,9 +1175,9 @@ test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - as_fn_error "working directory cannot be determined" + as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - as_fn_error "pwd does not report name of working directory" + as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. @@ -1178,11 +1216,11 @@ else fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - as_fn_error "cannot find sources ($ac_unique_file) in $srcdir" + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error "$ac_msg" + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then @@ -1222,7 +1260,7 @@ Configuration: --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking...' messages + -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files @@ -1248,6 +1286,7 @@ Fine tuning of the installation directories: --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] @@ -1363,9 +1402,9 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure -generated by GNU Autoconf 2.65 +generated by GNU Autoconf 2.69 -Copyright (C) 2009 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1409,7 +1448,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile @@ -1451,7 +1490,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run @@ -1473,7 +1512,8 @@ int main () { static int test_array [1 - 2 * !(($2) >= 0)]; -test_array [0] = 0 +test_array [0] = 0; +return test_array [0]; ; return 0; @@ -1489,7 +1529,8 @@ int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; -test_array [0] = 0 +test_array [0] = 0; +return test_array [0]; ; return 0; @@ -1515,7 +1556,8 @@ int main () { static int test_array [1 - 2 * !(($2) < 0)]; -test_array [0] = 0 +test_array [0] = 0; +return test_array [0]; ; return 0; @@ -1531,7 +1573,8 @@ int main () { static int test_array [1 - 2 * !(($2) >= $ac_mid)]; -test_array [0] = 0 +test_array [0] = 0; +return test_array [0]; ; return 0; @@ -1565,7 +1608,8 @@ int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; -test_array [0] = 0 +test_array [0] = 0; +return test_array [0]; ; return 0; @@ -1629,7 +1673,7 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ rm -f conftest.val fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_compute_int @@ -1655,7 +1699,7 @@ $as_echo "$ac_try_echo"; } >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } >/dev/null && { + test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : @@ -1666,7 +1710,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp @@ -1680,7 +1724,7 @@ ac_fn_c_check_header_compile () as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -1698,7 +1742,7 @@ fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile @@ -1711,7 +1755,7 @@ ac_fn_c_check_type () as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" @@ -1752,7 +1796,7 @@ fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type @@ -1764,10 +1808,10 @@ $as_echo "$ac_res" >&6; } ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 @@ -1803,7 +1847,7 @@ if ac_fn_c_try_cpp "$LINENO"; then : else ac_header_preproc=no fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } @@ -1830,7 +1874,7 @@ $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" @@ -1839,7 +1883,7 @@ eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel @@ -1870,7 +1914,7 @@ $as_echo "$ac_try_echo"; } >&5 test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext + test -x conftest$ac_exeext }; then : ac_retval=0 else @@ -1884,7 +1928,7 @@ fi # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link @@ -1897,7 +1941,7 @@ ac_fn_c_check_func () as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -1952,7 +1996,7 @@ fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func cat >config.log <<_ACEOF @@ -1960,7 +2004,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was -generated by GNU Autoconf 2.65. Invocation command line was +generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2070,11 +2114,9 @@ trap 'exit_status=$? { echo - cat <<\_ASBOX -## ---------------- ## + $as_echo "## ---------------- ## ## Cache variables. ## -## ---------------- ## -_ASBOX +## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( @@ -2108,11 +2150,9 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; ) echo - cat <<\_ASBOX -## ----------------- ## + $as_echo "## ----------------- ## ## Output variables. ## -## ----------------- ## -_ASBOX +## ----------------- ##" echo for ac_var in $ac_subst_vars do @@ -2125,11 +2165,9 @@ _ASBOX echo if test -n "$ac_subst_files"; then - cat <<\_ASBOX -## ------------------- ## + $as_echo "## ------------------- ## ## File substitutions. ## -## ------------------- ## -_ASBOX +## ------------------- ##" echo for ac_var in $ac_subst_files do @@ -2143,11 +2181,9 @@ _ASBOX fi if test -s confdefs.h; then - cat <<\_ASBOX -## ----------- ## + $as_echo "## ----------- ## ## confdefs.h. ## -## ----------- ## -_ASBOX +## ----------- ##" echo cat confdefs.h echo @@ -2202,7 +2238,12 @@ _ACEOF ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then - ac_site_file1=$CONFIG_SITE + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site @@ -2217,7 +2258,11 @@ do { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } fi done @@ -2293,7 +2338,7 @@ if $ac_cache_corrupted; then $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## @@ -2319,7 +2364,7 @@ if test -n "$ac_tool_prefix"; then set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2331,7 +2376,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2359,7 +2404,7 @@ if test -z "$ac_cv_prog_CC"; then set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : +if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -2371,7 +2416,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2412,7 +2457,7 @@ if test -z "$CC"; then set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2424,7 +2469,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2452,7 +2497,7 @@ if test -z "$CC"; then set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2465,7 +2510,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue @@ -2511,7 +2556,7 @@ if test -z "$CC"; then set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2523,7 +2568,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2555,7 +2600,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : +if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -2567,7 +2612,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2609,8 +2654,8 @@ fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "no acceptable C compiler found in \$PATH -See \`config.log' for more details." "$LINENO" 5; } +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 @@ -2724,9 +2769,8 @@ sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ as_fn_set_status 77 -as_fn_error "C compiler cannot create executables -See \`config.log' for more details." "$LINENO" 5; }; } +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } @@ -2768,8 +2812,8 @@ done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." "$LINENO" 5; } +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 @@ -2826,9 +2870,9 @@ $as_echo "$ac_try_echo"; } >&5 else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "cannot run C compiled programs. +as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. -See \`config.log' for more details." "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5; } fi fi fi @@ -2839,7 +2883,7 @@ rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } -if test "${ac_cv_objext+set}" = set; then : +if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -2879,8 +2923,8 @@ sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "cannot compute suffix of object files: cannot compile -See \`config.log' for more details." "$LINENO" 5; } +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi @@ -2890,7 +2934,7 @@ OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if test "${ac_cv_c_compiler_gnu+set}" = set; then : +if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -2927,7 +2971,7 @@ ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } -if test "${ac_cv_prog_cc_g+set}" = set; then : +if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag @@ -3005,7 +3049,7 @@ else fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if test "${ac_cv_prog_cc_c89+set}" = set; then : +if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no @@ -3014,8 +3058,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include -#include -#include +struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); @@ -3110,7 +3153,7 @@ if test "$enable_largefile" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 $as_echo_n "checking for special C compiler options needed for large files... " >&6; } -if test "${ac_cv_sys_largefile_CC+set}" = set; then : +if ${ac_cv_sys_largefile_CC+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_sys_largefile_CC=no @@ -3126,7 +3169,7 @@ else We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) +#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -3161,7 +3204,7 @@ $as_echo "$ac_cv_sys_largefile_CC" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 $as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } -if test "${ac_cv_sys_file_offset_bits+set}" = set; then : +if ${ac_cv_sys_file_offset_bits+:} false; then : $as_echo_n "(cached) " >&6 else while :; do @@ -3172,7 +3215,7 @@ else We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) +#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -3196,7 +3239,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) +#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -3230,7 +3273,7 @@ rm -rf conftest* if test $ac_cv_sys_file_offset_bits = unknown; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 $as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } -if test "${ac_cv_sys_large_files+set}" = set; then : +if ${ac_cv_sys_large_files+:} false; then : $as_echo_n "(cached) " >&6 else while :; do @@ -3241,7 +3284,7 @@ else We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) +#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -3265,7 +3308,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) +#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -3297,21 +3340,29 @@ _ACEOF esac rm -rf conftest* fi + + fi ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do - for ac_t in install-sh install.sh shtool; do - if test -f "$ac_dir/$ac_t"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/$ac_t -c" - break 2 - fi - done + 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 - as_fn_error "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 + as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, @@ -3325,27 +3376,27 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - as_fn_error "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } -if test "${ac_cv_build+set}" = set; then : +if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && - as_fn_error "cannot guess build type; you must specify one" "$LINENO" 5 + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - as_fn_error "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; -*) as_fn_error "invalid value of canonical build" "$LINENO" 5;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' @@ -3363,14 +3414,14 @@ case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } -if test "${ac_cv_host+set}" = set; then : +if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - as_fn_error "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi @@ -3378,7 +3429,7 @@ fi $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; -*) as_fn_error "invalid value of canonical host" "$LINENO" 5;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' @@ -3414,7 +3465,7 @@ if test -n "$ac_tool_prefix"; then set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -3426,7 +3477,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3454,7 +3505,7 @@ if test -z "$ac_cv_prog_CC"; then set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : +if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -3466,7 +3517,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3507,7 +3558,7 @@ if test -z "$CC"; then set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -3519,7 +3570,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3547,7 +3598,7 @@ if test -z "$CC"; then set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -3560,7 +3611,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue @@ -3606,7 +3657,7 @@ if test -z "$CC"; then set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -3618,7 +3669,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3650,7 +3701,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : +if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -3662,7 +3713,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3704,8 +3755,8 @@ fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "no acceptable C compiler found in \$PATH -See \`config.log' for more details." "$LINENO" 5; } +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 @@ -3734,7 +3785,7 @@ done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if test "${ac_cv_c_compiler_gnu+set}" = set; then : +if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -3771,7 +3822,7 @@ ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } -if test "${ac_cv_prog_cc_g+set}" = set; then : +if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag @@ -3849,7 +3900,7 @@ else fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if test "${ac_cv_prog_cc_c89+set}" = set; then : +if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no @@ -3858,8 +3909,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include -#include -#include +struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); @@ -3976,7 +4026,7 @@ esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then -if test "${ac_cv_path_install+set}" = set; then : +if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3996,7 +4046,7 @@ case $as_dir/ in #(( # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. @@ -4065,7 +4115,7 @@ if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then : + if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded @@ -4095,7 +4145,7 @@ else # Broken: fails on valid input. continue fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. @@ -4111,11 +4161,11 @@ else ac_preproc_ok=: break fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext +rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi @@ -4154,7 +4204,7 @@ else # Broken: fails on valid input. continue fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. @@ -4170,18 +4220,18 @@ else ac_preproc_ok=: break fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext +rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." "$LINENO" 5; } +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c @@ -4193,7 +4243,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if test "${ac_cv_path_GREP+set}" = set; then : +if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then @@ -4207,7 +4257,7 @@ do for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue + as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in @@ -4242,7 +4292,7 @@ esac done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then - as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP @@ -4256,7 +4306,7 @@ $as_echo "$ac_cv_path_GREP" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } -if test "${ac_cv_path_EGREP+set}" = set; then : +if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 @@ -4273,7 +4323,7 @@ do for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue + as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in @@ -4308,7 +4358,7 @@ esac done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then - as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP @@ -4323,7 +4373,7 @@ $as_echo "$ac_cv_path_EGREP" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } -if test "${ac_cv_header_stdc+set}" = set; then : +if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4440,8 +4490,7 @@ do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -4457,7 +4506,7 @@ done # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 $as_echo_n "checking size of int... " >&6; } -if test "${ac_cv_sizeof_int+set}" = set; then : +if ${ac_cv_sizeof_int+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default"; then : @@ -4466,9 +4515,8 @@ else if test "$ac_cv_type_int" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ as_fn_set_status 77 -as_fn_error "cannot compute sizeof (int) -See \`config.log' for more details." "$LINENO" 5; }; } +as_fn_error 77 "cannot compute sizeof (int) +See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_int=0 fi @@ -4491,7 +4539,7 @@ _ACEOF # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 $as_echo_n "checking size of long... " >&6; } -if test "${ac_cv_sizeof_long+set}" = set; then : +if ${ac_cv_sizeof_long+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : @@ -4500,9 +4548,8 @@ else if test "$ac_cv_type_long" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ as_fn_set_status 77 -as_fn_error "cannot compute sizeof (long) -See \`config.log' for more details." "$LINENO" 5; }; } +as_fn_error 77 "cannot compute sizeof (long) +See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_long=0 fi @@ -4525,7 +4572,7 @@ _ACEOF # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long" >&5 $as_echo_n "checking size of long long... " >&6; } -if test "${ac_cv_sizeof_long_long+set}" = set; then : +if ${ac_cv_sizeof_long_long+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long))" "ac_cv_sizeof_long_long" "$ac_includes_default"; then : @@ -4534,9 +4581,8 @@ else if test "$ac_cv_type_long_long" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ as_fn_set_status 77 -as_fn_error "cannot compute sizeof (long long) -See \`config.log' for more details." "$LINENO" 5; }; } +as_fn_error 77 "cannot compute sizeof (long long) +See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_long_long=0 fi @@ -4559,7 +4605,7 @@ _ACEOF # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5 $as_echo_n "checking size of void *... " >&6; } -if test "${ac_cv_sizeof_void_p+set}" = set; then : +if ${ac_cv_sizeof_void_p+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void *))" "ac_cv_sizeof_void_p" "$ac_includes_default"; then : @@ -4568,9 +4614,8 @@ else if test "$ac_cv_type_void_p" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ as_fn_set_status 77 -as_fn_error "cannot compute sizeof (void *) -See \`config.log' for more details." "$LINENO" 5; }; } +as_fn_error 77 "cannot compute sizeof (void *) +See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_void_p=0 fi @@ -4589,7 +4634,7 @@ _ACEOF ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" -if test "x$ac_cv_type_size_t" = x""yes; then : +if test "x$ac_cv_type_size_t" = xyes; then : else @@ -4600,7 +4645,7 @@ _ACEOF fi ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" -if test "x$ac_cv_type_off_t" = x""yes; then : +if test "x$ac_cv_type_off_t" = xyes; then : else @@ -4613,7 +4658,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } -if test "${ac_cv_header_stdc+set}" = set; then : +if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4727,8 +4772,7 @@ for ac_header in fcntl.h termcap.h termio.h termios.h unistd.h term.h ncurses/te do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -4754,11 +4798,11 @@ fi ac_fn_c_check_header_mongrel "$LINENO" "ncurses.h" "ac_cv_header_ncurses_h" "$ac_includes_default" -if test "x$ac_cv_header_ncurses_h" = x""yes; then : +if test "x$ac_cv_header_ncurses_h" = xyes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing initscr" >&5 $as_echo_n "checking for library containing initscr... " >&6; } -if test "${ac_cv_search_initscr+set}" = set; then : +if ${ac_cv_search_initscr+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS @@ -4792,11 +4836,11 @@ for ac_lib in '' ncurses; do fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext - if test "${ac_cv_search_initscr+set}" = set; then : + if ${ac_cv_search_initscr+:} false; then : break fi done -if test "${ac_cv_search_initscr+set}" = set; then : +if ${ac_cv_search_initscr+:} false; then : else ac_cv_search_initscr=no @@ -4810,11 +4854,11 @@ ac_res=$ac_cv_search_initscr if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - $as_echo "#define HAVE_NCURSES_H 1" >>confdefs.h + $as_echo "#define HAVE_NCURSES_H 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing tputs" >&5 $as_echo_n "checking for library containing tputs... " >&6; } -if test "${ac_cv_search_tputs+set}" = set; then : +if ${ac_cv_search_tputs+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS @@ -4848,11 +4892,11 @@ for ac_lib in '' tinfo; do fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext - if test "${ac_cv_search_tputs+set}" = set; then : + if ${ac_cv_search_tputs+:} false; then : break fi done -if test "${ac_cv_search_tputs+set}" = set; then : +if ${ac_cv_search_tputs+:} false; then : else ac_cv_search_tputs=no @@ -4872,7 +4916,7 @@ else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing initscr" >&5 $as_echo_n "checking for library containing initscr... " >&6; } -if test "${ac_cv_search_initscr+set}" = set; then : +if ${ac_cv_search_initscr+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS @@ -4906,11 +4950,11 @@ for ac_lib in '' curses; do fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext - if test "${ac_cv_search_initscr+set}" = set; then : + if ${ac_cv_search_initscr+:} false; then : break fi done -if test "${ac_cv_search_initscr+set}" = set; then : +if ${ac_cv_search_initscr+:} false; then : else ac_cv_search_initscr=no @@ -4928,7 +4972,7 @@ if test "$ac_res" != no; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing tputs" >&5 $as_echo_n "checking for library containing tputs... " >&6; } -if test "${ac_cv_search_tputs+set}" = set; then : +if ${ac_cv_search_tputs+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS @@ -4962,11 +5006,11 @@ for ac_lib in '' tinfo; do fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext - if test "${ac_cv_search_tputs+set}" = set; then : + if ${ac_cv_search_tputs+:} false; then : break fi done -if test "${ac_cv_search_tputs+set}" = set; then : +if ${ac_cv_search_tputs+:} false; then : else ac_cv_search_tputs=no @@ -4984,19 +5028,20 @@ fi else - as_fn_error "bvi requires the curses library" "$LINENO" 5 + as_fn_error $? "bvi requires a curses library" "$LINENO" 5 fi fi + else ac_fn_c_check_header_mongrel "$LINENO" "curses.h" "ac_cv_header_curses_h" "$ac_includes_default" -if test "x$ac_cv_header_curses_h" = x""yes; then : +if test "x$ac_cv_header_curses_h" = xyes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing initscr" >&5 $as_echo_n "checking for library containing initscr... " >&6; } -if test "${ac_cv_search_initscr+set}" = set; then : +if ${ac_cv_search_initscr+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS @@ -5030,11 +5075,11 @@ for ac_lib in '' curses; do fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext - if test "${ac_cv_search_initscr+set}" = set; then : + if ${ac_cv_search_initscr+:} false; then : break fi done -if test "${ac_cv_search_initscr+set}" = set; then : +if ${ac_cv_search_initscr+:} false; then : else ac_cv_search_initscr=no @@ -5048,16 +5093,85 @@ ac_res=$ac_cv_search_initscr if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - $as_echo "#define HAVE_CURSES_H 1" >>confdefs.h + $as_echo "#define HAVE_CURSES_H 1" >>confdefs.h else - as_fn_error "bvi requires the curses library" "$LINENO" 5 + as_fn_error $? "bvi requires a curses library" "$LINENO" 5 fi else - as_fn_error "bvi requires the curses library" "$LINENO" 5 + ac_fn_c_check_header_mongrel "$LINENO" "ncursesw/curses.h" "ac_cv_header_ncursesw_curses_h" "$ac_includes_default" +if test "x$ac_cv_header_ncursesw_curses_h" = xyes; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing initscr" >&5 +$as_echo_n "checking for library containing initscr... " >&6; } +if ${ac_cv_search_initscr+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char initscr (); +int +main () +{ +return initscr (); + ; + return 0; +} +_ACEOF +for ac_lib in '' ncursesw; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_initscr=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_initscr+:} false; then : + break +fi +done +if ${ac_cv_search_initscr+:} false; then : + +else + ac_cv_search_initscr=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_initscr" >&5 +$as_echo "$ac_cv_search_initscr" >&6; } +ac_res=$ac_cv_search_initscr +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + + $as_echo "#define HAVE_NCURSESW_CURSES_H 1" >>confdefs.h + +else + + as_fn_error $? "bvi requires a curses library" "$LINENO" 5 +fi + +else + + as_fn_error $? "bvi requires a curses library" "$LINENO" 5 +fi + + fi @@ -5070,8 +5184,7 @@ for ac_func in strdup strtol strtoll strerror memmove do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -5081,7 +5194,7 @@ done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGEFILE_SOURCE value needed for large files" >&5 $as_echo_n "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; } -if test "${ac_cv_sys_largefile_source+set}" = set; then : +if ${ac_cv_sys_largefile_source+:} false; then : $as_echo_n "(cached) " >&6 else while :; do @@ -5150,7 +5263,7 @@ fi for ac_header in stdlib.h do : ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" -if test "x$ac_cv_header_stdlib_h" = x""yes; then : +if test "x$ac_cv_header_stdlib_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STDLIB_H 1 _ACEOF @@ -5161,7 +5274,7 @@ done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 $as_echo_n "checking for GNU libc compatible malloc... " >&6; } -if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then : +if ${ac_cv_func_malloc_0_nonnull+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : @@ -5217,7 +5330,7 @@ fi for ac_header in stdlib.h do : ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" -if test "x$ac_cv_header_stdlib_h" = x""yes; then : +if test "x$ac_cv_header_stdlib_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STDLIB_H 1 _ACEOF @@ -5228,7 +5341,7 @@ done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible realloc" >&5 $as_echo_n "checking for GNU libc compatible realloc... " >&6; } -if test "${ac_cv_func_realloc_0_nonnull+set}" = set; then : +if ${ac_cv_func_realloc_0_nonnull+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : @@ -5350,10 +5463,21 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then - test "x$cache_file" != "x/dev/null" && + if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} - cat confcache >$cache_file + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} @@ -5369,6 +5493,7 @@ DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= +U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' @@ -5384,7 +5509,7 @@ LTLIBOBJS=$ac_ltlibobjs -: ${CONFIG_STATUS=./config.status} +: "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" @@ -5485,6 +5610,7 @@ fi IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. +as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -5530,19 +5656,19 @@ export LANGUAGE (unset CDPATH) >/dev/null 2>&1 && unset CDPATH -# as_fn_error ERROR [LINENO LOG_FD] -# --------------------------------- +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with status $?, using 1 if that was 0. +# script with STATUS, using 1 if that was 0. as_fn_error () { - as_status=$?; test $as_status -eq 0 && as_status=1 - if test "$3"; then - as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $1" >&2 + $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error @@ -5680,16 +5806,16 @@ if (echo >conf$$.file) 2>/dev/null; then # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. + # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null @@ -5738,7 +5864,7 @@ $as_echo X"$as_dir" | test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p @@ -5749,28 +5875,16 @@ else as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -5792,7 +5906,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # values after options handling. ac_log=" This file was extended by $as_me, which was -generated by GNU Autoconf 2.65. Invocation command line was +generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -5854,10 +5968,10 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status -configured by $0, generated by GNU Autoconf 2.65, +configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" -Copyright (C) 2009 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -5873,11 +5987,16 @@ ac_need_defaults=: while test $# != 0 do case $1 in - --*=*) + --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; *) ac_option=$1 ac_optarg=$2 @@ -5899,6 +6018,7 @@ do $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; @@ -5911,7 +6031,7 @@ do ac_need_defaults=false;; --he | --h) # Conflict between --help and --header - as_fn_error "ambiguous option: \`$1' + as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; @@ -5920,7 +6040,7 @@ Try \`$0 --help' for more information.";; ac_cs_silent=: ;; # This is an error. - -*) as_fn_error "unrecognized option: \`$1' + -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" @@ -5940,7 +6060,7 @@ fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then - set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' @@ -5972,7 +6092,7 @@ do "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done @@ -5994,9 +6114,10 @@ fi # after its creation but before its name has been assigned to `$tmp'. $debug || { - tmp= + tmp= ac_tmp= trap 'exit_status=$? - { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } @@ -6004,12 +6125,13 @@ $debug || { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" + test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") -} || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5 +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. @@ -6026,12 +6148,12 @@ if test "x$ac_cr" = x; then fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then - ac_cs_awk_cr='\r' + ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi -echo 'BEGIN {' >"$tmp/subs1.awk" && +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF @@ -6040,18 +6162,18 @@ _ACEOF echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || - as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 -ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || - as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then - as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi @@ -6059,7 +6181,7 @@ done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$tmp/subs1.awk" <<\\_ACAWK && +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h @@ -6107,7 +6229,7 @@ t delim rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK -cat >>"\$tmp/subs1.awk" <<_ACAWK && +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" @@ -6139,21 +6261,29 @@ if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat -fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ - || as_fn_error "could not setup config files machinery" "$LINENO" 5 +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries 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/ + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// s/^[^=]*=[ ]*$// }' fi @@ -6165,7 +6295,7 @@ fi # test -n "$CONFIG_FILES" # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then -cat >"$tmp/defines.awk" <<\_ACAWK || +cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF @@ -6177,11 +6307,11 @@ _ACEOF # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do - ac_t=`sed -n "/$ac_delim/p" confdefs.h` - if test -z "$ac_t"; then + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then break elif $ac_last_try; then - as_fn_error "could not make $CONFIG_HEADERS" "$LINENO" 5 + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi @@ -6266,7 +6396,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - as_fn_error "could not setup config headers machinery" "$LINENO" 5 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" @@ -6279,7 +6409,7 @@ do esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) as_fn_error "invalid tag \`$ac_tag'" "$LINENO" 5;; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac @@ -6298,7 +6428,7 @@ do for ac_f do case $ac_f in - -) ac_f="$tmp/stdin";; + -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. @@ -6307,7 +6437,7 @@ do [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - as_fn_error "cannot find input file: \`$ac_f'" "$LINENO" 5;; + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" @@ -6333,8 +6463,8 @@ $as_echo "$as_me: creating $ac_file" >&6;} esac case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin" \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 ;; + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac @@ -6464,23 +6594,24 @@ s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t $ac_datarootdir_hack " -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&5 +which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&2;} +which seems to be undefined. Please make sure it is defined" >&2;} - rm -f "$tmp/stdin" + rm -f "$ac_tmp/stdin" case $ac_file in - -) cat "$tmp/out" && rm -f "$tmp/out";; - *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # @@ -6489,21 +6620,21 @@ which seems to be undefined. Please make sure it is defined." >&2;} if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" - } >"$tmp/config.h" \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 - if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" - mv "$tmp/config.h" "$ac_file" \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ - || as_fn_error "could not create -" "$LINENO" 5 + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 fi ;; @@ -6518,7 +6649,7 @@ _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || - as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5 + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. @@ -6539,7 +6670,7 @@ if test "$no_create" != yes; then 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 || as_fn_exit $? + $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 diff --git a/configure.ac b/configure.ac index dd12369..1a57146 100644 --- a/configure.ac +++ b/configure.ac @@ -12,13 +12,13 @@ dnl On SunOS4 systems you have to use the /usr/5bin/cc compiler dnl to get the SYSV curses library: case "$host_os" in sunos4*) - AC_MSG_RESULT("using /usr/5bin/cc") - CC="/usr/5bin/cc" - ac_objext="o" - ;; + AC_MSG_RESULT("using /usr/5bin/cc") + CC="/usr/5bin/cc" + ac_objext="o" + ;; *) - AC_PROG_CC - ;; + AC_PROG_CC + ;; esac @@ -26,11 +26,11 @@ dnl Some curses specials dnl Solaris needs for tputs 'putc(char)' instead of 'putc(int)' case "$host_os" in solaris*) - CPPFLAGS="${CPPFLAGS} -D_MSE_INT_H" - AC_DEFINE(NEED_PUTC_CHAR) - ;; + CPPFLAGS="${CPPFLAGS} -D_MSE_INT_H" + AC_DEFINE(NEED_PUTC_CHAR) + ;; hpux9*) DEFS=${DEFS-"-DMINICURSES"} - ;; + ;; esac @@ -63,18 +63,23 @@ AC_ARG_WITH(ncurses, ]) AC_CHECK_HEADER([ncurses.h],[ - AC_SEARCH_LIBS([initscr], [ncurses],[ - AC_DEFINE(HAVE_NCURSES_H) - AC_SEARCH_LIBS([tputs], [tinfo])], [ + AC_SEARCH_LIBS([initscr], [ncurses], [ + AC_DEFINE(HAVE_NCURSES_H) + AC_SEARCH_LIBS([tputs], [tinfo])],[ AC_SEARCH_LIBS([initscr], [curses],[ AC_DEFINE(HAVE_CURSES_H) AC_SEARCH_LIBS([tputs], [tinfo])],[ - AC_MSG_ERROR([bvi requires the curses library])])])],[ + AC_MSG_ERROR([bvi requires a curses library])])]) + ],[ AC_CHECK_HEADER([curses.h],[ - AC_SEARCH_LIBS([initscr], [curses], [ - AC_DEFINE(HAVE_CURSES_H)],[ - AC_MSG_ERROR([bvi requires the curses library])])],[ - AC_MSG_ERROR([bvi requires the curses library])])]) + AC_SEARCH_LIBS([initscr], [curses], [ + AC_DEFINE(HAVE_CURSES_H)],[ + AC_MSG_ERROR([bvi requires a curses library])])],[ + AC_CHECK_HEADER([ncursesw/curses.h], [ + AC_SEARCH_LIBS([initscr], [ncursesw], [ + AC_DEFINE(HAVE_NCURSESW_CURSES_H)],[ + AC_MSG_ERROR([bvi requires a curses library])])],[ + AC_MSG_ERROR([bvi requires a curses library])])])]) dnl Checks for typedefs, structures, and compiler characteristics. dnl AC_TYPE_SIZE_T diff --git a/dosio.c b/dosio.c index 90cd281..e5d44a1 100644 --- a/dosio.c +++ b/dosio.c @@ -141,14 +141,14 @@ save(char *fname, PTR start, PTR end, int flags) if (!fname) { emsg("No file|No current filename"); return 0; - } + } if (stat(fname, &buf) == -1) { newstr = "[New file] "; - } else { - if (S_ISDIR(buf.st_mode)) { - sprintf(string, "\"%s\" Is a directory", fname); - msg(string); - return 0; + } else { + if (S_ISDIR(buf.st_mode)) { + sprintf(string, "\"%s\" Is a directory", fname); + msg(string); + return 0; } newstr = ""; } @@ -159,20 +159,20 @@ save(char *fname, PTR start, PTR end, int flags) return 0; } if (filemode == PARTIAL) { - if (block_read) { - filesize = block_read; - sprintf(string, "\"%s\" range %lu-%lu", fname, - (unsigned long)block_begin, - (unsigned long)(block_begin - 1 + filesize)); - if (lseek(fd, block_begin, SEEK_SET) < 0) { - sysemsg(fname); - return 0; - } - } else { - msg("Null range"); - return 0; - } - } else { + if (block_read) { + filesize = block_read; + sprintf(string, "\"%s\" range %lu-%lu", fname, + (unsigned long)block_begin, + (unsigned long)(block_begin - 1 + filesize)); + if (lseek(fd, block_begin, SEEK_SET) < 0) { + sysemsg(fname); + return 0; + } + } else { + msg("Null range"); + return 0; + } + } else { filesize = end - start + 1L; sprintf(string, "\"%s\" %s%lu@bytes", fname, newstr, (long)filesize); } @@ -228,7 +228,7 @@ load(char *fname) } else if (filemode == REGULAR) { memsize = buf.st_size + 100; } else { - memsize = 1000; + memsize = 1000; } if (farcoreleft() < memsize) { @@ -255,18 +255,18 @@ load(char *fname) filesize += (off_t)n; } while (filesize < buf.st_size); if ((filesize == 0) { - sprintf(string, "\"%s\" No such range: %lu-%lu", fname, - (unsigned long)block_begin, (unsigned long)(block_end)); - } else { - sprintf(string, "\"%s\" range %lu-%lu", fname, - (unsigned long)block_begin, - (unsigned long)(block_begin + filesize - 1)); - } - filemode = PARTIAL; - block_read = filesize; - msg(string); - P(P_OF) = block_begin; - params[P_OF].flags |= P_CHANGED; + sprintf(string, "\"%s\" No such range: %lu-%lu", fname, + (unsigned long)block_begin, (unsigned long)(block_end)); + } else { + sprintf(string, "\"%s\" range %lu-%lu", fname, + (unsigned long)block_begin, + (unsigned long)(block_begin + filesize - 1)); + } + filemode = PARTIAL; + block_read = filesize; + msg(string); + P(P_OF) = block_begin; + params[P_OF].flags |= P_CHANGED; } } else if (filemode == REGULAR) { chunk = buf.st_size > 0xfffe ? 0xfffe : buf.st_size; diff --git a/edit.c b/edit.c index ee1a1a7..3e9d5fa 100644 --- a/edit.c +++ b/edit.c @@ -12,8 +12,9 @@ * 2006-04-05 V 1.3.3 alpha - binary representation * 2014-09-30 V 1.4.0 * 2019-10-12 V 1.4.1 + * 2025-07-19 V 1.5.0 * - * Copyright 1996-2019 by Gerhard Buergmann + * Copyright 1996-2025 by Gerhard Buergmann * gerhard@puon.at * * This program is free software; you can redistribute it and/or modify it @@ -63,8 +64,7 @@ static char *getcnext = NULL; * characters (for "." command) */ off_t -edit(mode) - int mode; +edit(int mode) { int ch, ch1; size_t len; @@ -117,7 +117,7 @@ edit(mode) setcur(); continue; } - if (ch == KEY_BACKSPACE + if (ch == KEY_BACKSPACE || ch == ASCII_DEL || ch == BVICTRL('H')) { if (count > 0) { @@ -286,8 +286,7 @@ escape: * else setpage() */ PTR -do_ft(ch, flag) - int ch, flag; +do_ft(int ch, int flag) { static int chi; static int chp = 1; @@ -298,7 +297,7 @@ do_ft(ch, flag) switch (ch) { /* case 1: beep(); - return NULL; no previous command + return NULL; no previous command case -1: if (chp == 'f' || chp == 't') dir = BACKWARD; else dir = FORWARD; break; @@ -364,8 +363,7 @@ do_ft(ch, flag) void -do_z(mode) - int mode; +do_z(int mode) { switch (mode) { case '.': while (y != maxy / 2) { @@ -401,8 +399,7 @@ do_z(mode) void -scrolldown(lns) - int lns; +scrolldown(int lns) { while (lns--) { if (maxpos >= (pagepos + Anzahl)) pagepos += Anzahl; @@ -414,8 +411,7 @@ scrolldown(lns) void -scrollup(lns) - int lns; +scrollup(int lns) { while (lns--) { if (mem <= (PTR)(pagepos - Anzahl)) pagepos -= Anzahl; @@ -459,13 +455,14 @@ setcur() void statpos() { - char bin_val [9]; + char bin_val [9]; unsigned char Char1; - int i; + int i; off_t bytepos; char string[MAXCMD+1], str[6]; - if (!P(P_MO)) return; + // if (!P(P_MO)) return; + if (!statusflag) return; bytepos = current - mem; if (bytepos >= filesize) { // mvaddstr(maxy, status, " "); @@ -483,11 +480,19 @@ statpos() } } bin_val[8] = '\0'; - - sprintf(string, "%08llX %s \\%03o 0x%02X %3d ", - (long long)(bytepos + P(P_OF)), bin_val, Char1, Char1, Char1); + attrset(A_BOLD); status = maxx - 1 - statsize; + if (status > 0) { + sprintf(string, "%08llX %s \\%03o 0x%02X %3d ", + (long long)(bytepos + P(P_OF)), bin_val, Char1, Char1, Char1); + } else { + sprintf(string, "%08llX %3d ", + (long long)(bytepos + P(P_OF)), Char1); + mvaddstr(maxy, 0, string); + attrset(A_NORMAL); + return; + } mvaddstr(maxy, status, string); if (isprint(Char1)) { @@ -521,10 +526,9 @@ statpos() } + void -printline(mempos, scpos) - PTR mempos; - int scpos; +printline(PTR mempos, int scpos) { PTR hl_start = 0; PTR hl_end = 0; @@ -544,44 +548,44 @@ printline(mempos, scpos) mv_pos = AnzAdd; *linbuf = '\0'; if (hl_spat) { - f_start = (mempos - Anzahl) < mem ? mem : (mempos - Anzahl); - f_end = mempos + (2 * Anzahl); - hl_start = fsearch_end(f_start, f_end, search_pat, &hl_end); + f_start = (mempos - Anzahl) < mem ? mem : (mempos - Anzahl); + f_end = mempos + (2 * Anzahl); + hl_start = fsearch_end(f_start, f_end, search_pat, &hl_end); } for (print_pos = 0; print_pos < Anzahl; print_pos++) { if (hl_spat) { - while (hl_start != NULL) { - if (hl_start < mempos) { - if (hl_end < mempos) { - f_start = hl_start + 1; - hl_start = fsearch_end(f_start, f_end, search_pat, &hl_end); - } else { - attrset(A_STANDOUT); /* start out highlighted */ - break; - } - } else if (hl_start >= mempos) { - break; - } - } - if (hl_start != NULL) { - if ((hl_start - mempos) == print_pos) { - mvaddstr(scpos, mv_pos, linbuf); - mv_pos = AnzAdd + (3 * print_pos); - *linbuf = '\0'; - attrset(A_STANDOUT); - } - if ((hl_end - mempos) == print_pos) { - mvaddstr(scpos, mv_pos, linbuf); - *linbuf = '\0'; - mv_pos = AnzAdd + (3 * print_pos); - f_start = hl_end; - hl_start = fsearch_end(f_start, f_end, search_pat, &hl_end); - if (f_start != hl_start) { - attrset(A_NORMAL); - } - } - } + while (hl_start != NULL) { + if (hl_start < mempos) { + if (hl_end < mempos) { + f_start = hl_start + 1; + hl_start = fsearch_end(f_start, f_end, search_pat, &hl_end); + } else { + attrset(A_STANDOUT); /* start out highlighted */ + break; + } + } else if (hl_start >= mempos) { + break; + } + } + if (hl_start != NULL) { + if ((hl_start - mempos) == print_pos) { + mvaddstr(scpos, mv_pos, linbuf); + mv_pos = AnzAdd + (3 * print_pos); + *linbuf = '\0'; + attrset(A_STANDOUT); + } + if ((hl_end - mempos) == print_pos) { + mvaddstr(scpos, mv_pos, linbuf); + *linbuf = '\0'; + mv_pos = AnzAdd + (3 * print_pos); + f_start = hl_end; + hl_start = fsearch_end(f_start, f_end, search_pat, &hl_end); + if (f_start != hl_start) { + attrset(A_NORMAL); + } + } + } } if (mempos + print_pos >= maxpos) { sprintf(tmpbuf, " "); @@ -609,10 +613,10 @@ printline(mempos, scpos) addstr(string); attrset(A_NORMAL); } else { - addstr("."); + addstr("."); } } else { - addstr("."); + addstr("."); } } } else { @@ -660,8 +664,7 @@ repaint() /***** redraw screen *********************/ /******* display an arbitrary address on screen *******/ void -setpage(addr) - PTR addr; +setpage(PTR addr) { if ((addr >= pagepos) && ((addr - pagepos) < screen)) { y = (addr - pagepos) / Anzahl; @@ -684,8 +687,7 @@ setpage(addr) int -cur_forw(check) - int check; +cur_forw(int check) { if (check) { if (current - mem >= filesize) { @@ -760,8 +762,7 @@ cur_back() void -fileinfo(fname) - char *fname; +fileinfo(char *fname) { off_t bytepos; char fstatus[MAXCMD]; @@ -788,8 +789,8 @@ fileinfo(fname) if (edits) strcat(string, "[Modified] "); if (filesize) { bytepos = (pagepos + y * Anzahl + xpos()) - mem + 1L; - sprintf(fstatus, "byte %llu of %llu --%llu%%--", - (unsigned long long)bytepos, + sprintf(fstatus, "byte %llu of %llu --%llu%%--", + (unsigned long long)bytepos, (unsigned long long)filesize, (unsigned long long)(bytepos * 100L / filesize)); strcat(string, fstatus); @@ -830,8 +831,7 @@ vgetc() void -stuffin(s) -char *s; +stuffin(char *s) { if (s == NULL) { /* clear the stuff buffer */ getcnext = NULL; @@ -846,9 +846,7 @@ char *s; void -do_back(n, start) - off_t n; - PTR start; +do_back(off_t n, PTR start) { if (start - n < mem) { beep(); @@ -870,9 +868,7 @@ do_back(n, start) int -do_delete(n, start) - off_t n; - PTR start; +do_delete(off_t n, PTR start) { if (n + start > maxpos) { beep(); @@ -902,10 +898,7 @@ do_delete(n, start) * The :insert, :append and :change command */ void -do_ins_chg(start, arg, mode) - PTR start; - char *arg; - int mode; +do_ins_chg(PTR start, char *arg, int mode) { int base; off_t buffer = BUFFER; @@ -945,22 +938,22 @@ do_ins_chg(start, arg, mode) if (base == 1) { /* ASCII */ while (*poi != '\0') { if (*poi == '\\') { - switch (*(++poi)) { - case 'n': val = '\n'; break; - case 'r': val = '\r'; break; - case 't': val = '\t'; break; - case '0': val = '\0'; break; - case '\\': val = '\\'; break; - default : val = '\\'; poi--; - } - poi++; + switch (*(++poi)) { + case 'n': val = '\n'; break; + case 'r': val = '\r'; break; + case 't': val = '\t'; break; + case '0': val = '\0'; break; + case '\\': val = '\\'; break; + default : val = '\\'; poi--; + } + poi++; } else { val = *poi++; } *(tempbuf + count++) = val; } } else { - while (isspace(cmdstr[strlen(cmdstr) - 1])) + while (isspace(cmdstr[strlen(cmdstr) - 1])) cmdstr[strlen(cmdstr) - 1] = '\0'; while (*poi != '\0') { val = strtol(poi, &epoi, base); @@ -993,7 +986,7 @@ do_ins_chg(start, arg, mode) case U_APPEND: if ((undo_count = alloc_buf(count, &undo_buf)) == 0L) { repaint(); - goto mfree; + goto mfree; } do_append((off_t)count, tempbuf); memcpy(undo_buf, tempbuf, count); @@ -1021,11 +1014,9 @@ clear_marks() void -do_mark(mark, addr) - int mark; - PTR addr; +do_mark(int mark, PTR addr) { - if (mark < 'a' || mark > 'z' || current >= maxpos) + if (mark < 'a' || mark > 'z' || current >= maxpos) return; markbuf[mark - 'a'] = addr; } diff --git a/io.c b/io.c index 1a0eda4..b9c2741 100644 --- a/io.c +++ b/io.c @@ -11,10 +11,12 @@ * 2010-06-02 V 1.3.4 * 2014-05-03 V 1.4.0 * 2019-01-27 V 1.4.1 + * 2022-03-09 V 1.4.2 + * 2025-07-19 V 1.5.0 * * NOTE: Edit this file with tabstop=4 ! * - * Copyright 1996-2019 by Gerhard Buergmann + * Copyright 1996-2025 by Gerhard Buergmann * gerhard@puon.at * * This program is free software; you can redistribute it and/or modify it @@ -55,6 +57,20 @@ # include #endif + +//@ read on linux has a limit of 0x7ffff000 bytes (see `man read`) +//@ this function calls recursively read until all `count` characters are read. +static ssize_t +read_to_end(int fd, void *buf, size_t count) { + size_t read_bytes = 0; + while(read_bytes < count) { + const ssize_t ret = read(fd, ((char*)buf)+read_bytes, count-read_bytes); + if(ret <= 0) return ret; + read_bytes += ret; + } + return read_bytes; +} + int filemode; static struct stat buf; static off_t block_read; @@ -64,11 +80,7 @@ extern char *fname_buf; /*********** Save the patched file ********************/ int -save(fname, start, end, flags) - char *fname; - char *start; - char *end; - int flags; +save(char *fname, char *start, char *end, int flags) { int fd; char *string; @@ -152,8 +164,7 @@ save(fname, start, end, flags) /* loads a file, returns the filesize */ off_t -load(fname) - char *fname; +load(char *fname) { int fd = -1; //char *string; @@ -220,7 +231,7 @@ load(fname) params[P_RO].flags |= P_CHANGED; } } else { - sysemsg(fname); + sysemsg(fname); filemode = ERROR; } } @@ -261,7 +272,7 @@ load(fname) sysemsg(fname); filemode = ERROR; } else { - if ((filesize = read(fd, mem, block_size)) == 0) { + if ((filesize = read_to_end(fd, mem, block_size)) == 0) { sprintf(fname_buf, "\"%s\" Empty file", fname); filemode = ERROR; } else { @@ -278,7 +289,7 @@ load(fname) } } else if ((filemode == REGULAR) || (filemode == DIRECTORY)) { filesize = buf.st_size; - if (read(fd, mem, filesize) != filesize) { + if (read_to_end(fd, mem, filesize) != filesize) { sysemsg(fname); filemode = ERROR; } @@ -318,12 +329,11 @@ load(fname) } -/* argument "dir" not used! +/* argument "dir" not used! * Needed for DOS version only */ void -bvi_init(dir) - char *dir; +bvi_init(char *dir) { char *initstr; char rcpath[MAXCMD]; @@ -337,7 +347,7 @@ bvi_init(dir) docmdline(initstr); return; } - + #ifdef DJGPP strcpy(rcpath, "c:"); strcpy(rcpath, dir); @@ -363,8 +373,7 @@ bvi_init(dir) int -enlarge(add) - off_t add; +enlarge(off_t add) { char *newmem; off_t savecur, savepag, savemax, saveundo; @@ -413,11 +422,10 @@ do_shell() #ifndef HAVE_STRDUP char * -strdup(s) - char *s; +strdup(char *s) { char *p; - size_t n; + size_t n; n = strlen(s) + 1; if ((p = (char *)malloc(n)) != NULL) @@ -432,10 +440,7 @@ strdup(s) * Copy contents of memory (with possible overlapping). */ char * -memmove(s1, s2, n) - char *s1; - char *s2; - size_t n; +memmove(char *s1, char *s2, size_t n) { bcopy(s2, s1, n); return(s1); @@ -444,9 +449,7 @@ memmove(s1, s2, n) off_t -alloc_buf(n, buffer) - off_t n; - char **buffer; +alloc_buf(off_t n, char **buffer) { if (*buffer == NULL) { *buffer = (char *)malloc(n); @@ -462,8 +465,7 @@ alloc_buf(n, buffer) int -addfile(fname) - char *fname; +addfile(char *fname) { int fd; off_t oldsize; @@ -478,7 +480,7 @@ addfile(fname) } oldsize = filesize; if (enlarge(buf.st_size)) return 1; - if (read(fd, mem + filesize, buf.st_size) == -1) { + if (read_to_end(fd, mem + filesize, buf.st_size) == -1) { sysemsg(fname); return 1; } @@ -488,3 +490,4 @@ addfile(fname) setpage(mem + oldsize); return 0; } + diff --git a/macro.m4 b/macro.m4 new file mode 100644 index 0000000..c8c0698 --- /dev/null +++ b/macro.m4 @@ -0,0 +1,59 @@ +AC_CHECK_HEADER +( + [ncurses.h], + [ + AC_SEARCH_LIBS + ([initscr], [ncurses], + [ + AC_DEFINE(HAVE_NCURSES_H) + AC_SEARCH_LIBS([tputs], [tinfo]) + ],[ + AC_SEARCH_LIBS + ( + [initscr], [curses], + [ + AC_DEFINE(HAVE_CURSES_H) + AC_SEARCH_LIBS([tputs], [tinfo]) + ],[ + AC_MSG_ERROR([bvi requires a curses library]) + ] + ) + ] + ) + ],[ + AC_CHECK_HEADER + ( + [curses.h], + [ + AC_SEARCH_LIBS + ( + [initscr], [curses], + [ + AC_DEFINE(HAVE_CURSES_H) + ],[ + AC_MSG_ERROR([bvi requires a curses library]) + ] + ) + ],[ + # statt: AC_MSG_ERROR([bvi requires a curses library]) + AC_CHECK_HEADER + ( + [ncursesw/curses.h], + [ + AC_SEARCH_LIBS + ( + [initscr], [curses], + [ + AC_DEFINE(HAVE_NCURSESW_CURSES_H) + ],[ + AC_MSG_ERROR([bvi requires a curses library]) + ] + ) + ],[ + AC_MSG_ERROR([bvi requires a curses library]) + ] + ) + ] + ) + ] +) diff --git a/patchlevel.h b/patchlevel.h index 276f7ba..2ed1b2c 100644 --- a/patchlevel.h +++ b/patchlevel.h @@ -1 +1 @@ -#define VERSION "1.4.1" +#define VERSION "1.5.0" diff --git a/re.c b/re.c index bc5cdd8..cee506d 100644 --- a/re.c +++ b/re.c @@ -11,8 +11,10 @@ * 2010-06-02 V 1.3.4 * 2013-08-24 V 1.4.0 * 2019-01-28 V 1.4.1 + * 2023-03-07 V 1.4.2 + * 2025-07-19 V 1.5.0 * - * Copyright 1996-2019 by Gerhard Buergmann + * Copyright 1996-2025 by Gerhard Buergmann * gerhard@puon.at * * This program is free software; you can redistribute it and/or modify it @@ -31,11 +33,15 @@ /* You cannot use a common regexp subroutine, because \0 is a regular * character in a binary string ! */ - + #include "bvi.h" #include "set.h" +#ifdef __STDC__ +static int sbracket(int, char *, int); +#else static int sbracket(); +#endif char act_pat[MAXCMD]; /* found pattern */ char pattern[MAXCMD + 1]; @@ -47,9 +53,7 @@ char *emptyclass = "Bad character class|Empty byte class '[]' or '[^]' cannot ma PTR -bregexec(start, scan) - PTR start; - char *scan; +bregexec(PTR start, char *scan) { char *act; int count, test; @@ -124,10 +128,7 @@ bregexec(start, scan) static int -sbracket(start, scan, count) - int start; - char *scan; - int count; +sbracket(int start, char *scan, int count) { if (*scan++ == '^') { if (!memchr(scan, start, --count)) return 0; @@ -139,8 +140,7 @@ sbracket(start, scan, count) PTR -end_word(start) - PTR start; +end_word(PTR start) { PTR pos; @@ -154,9 +154,7 @@ end_word(start) /* wordsearch serves the 'W' and 'w' - command */ PTR -wordsearch(start, mode) - PTR start; - char mode; +wordsearch(PTR start, char mode) { PTR found; PTR pos; @@ -186,9 +184,7 @@ wordsearch(start, mode) /* backsearch serves the 'b' and 'B' command */ PTR -backsearch(start, mode) - PTR start; - char mode; +backsearch(PTR start, char mode) { PTR pos; int ccount; @@ -215,11 +211,7 @@ backsearch(start, mode) /* used by :s */ int -do_substitution(delim, line, startpos, endpos) - int delim; - char *line; - PTR startpos; - PTR endpos; +do_substitution(int delim, char *line, PTR startpos, PTR endpos) { int n; char *found; @@ -312,7 +304,7 @@ do_substitution(delim, line, startpos, endpos) refresh(); if (global) { - if ((undo_count = alloc_buf(endpos - startpos, &undo_buf))) { + if ((undo_count = alloc_buf((off_t)(endpos - startpos), &undo_buf))) { memcpy(undo_buf, startpos + 1, undo_count); } undo_start = startpos + 1; @@ -331,9 +323,9 @@ AGAIN: emsg(notfound); } else { if (P(P_TE)) - sprintf(string, "No match to %s", direct == FORWARD ? "BOTTOM" : "TOP"); + sprintf(string, "No match to %s", direct == FORWARD ? "BOTTOM" : "TOP"); else - sprintf(string, "Address search hit %s without matching pattern", + sprintf(string, "Address search hit %s without matching pattern", direct == FORWARD ? "BOTTOM" : "TOP"); emsg(string); } @@ -350,7 +342,7 @@ AGAIN: repl_count++; current_start = pagepos + y * Anzahl + xpos(); if (!global) { - if ((undo_count = alloc_buf(pat_len, &undo_buf))) { + if ((undo_count = alloc_buf((off_t)pat_len, &undo_buf))) { memcpy(undo_buf, current_start, undo_count); } undo_start = current_start; @@ -375,12 +367,7 @@ SKIP: * return address found */ PTR -searching(ch, line, startpos, endpos, flag) - int ch; - char *line; - PTR startpos; - PTR endpos; - int flag; +searching(int ch, char *line, PTR startpos, PTR endpos, int flag) { char *cmd = NULL; PTR found; @@ -454,9 +441,9 @@ searching(ch, line, startpos, endpos, flag) emsg(notfound); } else { if (P(P_TE)) { - sprintf(string, "No match to %s", sdir == FORWARD ? "BOTTOM" : "TOP"); + sprintf(string, "No match to %s", sdir == FORWARD ? "BOTTOM" : "TOP"); } else { - sprintf(string, "Address search hit %s without matching pattern", + sprintf(string, "Address search hit %s without matching pattern", sdir == FORWARD ? "BOTTOM" : "TOP"); } emsg(string); @@ -484,9 +471,7 @@ searching(ch, line, startpos, endpos, flag) * returns pointer to next character */ char * -patcpy(s1, s2, delim) - char *s1, *s2; - char delim; +patcpy(char *s1, char *s2, char delim) { while (*s2 != '\0' && *s2 != delim) { if (*s2 == '\\' && *(s2 + 1) == delim) s2++; @@ -499,14 +484,10 @@ patcpy(s1, s2, delim) PTR -fsearch_end(start, end, smem, s_end) +fsearch_end(PTR start, PTR end, char *smem, PTR *s_end) /* fsearch(start, end, smem) */ - PTR start; - PTR end; - char *smem; - PTR *s_end; { PTR spos; @@ -525,10 +506,7 @@ fsearch(start, end, smem) PTR -fsearch(start, end, smem) - PTR start; - PTR end; - char *smem; +fsearch(PTR start, PTR end, char *smem) { PTR s_end; return fsearch_end(start, end, smem, &s_end); @@ -536,10 +514,7 @@ fsearch(start, end, smem) PTR -rsearch(start, end, smem) - PTR start; - PTR end; - char *smem; +rsearch(PTR start, PTR end, char *smem) { PTR spos; @@ -559,9 +534,7 @@ rsearch(start, end, smem) * returns NULL on error or default_address, if nothing found */ PTR -calc_addr(pointer, def_addr) - char **pointer; - PTR def_addr; +calc_addr(char **pointer, PTR def_addr) { PTR addr; int ch, mark; diff --git a/recomp.c b/recomp.c index 1937b9c..e078689 100644 --- a/recomp.c +++ b/recomp.c @@ -6,8 +6,9 @@ * 2000-04-25 V 1.3.0 beta * 2000-07-12 V 1.3.0 final * 2019-01-28 V 1.4.1 + * 2025-07-19 V 1.5.0 * - * Copyright 1996-2019 by Gerhard Buergmann + * Copyright 1996-2025 by Gerhard Buergmann * gerhard@puon.at * * This program is free software; you can redistribute it and/or modify it @@ -26,7 +27,7 @@ /* You cannot use a common regexp subroutine, because \0 is a regular * character in a binary string ! */ - + #include "bvi.h" #include "set.h" @@ -46,9 +47,7 @@ extern char *emptyclass; * Compiling an ASCII sequence to a regex string */ int -ascii_comp(smem, pattern) - char *smem; - char *pattern; +ascii_comp(char *smem, char *pattern) { char *end; char *comp; @@ -167,9 +166,7 @@ ascii_comp(smem, pattern) * Compiling a hex expression to a regex string */ int -hex_comp(smem, pattern) - char *smem; - char *pattern; +hex_comp(char *smem, char *pattern) { char *end; char *comp; diff --git a/set.c b/set.c index 7f2707f..7a507ff 100644 --- a/set.c +++ b/set.c @@ -9,13 +9,14 @@ * 1999-07-02 V 1.2.0 beta * 1999-08-14 V 1.2.0 final * 2000-07-15 V 1.3.0 final - * 2001-10-10 V 1.3.1 + * 2001-10-10 V 1.3.1 * 2003-07-03 V 1.3.2 * 2010-06-02 V 1.2.4 * 2014-09-30 V 1.4.0 * 2019-01-22 V 1.4.1 + * 2025-07-19 V 1.5.0 * - * Copyright 1996-2019 by Gerhard Buergmann + * Copyright 1996-2025 by Gerhard Buergmann * gerhard@puon.at * * This program is free software; you can redistribute it and/or modify it @@ -34,46 +35,47 @@ #include "bvi.h" #include "set.h" -static int from_file = 0; +static int from_file = 0; static FILE *ffp; static char fbuf[MAXCMD+1]; static char buf[MAXCMD+1]; struct param params[] = { { "autowrite", "aw", FALSE, "", P_BOOL }, - { "columns", "cm", 16, "", P_NUM }, + { "columns", "cm", 0, "", P_NUM }, { "errorbells", "eb", FALSE, "", P_BOOL }, { "ignorecase", "ic", FALSE, "", P_BOOL }, - { "magic", "ma", TRUE, "", P_BOOL }, + { "magic", "ma", TRUE, "", P_BOOL }, { "memmove", "mm", FALSE, "", P_BOOL }, - { "offset", "of", 0, "", P_NUM }, + { "offset", "of", 0, "", P_NUM }, { "readonly", "ro", FALSE, "", P_BOOL }, - { "scroll", "scroll", 12, "", P_NUM }, + { "scroll", "scroll", 12, "", P_NUM }, { "showmode", "mo", TRUE, "", P_BOOL }, - { "term", "term", 0, "", P_TEXT }, - { "terse", "terse", FALSE, "", P_BOOL }, + { "term", "term", 0, "", P_TEXT }, + { "terse", "terse", FALSE, "", P_BOOL }, { "unixstyle", "us", FALSE, "", P_BOOL }, - { "window", "window", 25, "", P_NUM }, - { "wordlength", "wl", 4, "", P_NUM }, + { "window", "window", 0, "", P_NUM }, + { "wordlength", "wl", 4, "", P_NUM }, { "wrapscan", "ws", TRUE, "", P_BOOL }, - { "highlight", "hl", TRUE, "", P_BOOL }, - { "reverse", "re", FALSE, "", P_BOOL }, + { "highlight", "hl", TRUE, "", P_BOOL }, + { "reverse", "re", FALSE, "", P_BOOL }, #if defined(__MSDOS__) && !defined(DJGPP) - { "color", "co", 7, "", P_NUM }, + { "color", "co", 7, "", P_NUM }, #endif - { "", "", 0, "", 0, } /* end marker */ + { "", "", 0, "", 0, } /* end marker */ }; + int -doset(arg) - char *arg; /* parameter string */ +doset(char *arg) { - int i; + int i; char *s; - int did_window = FALSE; - int state = TRUE; /* new state of boolean parms. */ + int did_window = FALSE; + int state = TRUE; /* new state of boolean parms. */ char string[80]; + off_t val; if (arg == NULL) { showparms(FALSE); @@ -111,20 +113,38 @@ doset(arg) return 0; } if (!strcmp(params[i].fullname, "term")) { - emsg("Can't change type of terminal from within bvi"); + emsg("Can't change@type of terminal from within bvi"); return 1; } if (params[i].flags & P_NUM) { - if ((i == P_LI) || (i == P_OF)) did_window++; + if ((i == P_LI) || (i == P_OF) || (i == P_CM)) did_window++; if (arg[strlen(s)] != '=' || state == FALSE) { - sprintf(string, "Option %s is not a toggle", - params[i].fullname); + sprintf(string, "Option %s is not a toggle", params[i].fullname); emsg(string); return 1; } else { s = arg + strlen(s) + 1; - params[i].nvalue = strtoll(s, &s, 0); + val = strtoll(s, &s, 0); + if ((i == P_CM || i == P_LI) && (!strcmp("auto", s) || (val == 0))) { + if (i == P_CM) { + params[i].nvalue = 0; + Anzahl = ((COLS - AnzAdd - space) / 4); + } else { + params[i].nvalue = 0; + maxy = LINES - 1; + } + } else { + params[i].nvalue = val; + if (i == P_CM) { + Anzahl = val; + } else { + maxy = val; + } + } params[i].flags |= P_CHANGED; + if (i == P_LI) params[P_SS].nvalue = val / 2; + + #if defined(__MSDOS__) && !defined(DJGPP) if (i == P_CO) { textcolor(P(P_CO) & 0x07); @@ -134,22 +154,23 @@ doset(arg) } #endif if (i == P_CM) { + /* if (((COLS - AnzAdd - 1) / 4) >= P(P_CM)) { Anzahl = P(P_CM); } else { - Anzahl = P(P_CM) = ((COLS - AnzAdd - 1) / 4); + Anzahl = ((COLS - AnzAdd - 1) / 4); } - maxx = Anzahl * 4 + AnzAdd + 1; - Anzahl3 = Anzahl * 3; - status = Anzahl3 + Anzahl - 17; - screen = Anzahl * (maxy - 1); - did_window++; + */ + maxx = Anzahl * 4 + AnzAdd + 1; + Anzahl3 = Anzahl * 3; + status = Anzahl3 + Anzahl - statsize; + screen = Anzahl * (maxy - 1); stuffin("H"); /* set cursor at HOME */ } } } else { /* boolean */ if (arg[strlen(s)] == '=') { - emsg("Invalid set of boolean parameter"); + emsg("Invalid set@of boolean parameter"); return 1; } else { params[i].nvalue = state; @@ -169,7 +190,10 @@ doset(arg) } if (did_window) { + /* maxy = P(P_LI) - 1; + maxy = LINES - 1; + */ new_screen(); } @@ -179,28 +203,33 @@ doset(arg) /* show ALL parameters */ void -showparms(all) - int all; +showparms(int all) { struct param *p; - int n; + int n, i; + statusflag = 0; n = 2; + i = -1; msg("Parameters:\n"); for (p = ¶ms[0]; p->fullname[0] != '\0' ;p++) { + i++; if (!all && ((p->flags & P_CHANGED) == 0)) continue; - if (p->flags & P_BOOL) - sprintf(buf, " %s%s\n", - (p->nvalue ? " " : "no"), p->fullname); - else if (p->flags & P_TEXT) + if (p->flags & P_BOOL) { + sprintf(buf, " %s%s\n", (p->nvalue ? " " : "no"), p->fullname); + } else if (p->flags & P_TEXT) { sprintf(buf, " %s=%s\n", p->fullname, p->svalue); - else - sprintf(buf, " %s=%lld\n", p->fullname, (long long)p->nvalue); - + } else { + if ((p->nvalue == 0) && (i == P_CM || i == P_LI)) { + sprintf(buf, " %s=auto\n", p->fullname); + } else { + sprintf(buf, " %s=%lld\n", p->fullname, (long long)p->nvalue); + } + } msg(buf); n++; - if (n == params[P_LI].nvalue) { + if (n == maxy) { if (wait_return(FALSE)) return; n = 1; } @@ -211,8 +240,7 @@ showparms(all) /* reads the init file (.bvirc) */ int -read_rc(fn) - char *fn; +read_rc(char *fn) { int i; @@ -230,9 +258,7 @@ read_rc(fn) int -do_logic(mode, str) - int mode; - char *str; +do_logic(int mode, char *str) { int a, b; int value; @@ -289,13 +315,13 @@ do_logic(mode, str) b = a >> 8; a |= b; break; - case RROTATE: + case RROTATE: b = a << 8; a |= b; - a >>= value; + a >>= value; /* b = a << (8 - value); - a >>= value; + a >>= value; a |= b; */ break; @@ -303,7 +329,7 @@ do_logic(mode, str) break; case OR: a |= value; break; - case XOR: + case XOR: case NOT: a ^= value; break; case NEG: a ^= value; @@ -318,9 +344,7 @@ do_logic(mode, str) int -getcmdstr(p, x) - char *p; - int x; +getcmdstr(char *p, int x) { int c; int i, n; diff --git a/set.h b/set.h index 8995296..1abc28b 100644 --- a/set.h +++ b/set.h @@ -2,8 +2,8 @@ * * NOTE: Edit this file with tabstop=4 ! * - * Copyright 1996-2019 by Gerhard Buergmann - * Gerhard.Buergmann@puon.at + * Copyright 1996-2025 by Gerhard Buergmann + * gerhard@puon.at * * 1998-03-14 V 1.0.0 * 1999-01-14 V 1.1.0 @@ -14,6 +14,7 @@ * 2010-06-02 V 1.3.4 * 2013-08-23 V 1.4.0 * 2019-01-22 V 1.4.1 + * 2025-05-24 V 1.5.0 * * 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 @@ -34,7 +35,7 @@ struct param { char *shortname; /* permissible abbreviation */ off_t nvalue; char *svalue; - int flags; + int flags; }; extern struct param params[]; diff --git a/tags b/tags index 771ed94..d5989e2 100644 --- a/tags +++ b/tags @@ -4,14 +4,14 @@ !_TAG_PROGRAM_NAME Exuberant Ctags // !_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/ !_TAG_PROGRAM_VERSION 5.9~svn20110310 // -AND bvi.h 90;" d -ANSI bmore.h 104;" d -ANSI bvi.h 120;" d -APPEND comm.c 51;" d file: -APPEND comm.c 54;" d file: -ASCII bmore.h 83;" d -ASCII bvi.h 97;" d -ASCII_DEL bvi.h 106;" d +AND bvi.h 100;" d +ANSI bmore.h 108;" d +ANSI bvi.h 130;" d +APPEND comm.c 53;" d file: +APPEND comm.c 56;" d file: +ASCII bmore.h 87;" d +ASCII bvi.h 107;" d +ASCII_DEL bvi.h 116;" d A_ATTRIBUTES doscur.h 56;" d A_BLINK doscur.h 54;" d A_BOLD doscur.h 52;" d @@ -20,63 +20,64 @@ A_NORMAL doscur.h 50;" d A_REVERSE doscur.h 53;" d A_STANDOUT doscur.h 51;" d AnzAdd bmore.c /^int AnzAdd;$/;" v -AnzAdd bvi.c /^int AnzAdd, Anzahl, Anzahl3;$/;" v -Anzahl bvi.c /^int AnzAdd, Anzahl, Anzahl3;$/;" v -Anzahl3 bvi.c /^int AnzAdd, Anzahl, Anzahl3;$/;" v +AnzAdd bvi.c /^int AnzAdd, Anzahl, Anzahl3;$/;" v +Anzahl bvi.c /^int AnzAdd, Anzahl, Anzahl3;$/;" v +Anzahl3 bvi.c /^int AnzAdd, Anzahl, Anzahl3;$/;" v Ausgabe_Datei bvi.c /^FILE *Ausgabe_Datei;$/;" v -BACKWARD bmore.h 85;" d -BACKWARD bvi.h 99;" d +BACKWARD bmore.h 89;" d +BACKWARD bvi.h 109;" d BLOCK_BEGIN bvi.h /^ BLOCK_BEGIN = 1,$/;" e enum:_block_datum BLOCK_END bvi.h /^ BLOCK_END = 2,$/;" e enum:_block_datum BLOCK_LEN bvi.h /^ BLOCK_LEN = 4$/;" e enum:_block_datum -BLOCK_SPECIAL bmore.h 75;" d -BLOCK_SPECIAL bvi.h 66;" d -BS bmore.h 88;" d -BS bvi.h 102;" d -BUFFER bmore.h 116;" d -BUFFER bvi.h 134;" d -BVICTRL bmore.h 92;" d -BVICTRL bvi.h 105;" d -CHARACTER_SPECIAL bmore.h 74;" d -CHARACTER_SPECIAL bvi.h 65;" d -CMDLNG bvi.h 108;" d -CMDSZ comm.c 57;" d file: +BLOCK_SPECIAL bmore.h 79;" d +BLOCK_SPECIAL bvi.h 76;" d +BS bmore.h 92;" d +BS bvi.h 112;" d +BUFFER bmore.h 120;" d +BUFFER bvi.h 144;" d +BVICTRL bmore.h 96;" d +BVICTRL bvi.h 115;" d +CHARACTER_SPECIAL bmore.h 78;" d +CHARACTER_SPECIAL bvi.h 75;" d +CMDLNG bvi.h 118;" d +CMDSZ comm.c 59;" d file: COLS dosio.c /^int COLS = 80;$/;" v -CR bmore.h 86;" d -CR bvi.h 100;" d -DELIM bmore.h 107;" d -DELIM bmore.h 112;" d -DELIM bvi.h 123;" d -DELIM bvi.h 130;" d -DIRECTORY bmore.h 73;" d -DIRECTORY bvi.h 64;" d +CR bmore.h 90;" d +CR bvi.h 110;" d +DELIM bmore.h 111;" d +DELIM bmore.h 116;" d +DELIM bvi.h 133;" d +DELIM bvi.h 140;" d +DIRECTORY bmore.h 77;" d +DIRECTORY bvi.h 74;" d ECHO dosio.c /^int ECHO = TRUE;$/;" v -END bmore.h 79;" d -END bvi.h 70;" d +END bmore.h 83;" d +END bvi.h 80;" d ERR doscur.h 147;" d -ERROR bmore.h 70;" d -ERROR bvi.h 61;" d -ESC bmore.h 89;" d -ESC bvi.h 103;" d +ERROR bmore.h 74;" d +ERROR bvi.h 71;" d +ESC bmore.h 93;" d +ESC bvi.h 113;" d ESC doscur.h 31;" d -FALSE bmore.h 100;" d -FALSE bvi.h 116;" d +FALSE bmore.h 104;" d +FALSE bvi.h 126;" d FALSE doscur.h 29;" d -FORWARD bmore.h 84;" d -FORWARD bvi.h 98;" d +FORWARD bmore.h 88;" d +FORWARD bvi.h 108;" d HAVE_CURSES_H acconfig.h 5;" d HAVE_FCNTL_H dosconf.h 40;" d HAVE_LOCALE_H dosconf.h 44;" d HAVE_MEMMOVE dosconf.h 31;" d +HAVE_NCURSESW_CURSES_H acconfig.h 7;" d HAVE_NCURSES_H acconfig.h 3;" d -HAVE_NCURSES_TERM_H acconfig.h 11;" d +HAVE_NCURSES_TERM_H acconfig.h 13;" d HAVE_STRDUP dosconf.h 34;" d HAVE_STRTOL dosconf.h 37;" d -HELPFILE bmore.c 43;" d file: HELPFILE bmore.c 45;" d file: -HEX bvi.h 96;" d +HELPFILE bmore.c 47;" d file: +HEX bvi.h 106;" d Home bm_unix.c /^char *Home; \/* go to home *\/$/;" v -JOEHTG bvi.h 43;" d +JOEHTG bvi.h 45;" d KEY_BACKSPACE doscur.h 42;" d KEY_DC doscur.h 45;" d KEY_DOWN doscur.h 34;" d @@ -93,132 +94,132 @@ KEY_RETURN doscur.h 40;" d KEY_RIGHT doscur.h 37;" d KEY_UP doscur.h 35;" d LINES dosio.c /^int LINES = 25;$/;" v -LROTATE bvi.h 88;" d -LSHIFT bvi.h 86;" d -MAXCMD bmore.h 115;" d -MAXCMD bvi.h 133;" d -MAXNAME comm.c 58;" d file: -MAX_ONE_ARG comm.c 63;" d file: -MAX_ONE_FILE comm.c 65;" d file: -NEED_PUTC_CHAR acconfig.h 9;" d -NEED_PUTC_CHAR bm_unix.c 52;" d file: -NEG bvi.h 93;" d -NEW bmore.h 72;" d -NEW bvi.h 63;" d -NL bmore.h 87;" d -NL bvi.h 101;" d +LROTATE bvi.h 98;" d +LSHIFT bvi.h 96;" d +MAXCMD bmore.h 119;" d +MAXCMD bvi.h 143;" d +MAXNAME comm.c 60;" d file: +MAX_ONE_ARG comm.c 65;" d file: +MAX_ONE_FILE comm.c 67;" d file: +NEED_PUTC_CHAR acconfig.h 11;" d +NEED_PUTC_CHAR bm_unix.c 54;" d file: +NEG bvi.h 103;" d +NEW bmore.h 76;" d +NEW bvi.h 73;" d +NL bmore.h 91;" d +NL bvi.h 111;" d NODEL dosio.c /^int NODEL = FALSE;$/;" v -NOT bvi.h 94;" d -NO_ADDR comm.c 60;" d file: -NO_ARG comm.c 61;" d file: -NO_SYSERRL acconfig.h 7;" d -NULL bmore.h 95;" d -NULL bvi.h 111;" d -OFF_T_MAX io.c 47;" d file: -ONE bmore.h 80;" d -ONE bvi.h 71;" d -ONE_ARG comm.c 62;" d file: -ONE_FILE comm.c 64;" d file: -OR bvi.h 91;" d -P set.h 77;" d -PARTIAL bmore.h 76;" d -PARTIAL bvi.h 67;" d -PRINTF bmore.c 38;" d file: +NOT bvi.h 104;" d +NO_ADDR comm.c 62;" d file: +NO_ARG comm.c 63;" d file: +NO_SYSERRL acconfig.h 9;" d +NULL bmore.h 99;" d +NULL bvi.h 121;" d +OFF_T_MAX io.c 49;" d file: +ONE bmore.h 84;" d +ONE bvi.h 81;" d +ONE_ARG comm.c 64;" d file: +ONE_FILE comm.c 66;" d file: +OR bvi.h 101;" d +P set.h 78;" d +PARTIAL bmore.h 80;" d +PARTIAL bvi.h 77;" d PRINTF bmore.c 40;" d file: -PTR bmore.h 105;" d -PTR bmore.h 111;" d -PTR bvi.h 121;" d -PTR bvi.h 129;" d -P_AW set.h 54;" d -P_BOOL set.h 42;" d -P_CHANGED set.h 45;" d -P_CM set.h 55;" d -P_CO set.h 72;" d -P_EB set.h 56;" d -P_HL set.h 70;" d -P_IC set.h 57;" d -P_LI set.h 67;" d -P_MA set.h 58;" d -P_MM set.h 59;" d -P_MO set.h 63;" d -P_NUM set.h 43;" d -P_OF set.h 60;" d -P_RE set.h 71;" d -P_RO set.h 61;" d -P_SS set.h 62;" d -P_TE set.h 65;" d -P_TEXT set.h 44;" d -P_TT set.h 64;" d -P_US set.h 66;" d -P_WL set.h 68;" d -P_WS set.h 69;" d -REGULAR bmore.h 71;" d -REGULAR bvi.h 62;" d -REPLACE bmore.h 91;" d -RROTATE bvi.h 89;" d -RSHIFT bvi.h 87;" d -SEARCH bmore.h 90;" d -SEARCH bvi.h 104;" d -SKIP_WHITE bvi.h 136;" d -STAR bmore.h 81;" d -STAR bvi.h 72;" d +PRINTF bmore.c 42;" d file: +PTR bmore.h 109;" d +PTR bmore.h 115;" d +PTR bvi.h 131;" d +PTR bvi.h 139;" d +P_AW set.h 55;" d +P_BOOL set.h 43;" d +P_CHANGED set.h 46;" d +P_CM set.h 56;" d +P_CO set.h 73;" d +P_EB set.h 57;" d +P_HL set.h 71;" d +P_IC set.h 58;" d +P_LI set.h 68;" d +P_MA set.h 59;" d +P_MM set.h 60;" d +P_MO set.h 64;" d +P_NUM set.h 44;" d +P_OF set.h 61;" d +P_RE set.h 72;" d +P_RO set.h 62;" d +P_SS set.h 63;" d +P_TE set.h 66;" d +P_TEXT set.h 45;" d +P_TT set.h 65;" d +P_US set.h 67;" d +P_WL set.h 69;" d +P_WS set.h 70;" d +REGULAR bmore.h 75;" d +REGULAR bvi.h 72;" d +REPLACE bmore.h 95;" d +RROTATE bvi.h 99;" d +RSHIFT bvi.h 97;" d +SEARCH bmore.h 94;" d +SEARCH bvi.h 114;" d +SKIP_WHITE bvi.h 146;" d +STAR bmore.h 85;" d +STAR bvi.h 82;" d STDC_HEADERS dosconf.h 28;" d -S_GLOBAL bvi.h 83;" d -S_ISBLK bvi.h 198;" d -S_ISCHR bvi.h 197;" d -S_ISDIR bvi.h 196;" d -S_ISFIFO bvi.h 200;" d -S_ISREG bvi.h 199;" d +S_GLOBAL bvi.h 93;" d +S_ISBLK bvi.h 210;" d +S_ISCHR bvi.h 209;" d +S_ISDIR bvi.h 208;" d +S_ISFIFO bvi.h 212;" d +S_ISREG bvi.h 211;" d TBUFSIZ bm_dos.c 32;" d file: -TBUFSIZ bm_unix.c 32;" d file: -TRUE bmore.h 99;" d -TRUE bvi.h 115;" d +TBUFSIZ bm_unix.c 34;" d file: +TRUE bmore.h 103;" d +TRUE bvi.h 125;" d TRUE doscur.h 28;" d -U_APPEND bvi.h 80;" d -U_BACK bvi.h 79;" d -U_DELETE bvi.h 78;" d -U_EDIT bvi.h 75;" d -U_INSERT bvi.h 77;" d -U_TILDE bvi.h 81;" d -U_TRUNC bvi.h 76;" d +U_APPEND bvi.h 90;" d +U_BACK bvi.h 89;" d +U_DELETE bvi.h 88;" d +U_EDIT bvi.h 85;" d +U_INSERT bvi.h 87;" d +U_TILDE bvi.h 91;" d +U_TRUNC bvi.h 86;" d VERSION patchlevel.h 1;" d WINDOW doscur.h 60;" d -WRITE comm.c 50;" d file: -WRITE comm.c 53;" d file: -XOR bvi.h 92;" d +WRITE comm.c 52;" d file: +WRITE comm.c 55;" d file: +XOR bvi.h 102;" d _block_datum bvi.h /^typedef enum _block_datum {$/;" g act_pat re.c /^char act_pat[MAXCMD]; \/* found pattern *\/$/;" v addch doscur.h 95;" d addfile dosio.c /^addfile(char *fname)$/;" f -addfile io.c /^addfile(fname)$/;" f +addfile io.c /^addfile(char *fname)$/;" f addr_flag comm.c /^int addr_flag;$/;" v addr_form bmore.c /^char addr_form[15];$/;" v addr_form bvi.c /^char addr_form[15];$/;" v addstr doscur.h 99;" d again recomp.c /^int again = 0;$/;" v alloc_buf dosio.c /^alloc_buf(off_t n, char **buffer)$/;" f -alloc_buf io.c /^alloc_buf(n, buffer)$/;" f +alloc_buf io.c /^alloc_buf(off_t n, char **buffer)$/;" f altfile comm.c /^static char *altfile = NULL; \/* alternate file *\/$/;" v file: -ambigous comm.c /^char *ambigous = "Ambigous|Too many file names";$/;" v -ambvalue comm.c /^char *ambvalue = "Ambigous|Too many values";$/;" v +ambigous comm.c /^char *ambigous = "Ambiguous|Too many file names";$/;" v +ambvalue comm.c /^char *ambvalue = "Ambiguous|Too many values";$/;" v arrnum bmore.c /^int arrnum = 0;$/;" v -arrnum bvi.c /^int arrnum = 0;$/;" v -ascii_comp recomp.c /^ascii_comp(smem, pattern)$/;" f +arrnum bvi.c /^int arrnum = 0;$/;" v +ascii_comp recomp.c /^ascii_comp(char *smem, char *pattern)$/;" f ascii_flag bmore.c /^int ascii_flag = 0;$/;" v attrset dosio.c /^attrset(int attr)$/;" f -backsearch re.c /^backsearch(start, mode)$/;" f +backsearch re.c /^backsearch(PTR start, char mode)$/;" f beep doscur.h 76;" d block_begin bvi.c /^off_t block_begin, block_end, block_size;$/;" v block_datum bvi.h /^} block_datum;$/;" t typeref:enum:_block_datum block_end bvi.c /^off_t block_begin, block_end, block_size;$/;" v -block_flag bvi.c /^int block_flag = 0;$/;" v +block_flag bvi.c /^int block_flag = 0;$/;" v block_read io.c /^static off_t block_read;$/;" v file: block_size bvi.c /^off_t block_begin, block_end, block_size;$/;" v bmbeep bmore.c /^bmbeep() {$/;" f bmore_search_pat bmore.c /^char bmore_search_pat[BUFFER]; \/* \/ or ? command *\/$/;" v -bmregexec bmore.c /^bmregexec(scan)$/;" f -bmsearch bmore.c /^bmsearch(ch)$/;" f -bregexec re.c /^bregexec(start, scan)$/;" f +bmregexec bmore.c /^bmregexec(char *scan)$/;" f +bmsearch bmore.c /^bmsearch(int ch)$/;" f +bregexec re.c /^bregexec(PTR start, char *scan)$/;" f buf comm.c /^static struct stat buf;$/;" v typeref:struct:stat file: buf dosio.c /^static struct stat buf;$/;" v typeref:struct:stat file: buf io.c /^static struct stat buf;$/;" v typeref:struct:stat file: @@ -226,15 +227,15 @@ buf set.c /^static char buf[MAXCMD+1];$/;" v file: buffer1 bmore.c /^char buffer1[MAXCMD], buffer2[MAXCMD];$/;" v buffer2 bmore.c /^char buffer1[MAXCMD], buffer2[MAXCMD];$/;" v bvi_init dosio.c /^bvi_init(char *dir)$/;" f -bvi_init io.c /^bvi_init(dir)$/;" f +bvi_init io.c /^bvi_init(char *dir)$/;" f bytepos bmore.c /^off_t bytepos, oldpos;$/;" v c_argc comm.c /^static int c_argc = 0;$/;" v file: c_argv comm.c /^static char *c_argv[9];$/;" v file: c_flag bmore.c /^int c_flag = 0, d_flag = 0, r_flag = 0;$/;" v -calc_addr re.c /^calc_addr(pointer, def_addr)$/;" f -calc_size bvi.c /^calc_size(arg)$/;" f +calc_addr re.c /^calc_addr(char **pointer, PTR def_addr)$/;" f +calc_size bvi.c /^calc_size(char *arg)$/;" f cbreak doscur.h 136;" d -chk_comm comm.c /^chk_comm(flag)$/;" f +chk_comm comm.c /^chk_comm(int flag)$/;" f chtype doscur.h 58;" d clear doscur.h 83;" d clear_marks edit.c /^clear_marks()$/;" f @@ -245,21 +246,21 @@ clearstr comm.c /^clearstr()$/;" f cleartoeol bm_dos.c /^cleartoeol()$/;" f cleartoeol bm_unix.c /^cleartoeol()$/;" f clrtoeol doscur.h 79;" d -cmdbuf bmore.c /^static char cmdbuf[MAXCMD];$/;" v file: +cmdbuf bmore.c /^static char cmdbuf[2 * MAXCMD];$/;" v file: cmdstr bvi.c /^char cmdstr[MAXCMD+1] = "";$/;" v cnt bmore.c /^static int cnt = 0;$/;" v file: contrd edit.c /^char contrd[][4] = {"NUL", " ^A", " ^B", " ^C", " ^D", " ^E", " ^F", "BEL",$/;" v contru edit.c /^char contru[][4] = {"NUL", "SOH", "STX", "ETX", "EOT", "ENQ", "ACK", "BEL",$/;" v -copyright bmore.c /^char *copyright = "GPL (C) 1990-2019 by Gerhard Buergmann";$/;" v -copyright bvi.c /^char *copyright = "(C) GPL 1996-2019 by Gerhard Buergmann";$/;" v +copyright bmore.c /^char *copyright = "GPL (C) 1990-2022 by Gerhard Buergmann";$/;" v +copyright bvi.c /^char *copyright = "(C) GPL 1996-2025 by Gerhard Buergmann";$/;" v corr bmore.c /^int corr = 0, do_header = 0, to_print;$/;" v cur_back edit.c /^cur_back()$/;" f -cur_forw edit.c /^cur_forw(check)$/;" f -curfile bvi.c /^int curfile; \/* number of the current file *\/$/;" v -curpos bvi.c /^PTR curpos;$/;" v +cur_forw edit.c /^cur_forw(int check)$/;" f +curfile bvi.c /^int curfile; \/* number of the current file *\/$/;" v +curpos bvi.c /^PTR curpos;$/;" v curr_file bmore.c /^FILE *curr_file = NULL, *help_file;$/;" v -current bvi.c /^PTR current;$/;" v -current_start bvi.c /^PTR current_start;$/;" v +current bvi.c /^PTR current;$/;" v +current_start bvi.c /^PTR current_start;$/;" v d_flag bmore.c /^int c_flag = 0, d_flag = 0, r_flag = 0;$/;" v d_memcpy dosio.c /^d_memcpy(PTR dest, PTR src, off_t n)$/;" f d_memmove dosio.c /^d_memmove(PTR dest, PTR src, off_t n)$/;" f @@ -267,44 +268,44 @@ dbug bm_dos.c /^FILE *dbug;$/;" v delch dosio.c /^delch()$/;" f deleteln doscur.h 110;" d dlines bm_unix.c /^int dum_opt, dlines;$/;" v -do_append bvi.c /^do_append(count, buf)$/;" f -do_back edit.c /^do_back(n, start)$/;" f -do_delete edit.c /^do_delete(n, start)$/;" f +do_append bvi.c /^do_append(off_t count, char *buf)$/;" f +do_back edit.c /^do_back(off_t n, PTR start)$/;" f +do_delete edit.c /^do_delete(off_t n, PTR start)$/;" f do_exit comm.c /^do_exit()$/;" f -do_ft edit.c /^do_ft(ch, flag)$/;" f +do_ft edit.c /^do_ft(int ch, int flag)$/;" f do_header bmore.c /^int corr = 0, do_header = 0, to_print;$/;" v -do_ins_chg edit.c /^do_ins_chg(start, arg, mode)$/;" f -do_logic set.c /^do_logic(mode, str)$/;" f -do_mark edit.c /^do_mark(mark, addr)$/;" f -do_next bmore.c /^do_next(n)$/;" f -do_over bvi.c /^do_over(loc, n, buf)$/;" f -do_put bvi.c /^do_put(loc, n, buf)$/;" f +do_ins_chg edit.c /^do_ins_chg(PTR start, char *arg, int mode)$/;" f +do_logic set.c /^do_logic(int mode, char *str)$/;" f +do_mark edit.c /^do_mark(int mark, PTR addr)$/;" f +do_next bmore.c /^do_next(int n)$/;" f +do_over bvi.c /^do_over(PTR loc, off_t n, PTR buf)$/;" f +do_put bvi.c /^do_put(PTR loc, off_t n, PTR buf)$/;" f do_shell dosio.c /^do_shell()$/;" f do_shell io.c /^do_shell()$/;" f -do_substitution re.c /^do_substitution(delim, line, startpos, endpos)$/;" f -do_tilde bvi.c /^do_tilde(count)$/;" f +do_substitution re.c /^do_substitution(int delim, char *line, PTR startpos, PTR endpos)$/;" f +do_tilde bvi.c /^do_tilde(off_t count)$/;" f do_undo bvi.c /^do_undo()$/;" f -do_z edit.c /^do_z(mode)$/;" f -docmdline comm.c /^docmdline(cmdline)$/;" f -doecmd comm.c /^doecmd(arg, force)$/;" f -doset set.c /^doset(arg)$/;" f +do_z edit.c /^do_z(int mode)$/;" f +docmdline comm.c /^docmdline(char *cmdline)$/;" f +doecmd comm.c /^doecmd(char *arg, int force)$/;" f +doset set.c /^doset(char *arg)$/;" f doshell bm_dos.c /^doshell(cmd)$/;" f -doshell bm_unix.c /^doshell(cmd)$/;" f +doshell bm_unix.c /^doshell(char *cmd)$/;" f doupdate doscur.h 143;" d dum_opt bm_unix.c /^int dum_opt, dlines;$/;" v dup_print_flag bmore.c /^int dup_print_flag = 0;$/;" v echo doscur.h 128;" d -edit edit.c /^edit(mode)$/;" f -edits bvi.c /^int edits = 0;$/;" v +edit edit.c /^edit(int mode)$/;" f +edits bvi.c /^int edits = 0;$/;" v emptyclass bmore.c /^char *emptyclass = "Empty byte class '[]' or '[^]'";$/;" v emptyclass re.c /^char *emptyclass = "Bad character class|Empty byte class '[]' or '[^]' cannot match";$/;" v -emsg bmore.c /^emsg(s)$/;" f -emsg comm.c /^emsg(s)$/;" f +emsg bmore.c /^emsg(char *s)$/;" f +emsg comm.c /^emsg(char *s)$/;" f end_addr comm.c /^PTR end_addr;$/;" v -end_word re.c /^end_word(start)$/;" f +end_word re.c /^end_word(PTR start)$/;" f endwin doscur.h 137;" d enlarge dosio.c /^enlarge(off_t add)$/;" f -enlarge io.c /^enlarge(add)$/;" f +enlarge io.c /^enlarge(off_t add)$/;" f env bvi.c /^jmp_buf env; \/* context for `longjmp' function *\/$/;" v erase doscur.h 81;" d erase_ln bm_unix.c /^char *erase_ln; \/* erase line *\/$/;" v @@ -315,26 +316,26 @@ exval bmore.c /^int exval = 0;$/;" v fbuf set.c /^static char fbuf[MAXCMD+1];$/;" v file: ffp set.c /^static FILE *ffp;$/;" v file: file_nr bmore.c /^int file_nr = 0; \/* number of current input file *\/$/;" v -fileinfo edit.c /^fileinfo(fname)$/;" f +fileinfo edit.c /^fileinfo(char *fname)$/;" f filemode dosio.c /^int filemode;$/;" v filemode io.c /^int filemode;$/;" v files bmore.c /^char **files; \/* list of input files *\/$/;" v files bvi.c /^char **files; \/* list of input files *\/$/;" v filesize bmore.c /^off_t screen_home, filesize;$/;" v filesize bvi.c /^off_t filesize, memsize, undosize;$/;" v -flags set.h /^ int flags;$/;" m struct:param +flags set.h /^ int flags;$/;" m struct:param flash doscur.h 77;" d flushinp doscur.h 120;" d fname_buf bvi.c /^char *fname_buf = NULL;$/;" v fnum bm_unix.c /^int fnum, no_intty, no_tty, slow_tty;$/;" v -from_file set.c /^static int from_file = 0;$/;" v file: -fsearch re.c /^fsearch(start, end, smem)$/;" f -fsearch_end re.c /^fsearch_end(start, end, smem, s_end)$/;" f +from_file set.c /^static int from_file = 0;$/;" v file: +fsearch re.c /^fsearch(PTR start, PTR end, char *smem)$/;" f +fsearch_end re.c /^fsearch_end(PTR start, PTR end, char *smem, PTR *s_end)$/;" f fullname set.h /^ char *fullname; \/* full parameter name *\/$/;" m struct:param getbegyx doscur.h 105;" d getcbuff edit.c /^static char getcbuff[BUFFER];$/;" v file: getch dosio.c /^getch()$/;" f -getcmdstr set.c /^getcmdstr(p, x)$/;" f +getcmdstr set.c /^getcmdstr(char *p, int x)$/;" f getcnext edit.c /^static char *getcnext = NULL;$/;" v file: getmaxyx doscur.h 106;" d getyx doscur.h 104;" d @@ -342,7 +343,7 @@ got_int bm_dos.c /^int got_int;$/;" v got_int bm_unix.c /^int got_int;$/;" v help_file bmore.c /^FILE *curr_file = NULL, *help_file;$/;" v helppath bmore.c /^char helppath[MAXCMD];$/;" v -hex_comp recomp.c /^hex_comp(smem, pattern)$/;" f +hex_comp recomp.c /^hex_comp(char *smem, char *pattern)$/;" f hexchar recomp.c /^hexchar()$/;" f highlight bm_dos.c /^highlight()$/;" f highlight bm_unix.c /^highlight()$/;" f @@ -360,36 +361,36 @@ initterm bm_dos.c /^initterm()$/;" f initterm bm_unix.c /^initterm()$/;" f insch dosio.c /^insch(int c)$/;" f insertln doscur.h 108;" d -jmpproc bvi.c /^jmpproc(sig)$/;" f +jmpproc bvi.c /^jmpproc(int sig)$/;" f keypad doscur.h 133;" d -last_motion bvi.c /^PTR last_motion;$/;" v +last_motion bvi.c /^PTR last_motion;$/;" v last_search bmore.c /^off_t last_search = 0;$/;" v linbuf edit.c /^char linbuf[16384];$/;" v line bvi.c /^static char line[MAXCMD+1];$/;" v file: lineout edit.c /^lineout()$/;" f load dosio.c /^load(char *fname)$/;" f -load io.c /^load(fname)$/;" f -loc bvi.c /^int loc;$/;" v +load io.c /^load(char *fname)$/;" f +loc bvi.c /^int loc;$/;" v magic recomp.c /^int magic = 1;$/;" v -main bmore.c /^main(argc, argv)$/;" f -main bvi.c /^main(argc, argv)$/;" f -mark bvi.c /^static int mark;$/;" v file: -markbuf bvi.c /^PTR markbuf[26];$/;" v -maxpos bvi.c /^PTR maxpos;$/;" v +main bmore.c /^main(int argc, char *argv[])$/;" f +main bvi.c /^main(int argc, char *argv[])$/;" f +mark bvi.c /^static int mark;$/;" v file: +markbuf bvi.c /^PTR markbuf[26];$/;" v +maxpos bvi.c /^PTR maxpos;$/;" v maxx bmore.c /^int maxx, maxy;$/;" v -maxx bvi.c /^int maxx, maxy, x, xx, y;$/;" v +maxx bvi.c /^int maxx, maxy, x, xx, y;$/;" v maxy bmore.c /^int maxx, maxy;$/;" v -maxy bvi.c /^int maxx, maxy, x, xx, y;$/;" v -mem bvi.c /^PTR mem = NULL;$/;" v -memcpy bvi.h 126;" d -memmove bm_unix.c /^memmove(s1, s2, n)$/;" f -memmove bvi.h 127;" d -memmove io.c /^memmove(s1, s2, n)$/;" f +maxy bvi.c /^int maxx, maxy, x, xx, y;$/;" v +mem bvi.c /^PTR mem = NULL;$/;" v +memcpy bvi.h 136;" d +memmove bm_unix.c /^memmove(char *s1, char *s2, size_t n)$/;" f +memmove bvi.h 137;" d +memmove io.c /^memmove(char *s1, char *s2, size_t n)$/;" f memsize bvi.c /^off_t filesize, memsize, undosize;$/;" v morefiles comm.c /^char *morefiles = "more files@to edit";$/;" v move doscur.h 91;" d movebyte edit.c /^movebyte()$/;" f -msg comm.c /^msg(s)$/;" f +msg comm.c /^msg(char *s)$/;" f mvaddch doscur.h 93;" d mvaddstr doscur.h 97;" d mvgetch doscur.h 112;" d @@ -433,40 +434,41 @@ nstate bm_unix.c /^struct termios ostate, nstate;$/;" v typeref:struct: numarr bmore.c /^char numarr[64]; \/* string for collecting number *\/$/;" v numarr bvi.c /^char numarr[MAXCMD+1]; \/* string for collecting number *\/$/;" v numfiles bmore.c /^int numfiles; \/* number of input files *\/$/;" v -numfiles bvi.c /^int numfiles; \/* number of input files *\/$/;" v +numfiles bvi.c /^int numfiles; \/* number of input files *\/$/;" v nvalue set.h /^ off_t nvalue;$/;" m struct:param -off_t bmore.h 106;" d -off_t bvi.h 122;" d -oldbuf comm.c /^static char oldbuf[CMDSZ]; \/** for :!! command **\/$/;" v file: +off_t bmore.h 110;" d +off_t bvi.h 132;" d +oldbuf comm.c /^static char oldbuf[CMDSZ + 3]; \/** for :!! command **\/$/;" v file: oldpos bmore.c /^off_t bytepos, oldpos;$/;" v -open_file bmore.c /^open_file(name)$/;" f +open_file bmore.c /^open_file(char *name)$/;" f ostate bm_unix.c /^struct termios ostate, nstate;$/;" v typeref:struct:termios out_len bmore.c /^int out_len;$/;" v -outmsg comm.c /^outmsg(s)$/;" f -pagepos bvi.c /^PTR pagepos;$/;" v +outmsg comm.c /^outmsg(char *s)$/;" f +pagepos bvi.c /^PTR pagepos;$/;" v param set.h /^struct param {$/;" s params set.c /^struct param params[] = {$/;" v typeref:struct:param -patcpy re.c /^patcpy(s1, s2, delim)$/;" f +patcpy re.c /^patcpy(char *s1, char *s2, char delim)$/;" f pattern re.c /^char pattern[MAXCMD + 1];$/;" v poi recomp.c /^char *poi;$/;" v precount bmore.c /^long precount = -1; \/* number preceding command *\/$/;" v precount bvi.c /^long precount = -1;$/;" v -printline edit.c /^printline(mempos, scpos)$/;" f -printout bmore.c /^printout(lns)$/;" f +printline edit.c /^printline(PTR mempos, int scpos)$/;" f +printout bmore.c /^printout(int lns)$/;" f printw doscur.h 103;" d progname bmore.c /^static char progname[10];$/;" v file: progname bvi.c /^static char progname[8];$/;" v file: prompt bmore.c /^int prompt = 1;$/;" v -pushback bmore.c /^pushback(n, where)$/;" f -putchr bm_unix.c /^putchr(ch)$/;" f +pushback bmore.c /^pushback(int n, char *where)$/;" f putchr bm_unix.c /^putchr(char ch)$/;" f -putline bmore.c /^putline(buf, num)$/;" f +putchr bm_unix.c /^putchr(int ch)$/;" f +putline bmore.c /^putline(char *buf, int num)$/;" f quit edit.c /^quit()$/;" f r_flag bmore.c /^int c_flag = 0, d_flag = 0, r_flag = 0;$/;" v -range bvi.c /^range(ch)$/;" f +range bvi.c /^range(int ch)$/;" f raw doscur.h 138;" d -rdline bmore.c /^rdline(ch, sstring)$/;" f -read_rc set.c /^read_rc(fn)$/;" f +rdline bmore.c /^rdline(int ch, char *sstring)$/;" f +read_rc set.c /^read_rc(char *fn)$/;" f +read_to_end io.c /^read_to_end(int fd, void *buf, size_t count) {$/;" f file: refresh doscur.h 134;" d rep_buf bvi.c /^char rep_buf[BUFFER];$/;" v repaint edit.c /^repaint() \/***** redraw screen *********************\/$/;" f @@ -476,56 +478,58 @@ reset_tty bm_unix.c /^reset_tty()$/;" f resetty doscur.h 145;" d rev_end bm_unix.c /^char *rev_start, *rev_end; \/* enter and exit standout mode *\/$/;" v rev_start bm_unix.c /^char *rev_start, *rev_end; \/* enter and exit standout mode *\/$/;" v -rsearch re.c /^rsearch(start, end, smem)$/;" f +rsearch re.c /^rsearch(PTR start, PTR end, char *smem)$/;" f save dosio.c /^save(char *fname, PTR start, PTR end, int flags)$/;" f -save io.c /^save(fname, start, end, flags)$/;" f -save_chk comm.c /^save_chk(fname, start, end, flags)$/;" f +save io.c /^save(char *fname, char *start, char *end, int flags)$/;" f +save_chk comm.c /^save_chk(char *fname, char *start, char *end, int flags)$/;" f savetty doscur.h 144;" d -sbracket bmore.c /^sbracket(start, scan, count)$/;" f -sbracket re.c /^sbracket(start, scan, count)$/;" f file: +sbracket bmore.c /^sbracket(int start, char *scan, int count)$/;" f +sbracket re.c /^sbracket(int start, char *scan, int count)$/;" f file: scanw doscur.h 124;" d scr dosio.c /^struct WINDOW scr;$/;" v typeref:struct:WINDOW -screen bvi.c /^int screen, status, statsize;$/;" v +screen bvi.c /^int screen, status, statsize;$/;" v screen_home bmore.c /^off_t screen_home, filesize;$/;" v -scrolldown edit.c /^scrolldown(lns)$/;" f +scrolldown edit.c /^scrolldown(int lns)$/;" f scrollok doscur.h 142;" d -scrollup edit.c /^scrollup(lns)$/;" f +scrollup edit.c /^scrollup(int lns)$/;" f search_pat re.c /^char search_pat[BUFFER]; \/* \/ or ? command *\/$/;" v -searching re.c /^searching(ch, line, startpos, endpos, flag)$/;" f +searching re.c /^searching(int ch, char *line, PTR startpos, PTR endpos, int flag)$/;" f set_tty bm_dos.c /^set_tty ()$/;" f set_tty bm_unix.c /^set_tty()$/;" f setcur edit.c /^setcur()$/;" f -setpage edit.c /^setpage(addr)$/;" f +setpage edit.c /^setpage(PTR addr)$/;" f shell bvi.c /^char *shell;$/;" v shortname set.h /^ char *shortname; \/* permissible abbreviation *\/$/;" m struct:param -showparms set.c /^showparms(all)$/;" f +showparms set.c /^showparms(int all)$/;" f sig bm_dos.c /^sig()$/;" f -sig bm_unix.c /^sig(sig)$/;" f +sig bm_unix.c /^sig(int sig)$/;" f size bvi.c /^off_t size;$/;" v slow_tty bm_unix.c /^int fnum, no_intty, no_tty, slow_tty;$/;" v smode bmore.c /^static int smode;$/;" v file: smode recomp.c /^int smode;$/;" v -smsg comm.c /^smsg(s)$/;" f -spos bvi.c /^PTR spos;$/;" v +smsg comm.c /^smsg(char *s)$/;" f +space bvi.c /^int space = 2;$/;" v +spos bvi.c /^PTR spos;$/;" v sstring bmore.c /^char sstring[MAXCMD] = ""; \/* string for search *\/$/;" v standend doscur.h 89;" d standout doscur.h 88;" d start_addr comm.c /^PTR start_addr;$/;" v statpos edit.c /^statpos()$/;" f -statsize bvi.c /^int screen, status, statsize;$/;" v -status bvi.c /^int screen, status, statsize;$/;" v +statsize bvi.c /^int screen, status, statsize;$/;" v +status bvi.c /^int screen, status, statsize;$/;" v +statusflag bvi.c /^int statusflag = 1;$/;" v stdscr dosio.c /^int stdscr = 0;$/;" v -strcasecmp bmore.h 109;" d -strcasecmp bvi.h 125;" d -strdup io.c /^strdup(s)$/;" f +strcasecmp bmore.h 113;" d +strcasecmp bvi.h 135;" d +strdup io.c /^strdup(char *s)$/;" f string bmore.c /^char string[MAXCMD];$/;" v string bvi.c /^char string[MAXCMD+1];$/;" v -strncasecmp bmore.h 108;" d -strncasecmp bvi.h 124;" d -stty bm_unix.c 34;" d file: -stuffin edit.c /^stuffin(s)$/;" f +strncasecmp bmore.h 112;" d +strncasecmp bvi.h 134;" d +stty bm_unix.c 36;" d file: +stuffin edit.c /^stuffin(char *s)$/;" f svalue set.h /^ char *svalue;$/;" m struct:param -sysemsg comm.c /^sysemsg(s)$/;" f +sysemsg comm.c /^sysemsg(char *s)$/;" f terminal dosio.c /^char *terminal = "ansi";$/;" v terminal io.c /^char *terminal;$/;" v tmpbuf edit.c /^char tmpbuf[10];$/;" v @@ -534,7 +538,7 @@ toggle edit.c /^toggle()$/;" f trunc_cur bvi.c /^trunc_cur()$/;" f undo_buf bvi.c /^char *undo_buf = NULL;$/;" v undo_count bvi.c /^off_t undo_count;$/;" v -undo_start bvi.c /^PTR undo_start;$/;" v +undo_start bvi.c /^PTR undo_start;$/;" v undosize bvi.c /^off_t filesize, memsize, undosize;$/;" v usage bmore.c /^usage()$/;" f usage bvi.c /^usage()$/;" f @@ -543,7 +547,7 @@ vgetc bm_unix.c /^vgetc()$/;" f vgetc edit.c /^vgetc()$/;" f waddch doscur.h 94;" d waddstr doscur.h 98;" d -wait_return comm.c /^wait_return(flag)$/;" f +wait_return comm.c /^wait_return(int flag)$/;" f wclear doscur.h 82;" d wclrtoeol doscur.h 78;" d wdeleteln doscur.h 109;" d @@ -552,15 +556,15 @@ wgetch doscur.h 113;" d wgetstr doscur.h 116;" d winsertln doscur.h 107;" d wmove doscur.h 90;" d -wordsearch re.c /^wordsearch(start, mode)$/;" f +wordsearch re.c /^wordsearch(PTR start, char mode)$/;" f wprintw doscur.h 102;" d wrefresh doscur.h 135;" d -wrstat bvi.c /^static int wrstat = 1;$/;" v file: +wrstat bvi.c /^static int wrstat = 1;$/;" v file: wscanw doscur.h 123;" d -x bvi.c /^int maxx, maxy, x, xx, y;$/;" v +x bvi.c /^int maxx, maxy, x, xx, y;$/;" v xpos edit.c /^xpos()$/;" f -xx bvi.c /^int maxx, maxy, x, xx, y;$/;" v -y bvi.c /^int maxx, maxy, x, xx, y;$/;" v +xx bvi.c /^int maxx, maxy, x, xx, y;$/;" v +y bvi.c /^int maxx, maxy, x, xx, y;$/;" v yank_buf bvi.c /^char *yank_buf = NULL;$/;" v yanked bvi.c /^off_t yanked = 0L;$/;" v yd_addr comm.c /^yd_addr()$/;" f diff --git a/test.txt b/test.txt new file mode 100644 index 0000000..23e1062 --- /dev/null +++ b/test.txt @@ -0,0 +1,209 @@ +AAAAAAAAAAAAAAAAAAAAAAA +BBBBBBBBBBBBBBBBBBBBBBB +CCCCCCCCCCCCCCCCCCCCCCC +DDDDDDDDDDDDDDDDDDDDDDD +EEEEEEEEEEEEEEEEEEEEEEE +FFFFFFFFFFFFFFFFFFFFFFF +GGGGGGGGGGGGGGGGGGGGGGG +HHHHHHHHHHHHHHHHHHHHHHH +IIIIIIIIIIIIIIIIIIIIIII +JJJJJJJJJJJJJJJJJJJJJJJ +KKKKKKKKKKKKKKKKKKKKKKK +LLLLLLLLLLLLLLLLLLLLLLL +MMMMMMMMMMMMMMMMMMMMMMM +NNNNNNNNNNNNNNNNNNNNNNN +OOOOOOOOOOOOOOOOOOOOOOO +PPPPPPPPPPPPPPPPPPPPPPP +QQQQQQQQQQQQQQQQQQQQQQQ +RRRRRRRRRRRRRRRRRRRRRRR +SSSSSSSSSSSSSSSSSSSSSSS +TTTTTTTTTTTTTTTTTTTTTTT +UUUUUUUUUUUUUUUUUUUUUUU +VVVVVVVVVVVVVVVVVVVVVVV +WWWWWWWWWWWWWWWWWWWWWWW +XXXXXXXXXXXXXXXXXXXXXXX +YYYYYYYYYYYYYYYYYYYYYYY +ZZZZZZZZZZZZZZZZZZZZZZZ +aaaaaaaaaaaaaaaaaaaaaaa +bbbbbbbbbbbbbbbbbbbbbbb +ccccccccccccccccccccccc +ddddddddddddddddddddddd +eeeeeeeeeeeeeeeeeeeeeee +fffffffffffffffffffffff +ggggggggggggggggggggggg +hhhhhhhhhhhhhhhhhhhhhhh +iiiiiiiiiiiiiiiiiiiiiii +jjjjjjjjjjjjjjjjjjjjjjj +kkkkkkkkkkkkkkkkkkkkkkk +lllllllllllllllllllllll +mmmmmmmmmmmmmmmmmmmmmmm +nnnnnnnnnnnnnnnnnnnnnnn +ooooooooooooooooooooooo +ppppppppppppppppppppppp +qqqqqqqqqqqqqqqqqqqqqqq +rrrrrrrrrrrrrrrrrrrrrrr +sssssssssssssssssssssss +ttttttttttttttttttttttt +uuuuuuuuuuuuuuuuuuuuuuu +vvvvvvvvvvvvvvvvvvvvvvv +wwwwwwwwwwwwwwwwwwwwwww +xxxxxxxxxxxxxxxxxxxxxxx +AAAAAAAAAAAAAAAAAAAAAAA +BBBBBBBBBBBBBBBBBBBBBBB +CCCCCCCCCCCCCCCCCCCCCCC +DDDDDDDDDDDDDDDDDDDDDDD +EEEEEEEEEEEEEEEEEEEEEEE +FFFFFFFFFFFFFFFFFFFFFFF +GGGGGGGGGGGGGGGGGGGGGGG +HHHHHHHHHHHHHHHHHHHHHHH +IIIIIIIIIIIIIIIIIIIIIII +JJJJJJJJJJJJJJJJJJJJJJJ +KKKKKKKKKKKKKKKKKKKKKKK +LLLLLLLLLLLLLLLLLLLLLLL +MMMMMMMMMMMMMMMMMMMMMMM +NNNNNNNNNNNNNNNNNNNNNNN +OOOOOOOOOOOOOOOOOOOOOOO +PPPPPPPPPPPPPPPPPPPPPPP +QQQQQQQQQQQQQQQQQQQQQQQ +RRRRRRRRRRRRRRRRRRRRRRR +SSSSSSSSSSSSSSSSSSSSSSS +TTTTTTTTTTTTTTTTTTTTTTT +UUUUUUUUUUUUUUUUUUUUUUU +VVVVVVVVVVVVVVVVVVVVVVV +WWWWWWWWWWWWWWWWWWWWWWW +XXXXXXXXXXXXXXXXXXXXXXX +YYYYYYYYYYYYYYYYYYYYYYY +ZZZZZZZZZZZZZZZZZZZZZZZ +aaaaaaaaaaaaaaaaaaaaaaa +bbbbbbbbbbbbbbbbbbbbbbb +ccccccccccccccccccccccc +ddddddddddddddddddddddd +eeeeeeeeeeeeeeeeeeeeeee +fffffffffffffffffffffff +ggggggggggggggggggggggg +hhhhhhhhhhhhhhhhhhhhhhh +iiiiiiiiiiiiiiiiiiiiiii +jjjjjjjjjjjjjjjjjjjjjjj +kkkkkkkkkkkkkkkkkkkkkkk +lllllllllllllllllllllll +mmmmmmmmmmmmmmmmmmmmmmm +nnnnnnnnnnnnnnnnnnnnnnn +ooooooooooooooooooooooo +ppppppppppppppppppppppp +qqqqqqqqqqqqqqqqqqqqqqq +rrrrrrrrrrrrrrrrrrrrrrr +sssssssssssssssssssssss +ttttttttttttttttttttttt +uuuuuuuuuuuuuuuuuuuuuuu +vvvvvvvvvvvvvvvvvvvvvvv +wwwwwwwwwwwwwwwwwwwwwww +xxxxxxxxxxxxxxxxxxxxxxx +yyyyyyyyyyyyyyyyyyyyyyy +zzzzzzzzzzzzzzzzzzzzzzz +yyyyyyyyyyyyyyyyyyyyyyy +AAAAAAAAAAAAAAAAAAAAAAA +BBBBBBBBBBBBBBBBBBBBBBB +CCCCCCCCCCCCCCCCCCCCCCC +DDDDDDDDDDDDDDDDDDDDDDD +EEEEEEEEEEEEEEEEEEEEEEE +FFFFFFFFFFFFFFFFFFFFFFF +GGGGGGGGGGGGGGGGGGGGGGG +HHHHHHHHHHHHHHHHHHHHHHH +IIIIIIIIIIIIIIIIIIIIIII +JJJJJJJJJJJJJJJJJJJJJJJ +KKKKKKKKKKKKKKKKKKKKKKK +LLLLLLLLLLLLLLLLLLLLLLL +MMMMMMMMMMMMMMMMMMMMMMM +NNNNNNNNNNNNNNNNNNNNNNN +OOOOOOOOOOOOOOOOOOOOOOO +PPPPPPPPPPPPPPPPPPPPPPP +QQQQQQQQQQQQQQQQQQQQQQQ +RRRRRRRRRRRRRRRRRRRRRRR +SSSSSSSSSSSSSSSSSSSSSSS +TTTTTTTTTTTTTTTTTTTTTTT +UUUUUUUUUUUUUUUUUUUUUUU +VVVVVVVVVVVVVVVVVVVVVVV +WWWWWWWWWWWWWWWWWWWWWWW +XXXXXXXXXXXXXXXXXXXXXXX +YYYYYYYYYYYYYYYYYYYYYYY +ZZZZZZZZZZZZZZZZZZZZZZZ +aaaaaaaaaaaaaaaaaaaaaaa +bbbbbbbbbbbbbbbbbbbbbbb +ccccccccccccccccccccccc +ddddddddddddddddddddddd +eeeeeeeeeeeeeeeeeeeeeee +fffffffffffffffffffffff +ggggggggggggggggggggggg +hhhhhhhhhhhhhhhhhhhhhhh +iiiiiiiiiiiiiiiiiiiiiii +jjjjjjjjjjjjjjjjjjjjjjj +kkkkkkkkkkkkkkkkkkkkkkk +lllllllllllllllllllllll +mmmmmmmmmmmmmmmmmmmmmmm +nnnnnnnnnnnnnnnnnnnnnnn +ooooooooooooooooooooooo +ppppppppppppppppppppppp +qqqqqqqqqqqqqqqqqqqqqqq +rrrrrrrrrrrrrrrrrrrrrrr +sssssssssssssssssssssss +ttttttttttttttttttttttt +uuuuuuuuuuuuuuuuuuuuuuu +vvvvvvvvvvvvvvvvvvvvvvv +wwwwwwwwwwwwwwwwwwwwwww +xxxxxxxxxxxxxxxxxxxxxxx +yyyyyyyyyyyyyyyyyyyyyyy +zzzzzzzzzzzzzzzzzzzzzzz +zzzzzzzzzzzzzzzzzzzzzzz +AAAAAAAAAAAAAAAAAAAAAAA +BBBBBBBBBBBBBBBBBBBBBBB +CCCCCCCCCCCCCCCCCCCCCCC +DDDDDDDDDDDDDDDDDDDDDDD +EEEEEEEEEEEEEEEEEEEEEEE +FFFFFFFFFFFFFFFFFFFFFFF +GGGGGGGGGGGGGGGGGGGGGGG +HHHHHHHHHHHHHHHHHHHHHHH +IIIIIIIIIIIIIIIIIIIIIII +JJJJJJJJJJJJJJJJJJJJJJJ +KKKKKKKKKKKKKKKKKKKKKKK +LLLLLLLLLLLLLLLLLLLLLLL +MMMMMMMMMMMMMMMMMMMMMMM +NNNNNNNNNNNNNNNNNNNNNNN +OOOOOOOOOOOOOOOOOOOOOOO +PPPPPPPPPPPPPPPPPPPPPPP +QQQQQQQQQQQQQQQQQQQQQQQ +RRRRRRRRRRRRRRRRRRRRRRR +SSSSSSSSSSSSSSSSSSSSSSS +TTTTTTTTTTTTTTTTTTTTTTT +UUUUUUUUUUUUUUUUUUUUUUU +VVVVVVVVVVVVVVVVVVVVVVV +WWWWWWWWWWWWWWWWWWWWWWW +XXXXXXXXXXXXXXXXXXXXXXX +YYYYYYYYYYYYYYYYYYYYYYY +ZZZZZZZZZZZZZZZZZZZZZZZ +aaaaaaaaaaaaaaaaaaaaaaa +bbbbbbbbbbbbbbbbbbbbbbb +ccccccccccccccccccccccc +ddddddddddddddddddddddd +eeeeeeeeeeeeeeeeeeeeeee +fffffffffffffffffffffff +ggggggggggggggggggggggg +hhhhhhhhhhhhhhhhhhhhhhh +iiiiiiiiiiiiiiiiiiiiiii +jjjjjjjjjjjjjjjjjjjjjjj +kkkkkkkkkkkkkkkkkkkkkkk +lllllllllllllllllllllll +mmmmmmmmmmmmmmmmmmmmmmm +nnnnnnnnnnnnnnnnnnnnnnn +ooooooooooooooooooooooo +ppppppppppppppppppppppp +qqqqqqqqqqqqqqqqqqqqqqq +rrrrrrrrrrrrrrrrrrrrrrr +sssssssssssssssssssssss +ttttttttttttttttttttttt +uuuuuuuuuuuuuuuuuuuuuuu +vvvvvvvvvvvvvvvvvvvvvvv +wwwwwwwwwwwwwwwwwwwwwww +xxxxxxxxxxxxxxxxxxxxxxx +yyyyyyyyyyyyyyyyyyyyyyy +zzzzzzzzzzzzzzzzzzzzzzz + diff --git a/tmp b/tmp deleted file mode 100644 index 4083215..0000000 --- a/tmp +++ /dev/null @@ -1,15 +0,0 @@ - if ((ch > 31) && (ch < 127)) { - PRINTF("%c", ch); - } else { - if (r_flag) { - if ((ch & 128) && ((ch > 159) && (ch < 255))) { - if (!no_tty) highlight(); - PRINTF("%c", ch & 127); - if (!no_tty) normal(); - } else { - PRINTF("."); - } - } else { - PRINTF("."); - } - }