setserial-2.17/0040755003667600000000000000000007044064531012376 5ustar tytsorootsetserial-2.17/setserial.c0100600003667600366760000005157407044063404014767 0ustar tytsotytso/* setserial.c - get/set Linux serial port info - rick sladkey */ /* modified to do work again and added setting fast serial speeds, Michael K. Johnson, johnsonm@stolaf.edu */ /* * Very heavily modified --- almost rewritten from scratch --- to have * a more flexible command structure. Now able to set any of the * serial-specific options using the TIOCSSERIAL ioctl(). * Theodore Ts'o, tytso@mit.edu, 1/1/93 * * Last modified: [tytso:19940520.0036EDT] */ #include #include #include #include #include #ifdef HAVE_ASM_IOCTLS_H #include #endif #ifdef HAVE_LINUX_HAYESESP_H #include #endif #include #include "version.h" static char version_str[] = "setserial version " SETSERIAL_VERSION ", " SETSERIAL_DATE; char *progname; int verbosity = 1; /* 1 = normal, 0=boot-time, 2=everything */ /* -1 == arguments to setserial */ int verbose_flag = 0; /* print results after setting a port */ int quiet_flag = 0; int zero_flag = 0; struct serial_type_struct { int id; char *name; } serial_type_tbl[] = { PORT_UNKNOWN, "unknown", PORT_8250, "8250", PORT_16450, "16450", PORT_16550, "16550", PORT_16550A, "16550A", PORT_CIRRUS, "Cirrus", PORT_16650, "16650", PORT_16650V2, "16650V2", PORT_16750, "16750", PORT_16C950, "16950/954", PORT_16C950, "16950", PORT_16C950, "16954", PORT_16654, "16654", PORT_16850, "16850", PORT_UNKNOWN, "none", -1, NULL }; #define CMD_FLAG 1 #define CMD_PORT 2 #define CMD_IRQ 3 #define CMD_DIVISOR 4 #define CMD_TYPE 5 #define CMD_BASE 6 #define CMD_DELAY 7 #define CMD_WAIT 8 #define CMD_WAIT2 9 #define CMD_CONFIG 10 #define CMD_GETMULTI 11 #define CMD_SETMULTI 12 #define CMD_RX_TRIG 13 #define CMD_TX_TRIG 14 #define CMD_FLOW_OFF 15 #define CMD_FLOW_ON 16 #define CMD_RX_TMOUT 17 #define CMD_DMA_CHAN 18 #define FLAG_CAN_INVERT 0x0001 #define FLAG_NEED_ARG 0x0002 struct flag_type_table { int cmd; char *name; int bits; int mask; int level; int flags; } flag_type_tbl[] = { CMD_FLAG, "spd_normal", 0, ASYNC_SPD_MASK, 2, 0, CMD_FLAG, "spd_hi", ASYNC_SPD_HI, ASYNC_SPD_MASK, 0, 0, CMD_FLAG, "spd_vhi", ASYNC_SPD_VHI, ASYNC_SPD_MASK, 0, 0, CMD_FLAG, "spd_shi", ASYNC_SPD_SHI, ASYNC_SPD_MASK, 0, 0, CMD_FLAG, "spd_warp", ASYNC_SPD_WARP, ASYNC_SPD_MASK, 0, 0, CMD_FLAG, "spd_cust", ASYNC_SPD_CUST, ASYNC_SPD_MASK, 0, 0, CMD_FLAG, "SAK", ASYNC_SAK, ASYNC_SAK, 0, FLAG_CAN_INVERT, CMD_FLAG, "Fourport", ASYNC_FOURPORT, ASYNC_FOURPORT, 0, FLAG_CAN_INVERT, CMD_FLAG, "hup_notify", ASYNC_HUP_NOTIFY, ASYNC_HUP_NOTIFY, 0, FLAG_CAN_INVERT, CMD_FLAG, "skip_test", ASYNC_SKIP_TEST,ASYNC_SKIP_TEST,2, FLAG_CAN_INVERT, CMD_FLAG, "auto_irq", ASYNC_AUTO_IRQ, ASYNC_AUTO_IRQ, 2, FLAG_CAN_INVERT, CMD_FLAG, "split_termios", ASYNC_SPLIT_TERMIOS, ASYNC_SPLIT_TERMIOS, 2, FLAG_CAN_INVERT, CMD_FLAG, "session_lockout", ASYNC_SESSION_LOCKOUT, ASYNC_SESSION_LOCKOUT, 2, FLAG_CAN_INVERT, CMD_FLAG, "pgrp_lockout", ASYNC_PGRP_LOCKOUT, ASYNC_PGRP_LOCKOUT, 2, FLAG_CAN_INVERT, CMD_FLAG, "callout_nohup", ASYNC_CALLOUT_NOHUP, ASYNC_CALLOUT_NOHUP, 2, FLAG_CAN_INVERT, CMD_FLAG, "low_latency", ASYNC_LOW_LATENCY, ASYNC_LOW_LATENCY, 0, FLAG_CAN_INVERT, CMD_PORT, "port", 0, 0, 0, FLAG_NEED_ARG, CMD_IRQ, "irq", 0, 0, 0, FLAG_NEED_ARG, CMD_DIVISOR, "divisor", 0, 0, 0, FLAG_NEED_ARG, CMD_TYPE, "uart", 0, 0, 0, FLAG_NEED_ARG, CMD_BASE, "base", 0, 0, 0, FLAG_NEED_ARG, CMD_BASE, "baud_base", 0, 0, 0, FLAG_NEED_ARG, CMD_DELAY, "close_delay", 0, 0, 0, FLAG_NEED_ARG, CMD_WAIT, "closing_wait", 0, 0, 0, FLAG_NEED_ARG, CMD_CONFIG, "autoconfig", 0, 0, 0, 0, CMD_CONFIG, "autoconfigure",0, 0, 0, 0, CMD_GETMULTI, "get_multiport",0, 0, 0, 0, CMD_SETMULTI, "set_multiport",0, 0, 0, 0, #ifdef TIOCGHAYESESP CMD_RX_TRIG, "rx_trigger", 0, 0, 0, FLAG_NEED_ARG, CMD_TX_TRIG, "tx_trigger", 0, 0, 0, FLAG_NEED_ARG, CMD_FLOW_OFF, "flow_off", 0, 0, 0, FLAG_NEED_ARG, CMD_FLOW_ON, "flow_on", 0, 0, 0, FLAG_NEED_ARG, CMD_RX_TMOUT, "rx_timeout", 0, 0, 0, FLAG_NEED_ARG, CMD_DMA_CHAN, "dma_channel", 0, 0, 0, FLAG_NEED_ARG, #endif 0, 0, 0, 0, 0, 0, }; char *serial_type(int id) { int i; for (i = 0; serial_type_tbl[i].id != -1; i++) if (id == serial_type_tbl[i].id) return serial_type_tbl[i].name; return "undefined"; } int uart_type(char *name) { int i; for (i = 0; serial_type_tbl[i].id != -1; i++) if (!strcasecmp(name, serial_type_tbl[i].name)) return serial_type_tbl[i].id; return -1; } int atonum(char *s) { int n; while (*s == ' ') s++; if (strncmp(s, "0x", 2) == 0 || strncmp(s, "0X", 2) == 0) sscanf(s + 2, "%x", &n); else if (s[0] == '0' && s[1]) sscanf(s + 1, "%o", &n); else sscanf(s, "%d", &n); return n; } void print_flags(struct serial_struct *serinfo, char *prefix, char *postfix) { struct flag_type_table *p; int flags; int first = 1; flags = serinfo->flags; for (p = flag_type_tbl; p->name; p++) { if (p->cmd != CMD_FLAG) continue; if (verbosity == -1) { if ((flags & p->mask) == p->bits) printf(" %s", p->name); continue; } if (verbosity < p->level) continue; if ((flags & p->mask) == p->bits) { if (first) { printf("%s", prefix); first = 0; } else printf(" "); printf("%s", p->name); } } if (!first) printf("%s", postfix); } #ifdef TIOCSERGETMULTI void print_multiport(char *device, int fd) { struct serial_multiport_struct multi; if (ioctl(fd, TIOCSERGETMULTI, &multi) < 0) return; if (!multi.port1 && !multi.port2 && !multi.port3 && !multi.port4 && !multi.port_monitor) return; printf("%s", device); if (multi.port_monitor) printf(" port_monitor 0x%x", multi.port_monitor); if (multi.port1) printf(" port1 0x%x mask1 0x%x match1 0x%x", multi.port1, multi.mask1, multi.match1); if (multi.port2) printf(" port2 0x%x mask2 0x%x match2 0x%x", multi.port2, multi.mask2, multi.match2); if (multi.port3) printf(" port3 0x%x mask3 0x%x match3 0x%x", multi.port3, multi.mask3, multi.match3); if (multi.port4) printf(" port4 0x%x mask4 0x%x match4 0x%x", multi.port4, multi.mask4, multi.match4); printf("\n"); } void multiport_usage() { fprintf(stderr, "\nValid keywords after set_multiport are:\n"); fprintf(stderr, "\tport_monitor, port[1-4], mask[1-4], " "match[1-4]\n\n"); fprintf(stderr, "All arguments take an numeric argument following " "the keyword.\n"); fprintf(stderr, "Use a leading '0x' for hex numbers.\n\n"); } void get_multiport(char *device, int fd) { struct serial_multiport_struct multi; if (ioctl(fd, TIOCSERGETMULTI, &multi) < 0) { perror("Cannot get multiport config"); exit(1); } printf("Multiport config for irq %d:\n", multi.irq); printf("\tPort monitor = 0x%x\n", multi.port_monitor); printf("\tPort1 = 0x%x, mask=0x%x, match=0x%x\n", multi.port1, multi.mask1, multi.match1); printf("\tPort2 = 0x%x, mask=0x%x, match=0x%x\n", multi.port2, multi.mask2, multi.match2); printf("\tPort3 = 0x%x, mask=0x%x, match=0x%x\n", multi.port3, multi.mask3, multi.match3); printf("\tPort4 = 0x%x, mask=0x%x, match=0x%x\n", multi.port4, multi.mask4, multi.match4); } void set_multiport(char *device, int fd, char ***in_arg) { char **arg = *in_arg; char *word, *argument; struct serial_multiport_struct multi; if (ioctl(fd, TIOCSERGETMULTI, &multi) < 0) { perror("Cannot get multiport config"); exit(1); } if (*arg == 0) { multiport_usage(); return; } while (*arg) { word = *arg++; if (*arg == 0) { multiport_usage(); exit(1); } argument = *arg++; if (strcasecmp(word, "port_monitor") == 0) { multi.port_monitor = atonum(argument); continue; } if (strcasecmp(word, "port1") == 0) { multi.port1 = atonum(argument); continue; } if (strcasecmp(word, "mask1") == 0) { multi.mask1 = atonum(argument); continue; } if (strcasecmp(word, "match1") == 0) { multi.match1 = atonum(argument); continue; } if (strcasecmp(word, "port2") == 0) { multi.port2 = atonum(argument); continue; } if (strcasecmp(word, "mask2") == 0) { multi.mask2 = atonum(argument); continue; } if (strcasecmp(word, "match2") == 0) { multi.match2 = atonum(argument); continue; } if (strcasecmp(word, "port3") == 0) { multi.port3 = atonum(argument); continue; } if (strcasecmp(word, "mask3") == 0) { multi.mask3 = atonum(argument); continue; } if (strcasecmp(word, "match3") == 0) { multi.match3 = atonum(argument); continue; } if (strcasecmp(word, "port4") == 0) { multi.port4 = atonum(argument); continue; } if (strcasecmp(word, "mask4") == 0) { multi.mask4 = atonum(argument); continue; } if (strcasecmp(word, "match4") == 0) { multi.match4 = atonum(argument); continue; } fprintf(stderr, "Unknown keyword %s.\n", word); multiport_usage(); exit(1); } if (ioctl(fd, TIOCSERSETMULTI, &multi) < 0) { perror("Cannot set multiport config"); exit(1); } *in_arg = arg; } #else void get_multiport(char *device, int fd) { printf("Setserial was compiled under a kernel which did not\n"); printf("support the special serial multiport configs.\n"); } void set_multiport(char *device, int fd, char ***in_arg) { printf("Setserial was compiled under a kernel which did not\n"); printf("support the special serial multiport configs.\n"); } #endif #ifdef TIOCGHAYESESP void print_hayesesp(int fd) { struct hayes_esp_config esp; if (ioctl(fd, TIOCGHAYESESP, &esp) < 0) return; printf("\tHayes ESP enhanced mode configuration:\n"); printf("\t\tRX trigger level: %d, TX trigger level: %d\n", (int)esp.rx_trigger, (int)esp.tx_trigger); printf("\t\tFlow off level: %d, Flow on level: %d\n", (int)esp.flow_off, (int)esp.flow_on); printf("\t\tRX timeout: %u, DMA channel: %d\n\n", (unsigned int)esp.rx_timeout, (int)esp.dma_channel); } void set_hayesesp(int fd, int cmd, int arg) { struct hayes_esp_config esp; if (ioctl(fd, TIOCGHAYESESP, &esp) < 0) { printf("\nError: rx_trigger, tx_trigger, flow_off, " "flow_on, rx_timeout, and dma_channel\n" "are only valid for Hayes ESP ports.\n\n"); exit(1); } switch (cmd) { case CMD_RX_TRIG: esp.rx_trigger = arg; break; case CMD_TX_TRIG: esp.tx_trigger = arg; break; case CMD_FLOW_OFF: esp.flow_off = arg; break; case CMD_FLOW_ON: esp.flow_on = arg; break; case CMD_RX_TMOUT: esp.rx_timeout = arg; break; case CMD_DMA_CHAN: esp.dma_channel = arg; break; } if (ioctl(fd, TIOCSHAYESESP, &esp) < 0) { printf("Cannot set Hayes ESP info\n"); exit(1); } } #endif void get_serial(char *device) { struct serial_struct serinfo; int fd; char buf1[40]; if ((fd = open(device, O_RDWR|O_NONBLOCK)) < 0) { perror(device); return; } serinfo.reserved_char[0] = 0; if (ioctl(fd, TIOCGSERIAL, &serinfo) < 0) { perror("Cannot get serial info"); close(fd); return; } if (serinfo.irq == 9) serinfo.irq = 2; /* People understand 2 better than 9 */ if (verbosity==-1) { printf("%s uart %s port 0x%.4x irq %d baud_base %d", device, serial_type(serinfo.type), serinfo.port, serinfo.irq, serinfo.baud_base); print_flags(&serinfo, ", Flags: ", ""); printf("\n"); } else if (verbosity==2) { printf("%s, Line %d, UART: %s, Port: 0x%.4x, IRQ: %d\n", device, serinfo.line, serial_type(serinfo.type), serinfo.port, serinfo.irq); printf("\tBaud_base: %d, close_delay: %d, divisor: %d\n", serinfo.baud_base, serinfo.close_delay, serinfo.custom_divisor); if (serinfo.closing_wait == ASYNC_CLOSING_WAIT_INF) strcpy(buf1, "infinte"); else if (serinfo.closing_wait == ASYNC_CLOSING_WAIT_NONE) strcpy(buf1, "none"); else sprintf(buf1, "%d", serinfo.closing_wait); printf("\tclosing_wait: %s\n", buf1); print_flags(&serinfo, "\tFlags: ", ""); printf("\n\n"); #ifdef TIOCGHAYESESP print_hayesesp(fd); #endif } else if (verbosity==0) { if (serinfo.type) { printf("%s at 0x%.4x (irq = %d) is a %s", device, serinfo.port, serinfo.irq, serial_type(serinfo.type)); print_flags(&serinfo, " (", ")"); printf("\n"); } } else { printf("%s, UART: %s, Port: 0x%.4x, IRQ: %d", device, serial_type(serinfo.type), serinfo.port, serinfo.irq); print_flags(&serinfo, ", Flags: ", ""); printf("\n"); } close(fd); } void set_serial(char *device, char ** arg) { struct serial_struct old_serinfo, new_serinfo; struct flag_type_table *p; int fd; int do_invert = 0; char *word; if ((fd = open(device, O_RDWR|O_NONBLOCK)) < 0) { if (verbosity==0 && errno==ENOENT) exit(201); perror(device); exit(201); } if (ioctl(fd, TIOCGSERIAL, &old_serinfo) < 0) { perror("Cannot get serial info"); exit(1); } new_serinfo = old_serinfo; if (zero_flag) new_serinfo.flags = 0; while (*arg) { do_invert = 0; word = *arg++; if (*word == '^') { do_invert++; word++; } for (p = flag_type_tbl; p->name; p++) { if (!strcasecmp(p->name, word)) break; } if (!p->name) { fprintf(stderr, "Invalid flag: %s\n", word); exit(1); } if (do_invert && !(p->flags & FLAG_CAN_INVERT)) { fprintf(stderr, "This flag can not be inverted: %s\n", word); exit(1); } if ((p->flags & FLAG_NEED_ARG) && !*arg) { fprintf(stderr, "Missing argument for %s\n", word); exit(1); } switch (p->cmd) { case CMD_FLAG: new_serinfo.flags &= ~p->mask; if (!do_invert) new_serinfo.flags |= p->bits; break; case CMD_PORT: new_serinfo.port = atonum(*arg++); break; case CMD_IRQ: new_serinfo.irq = atonum(*arg++); break; case CMD_DIVISOR: new_serinfo.custom_divisor = atonum(*arg++); break; case CMD_TYPE: new_serinfo.type = uart_type(*arg++); if (new_serinfo.type < 0) { fprintf(stderr, "Illegal UART type: %s", *--arg); exit(1); } break; case CMD_BASE: new_serinfo.baud_base = atonum(*arg++); break; case CMD_DELAY: new_serinfo.close_delay = atonum(*arg++); break; case CMD_WAIT: if (!strcasecmp(*arg, "infinite")) new_serinfo.closing_wait = ASYNC_CLOSING_WAIT_INF; else if (!strcasecmp(*arg, "none")) new_serinfo.closing_wait = ASYNC_CLOSING_WAIT_NONE; else new_serinfo.closing_wait = atonum(*arg); arg++; break; case CMD_WAIT2: if (!strcasecmp(*arg, "infinite")) new_serinfo.closing_wait2 = ASYNC_CLOSING_WAIT_INF; else if (!strcasecmp(*arg, "none")) new_serinfo.closing_wait2 = ASYNC_CLOSING_WAIT_NONE; else new_serinfo.closing_wait2 = atonum(*arg); arg++; break; case CMD_CONFIG: if (ioctl(fd, TIOCSSERIAL, &new_serinfo) < 0) { perror("Cannot set serial info"); exit(1); } if (ioctl(fd, TIOCSERCONFIG) < 0) { perror("Cannot autoconfigure port"); exit(1); } if (ioctl(fd, TIOCGSERIAL, &new_serinfo) < 0) { perror("Cannot get serial info"); exit(1); } break; case CMD_GETMULTI: if (ioctl(fd, TIOCSSERIAL, &new_serinfo) < 0) { perror("Cannot set serial info"); exit(1); } get_multiport(device, fd); break; case CMD_SETMULTI: if (ioctl(fd, TIOCSSERIAL, &new_serinfo) < 0) { perror("Cannot set serial info"); exit(1); } set_multiport(device, fd, &arg); break; #ifdef TIOCGHAYESESP case CMD_RX_TRIG: case CMD_TX_TRIG: case CMD_FLOW_OFF: case CMD_FLOW_ON: case CMD_RX_TMOUT: case CMD_DMA_CHAN: set_hayesesp(fd, p->cmd, atonum(*arg++)); break; #endif default: fprintf(stderr, "Internal error: unhandled cmd #%d\n", p->cmd); exit(1); } } if (ioctl(fd, TIOCSSERIAL, &new_serinfo) < 0) { perror("Cannot set serial info"); exit(1); } close(fd); if (verbose_flag) get_serial(device); } void do_wild_intr(char *device) { int fd; int i, mask; int wild_mask = -1; if ((fd = open(device, O_RDWR|O_NONBLOCK)) < 0) { perror(device); exit(1); } if (ioctl(fd, TIOCSERSWILD, &wild_mask) < 0) { perror("Cannot scan for wild interrupts"); exit(1); } if (ioctl(fd, TIOCSERGWILD, &wild_mask) < 0) { perror("Cannot get wild interrupt mask"); exit(1); } close(fd); if (quiet_flag) return; if (wild_mask) { printf("Wild interrupts found: "); for (i=0, mask=1; mask <= wild_mask; i++, mask <<= 1) if (mask & wild_mask) printf(" %d", i); printf("\n"); } else if (verbose_flag) printf("No wild interrupts found.\n"); return; } void usage() { fprintf(stderr, "%s\n\n", version_str); fprintf(stderr, "usage:\t %s serial-device -abqvVWz [cmd1 [arg]] ... \n", progname); fprintf(stderr, "\t %s -g [-abGv] device1 ...\n\n", progname); fprintf(stderr, "Available commands: (* = Takes an argument)\n"); fprintf(stderr, "\t\t(^ = can be preceded by a '^' to turn off the option)\n"); fprintf(stderr, "\t* port\t\tset the I/O port\n"); fprintf(stderr, "\t* irq\t\tset the interrupt\n"); fprintf(stderr, "\t* uart\t\tset UART type (none, 8250, 16450, 16550, 16550A,\n"); fprintf(stderr, "\t\t\t16650, 16650V2, 16750, 16850, 16950, 16954)\n"); fprintf(stderr, "\t* baud_base\tset base baud rate (CLOCK_FREQ / 16)\n"); fprintf(stderr, "\t* divisor\tset the custom divisor (see spd_custom)\n"); fprintf(stderr, "\t* close_delay\tset the amount of time (in 1/100 of a\n"); fprintf(stderr, "\t\t\t\tsecond) that DTR should be kept low\n"); fprintf(stderr, "\t\t\t\twhile being closed\n"); fprintf(stderr, "\t* closing_wait\tset the amount of time (in 1/100 of a\n"); fprintf(stderr, "\t\t\t\tsecond) that the serial port should wait for\n"); fprintf(stderr, "\t\t\t\tdata to be drained while being closed.\n"); fprintf(stderr, "\t^ fourport\tconfigure the port as an AST Fourport\n"); fprintf(stderr, "\t autoconfig\tautomatically configure the serial port\n"); fprintf(stderr, "\t^ auto_irq\ttry to determine irq during autoconfiguration\n"); fprintf(stderr, "\t^ skip_test\tskip UART test during autoconfiguration\n"); fprintf(stderr, "\n"); fprintf(stderr, "\t^ sak\t\tset the break key as the Secure Attention Key\n"); fprintf(stderr, "\t^ session_lockout Lock out callout port across different sessions\n"); fprintf(stderr, "\t^ pgrp_lockout\tLock out callout port across different process groups\n"); fprintf(stderr, "\t^ callout_nohup\tDon't hangup the tty when carrier detect drops\n"); fprintf(stderr, "\t\t\t\t on the callout device\n"); fprintf(stderr, "\t^ split_termios Use separate termios for callout and dailin lines\n"); fprintf(stderr, "\t^ hup_notify\tNotify a process blocked on opening a dial in line\n"); fprintf(stderr, "\t\t\t\twhen a process has finished using a callout\n"); fprintf(stderr, "\t\t\t\tline by returning EAGAIN to the open.\n"); fprintf(stderr, "\t^ low_latency\tMinimize receive latency at the cost of greater\n"); fprintf(stderr, "\t\t\t\tCPU utilization.\n"); fprintf(stderr, "\t get_multiport\tDisplay the multiport configuration\n"); fprintf(stderr, "\t set_multiport\tSet the multiport configuration\n"); fprintf(stderr, "\n"); #ifdef TIOCGHAYESESP fprintf(stderr, "\t* rx_trigger\tSet RX trigger level (ESP-only)\n"); fprintf(stderr, "\t* tx_trigger\tSet TX trigger level (ESP-only)\n"); fprintf(stderr, "\t* flow_off\tSet hardware flow off level (ESP-only)\n"); fprintf(stderr, "\t* flow_on\tSet hardware flow on level (ESP-only)\n"); fprintf(stderr, "\t* rx_timeout\tSet receive timeout (ESP-only)\n"); fprintf(stderr, "\t* dma_channel\tSet DMA channel (ESP-only)\n"); #endif fprintf(stderr, "\n"); fprintf(stderr, "\t spd_hi\tuse 56kb instead of 38.4kb\n"); fprintf(stderr, "\t spd_vhi\tuse 115kb instead of 38.4kb\n"); fprintf(stderr, "\t spd_shi\tuse 230kb instead of 38.4kb\n"); fprintf(stderr, "\t spd_warp\tuse 460kb instead of 38.4kb\n"); fprintf(stderr, "\t spd_cust\tuse the custom divisor to set the speed at 38.4kb\n"); fprintf(stderr, "\t\t\t\t(baud rate = baud_base / custom_divisor)\n"); fprintf(stderr, "\t spd_normal\tuse 38.4kb when a buad rate of 38.4kb is selected\n"); fprintf(stderr, "\n"); fprintf(stderr, "Use a leading '0x' for hex numbers.\n"); fprintf(stderr, "CAUTION: Using an invalid port can lock up your machine!\n"); exit(1); } main(int argc, char **argv) { int get_flag = 0, wild_intr_flag = 0; int c; extern int optind; extern char *optarg; progname = argv[0]; if (argc == 1) usage(); while ((c = getopt(argc, argv, "abgGqvVWz")) != EOF) { switch (c) { case 'a': verbosity = 2; break; case 'b': verbosity = 0; break; case 'q': quiet_flag++; break; case 'v': verbose_flag++; break; case 'g': get_flag++; break; case 'G': verbosity = -1; break; case 'V': fprintf(stderr, "%s\n", version_str); exit(0); case 'W': wild_intr_flag++; break; case 'z': zero_flag++; break; default: usage(); } } if (get_flag) { argv += optind; while (*argv) get_serial(*argv++); exit(0); } if (argc == optind) usage(); if (wild_intr_flag) { do_wild_intr(argv[optind]); exit(0); } if (argc-optind == 1) get_serial(argv[optind]); else set_serial(argv[optind], argv+optind+1); exit(0); } setserial-2.17/README0100600003667600366760000000150507044064073013500 0ustar tytsotytsosetserial Version 2.17 (27-Jan-2000) Setserial is a program which allows you to look at and change various attributes of a serial device, including its port, its IRQ, and other serial port options. Starting with Linux 0.99 pl10, only the COM1-4 ports are configured, using the default IRQ of 4 and 3. So, if you have any other serial ports provided by other boards (such as an AST Fourport), or if COM3-4 have been a non-standard IRQ so that you can use time simultaneously with COM1-2, you *must* use this program in order to configure those serial ports. The simplest way to configure the serial ports is to copy the provided rc.serial file to the appropriate /etc/rc.d directory. For example, to install rc.serial on a RedHat system, copy rc.serial to /etc/rc.d/init.d/serial, and then run the command "chkconfig -add serial". setserial-2.17/configure0100755003667600001450000012643207044057110014776 0ustar tytsoconsole#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated automatically using autoconf version 2.13 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. # Defaults: ac_help= ac_default_prefix=/usr/local # Any additions from configure.in: # Initialize some variables set by options. # The variables have the same names as the options, with # dashes changed to underlines. build=NONE cache_file=./config.cache exec_prefix=NONE host=NONE no_create= nonopt=NONE no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= target=NONE verbose= x_includes=NONE x_libraries=NONE bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' # Initialize some other variables. subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. ac_max_here_lines=12 ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi case "$ac_option" in -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; *) ac_optarg= ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case "$ac_option" in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir="$ac_optarg" ;; -build | --build | --buil | --bui | --bu) ac_prev=build ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build="$ac_optarg" ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file="$ac_optarg" ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir="$ac_optarg" ;; -disable-* | --disable-*) ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } fi ac_feature=`echo $ac_feature| sed 's/-/_/g'` eval "enable_${ac_feature}=no" ;; -enable-* | --enable-*) ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } fi ac_feature=`echo $ac_feature| sed 's/-/_/g'` case "$ac_option" in *=*) ;; *) ac_optarg=yes ;; esac eval "enable_${ac_feature}='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix="$ac_optarg" ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he) # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat << EOF Usage: configure [options] [host] Options: [defaults in brackets after descriptions] Configuration: --cache-file=FILE cache test results in FILE --help print this message --no-create do not create output files --quiet, --silent do not print \`checking...' messages --version print the version of autoconf that created configure Directory and file names: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [same as prefix] --bindir=DIR user executables in DIR [EPREFIX/bin] --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] --libexecdir=DIR program executables in DIR [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data in DIR [PREFIX/share] --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data in DIR [PREFIX/com] --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] --libdir=DIR object code libraries in DIR [EPREFIX/lib] --includedir=DIR C header files in DIR [PREFIX/include] --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] --infodir=DIR info documentation in DIR [PREFIX/info] --mandir=DIR man documentation in DIR [PREFIX/man] --srcdir=DIR find the sources in DIR [configure dir or ..] --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names EOF cat << EOF Host type: --build=BUILD configure for building on BUILD [BUILD=HOST] --host=HOST configure for HOST [guessed] --target=TARGET configure for TARGET [TARGET=HOST] Features and packages: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --x-includes=DIR X include files are in DIR --x-libraries=DIR X library files are in DIR EOF if test -n "$ac_help"; then echo "--enable and --with options recognized:$ac_help" fi exit 0 ;; -host | --host | --hos | --ho) ac_prev=host ;; -host=* | --host=* | --hos=* | --ho=*) host="$ac_optarg" ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir="$ac_optarg" ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir="$ac_optarg" ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir="$ac_optarg" ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir="$ac_optarg" ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir="$ac_optarg" ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir="$ac_optarg" ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir="$ac_optarg" ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix="$ac_optarg" ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix="$ac_optarg" ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix="$ac_optarg" ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name="$ac_optarg" ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir="$ac_optarg" ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir="$ac_optarg" ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site="$ac_optarg" ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir="$ac_optarg" ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir="$ac_optarg" ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target="$ac_optarg" ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers) echo "configure generated by autoconf version 2.13" exit 0 ;; -with-* | --with-*) ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } fi ac_package=`echo $ac_package| sed 's/-/_/g'` case "$ac_option" in *=*) ;; *) ac_optarg=yes ;; esac eval "with_${ac_package}='$ac_optarg'" ;; -without-* | --without-*) ac_package=`echo $ac_option|sed -e 's/-*without-//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } fi ac_package=`echo $ac_package| sed 's/-/_/g'` eval "with_${ac_package}=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes="$ac_optarg" ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries="$ac_optarg" ;; -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } ;; *) if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then echo "configure: warning: $ac_option: invalid host type" 1>&2 fi if test "x$nonopt" != xNONE; then { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } fi nonopt="$ac_option" ;; esac done if test -n "$ac_prev"; then { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } fi trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 # File descriptor usage: # 0 standard input # 1 file creation # 2 errors and warnings # 3 some systems may open it to /dev/tty # 4 used on the Kubota Titan # 6 checking for... messages and results # 5 compiler messages saved in config.log if test "$silent" = yes; then exec 6>/dev/null else exec 6>&1 fi exec 5>./config.log echo "\ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. " 1>&5 # Strip out --no-create and --no-recursion so they do not pile up. # Also quote any args containing shell metacharacters. ac_configure_args= for ac_arg do case "$ac_arg" in -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c) ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) ac_configure_args="$ac_configure_args '$ac_arg'" ;; *) ac_configure_args="$ac_configure_args $ac_arg" ;; esac done # NLS nuisances. # Only set these to C if already set. These must not be set unconditionally # because not all systems understand e.g. LANG=C (notably SCO). # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! # Non-C LC_CTYPE values break the ctype check. if test "${LANG+set}" = set; then LANG=C; export LANG; fi if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo > confdefs.h # A filename unique to this package, relative to the directory that # configure is in, which we can look for to find out if srcdir is correct. ac_unique_file=setserial.c # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_prog=$0 ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } else { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } fi fi srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then echo "loading site script $ac_site_file" . "$ac_site_file" fi done if test -r "$cache_file"; then echo "loading cache $cache_file" . $cache_file else echo "creating cache $cache_file" > $cache_file fi ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross ac_exeext= ac_objext=o if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then ac_n= ac_c=' ' ac_t=' ' else ac_n=-n ac_c= ac_t= fi else ac_n= ac_c='\c' ac_t= fi RELEASE_VERSION=`grep SETSERIAL_VERSION ${srcdir}/version.h \ | awk '{print $3}' | tr \" " " | awk '{print $1}'` DATE=`grep SETSERIAL_DATE ${srcdir}/version.h | awk '{print $3}' \ | tr \" " "` MONTH=`echo $DATE | awk -F- '{print $2}'` YEAR=`echo $DATE | awk -F- '{print $3}'` if expr $YEAR ">" 1900 > /dev/null ; then RELEASE_YEAR=$YEAR elif expr $YEAR ">" 90 >/dev/null ; then RELEASE_YEAR=19$YEAR else RELEASE_YEAR=20$YEAR fi case $MONTH in Jan) RELEASE_MONTH="January" ;; Feb) RELEASE_MONTH="February" ;; Mar) RELEASE_MONTH="March" ;; Apr) RELEASE_MONTH="April" ;; May) RELEASE_MONTH="May" ;; Jun) RELEASE_MONTH="June" ;; Jul) RELEASE_MONTH="July" ;; Aug) RELEASE_MONTH="August" ;; Sep) RELEASE_MONTH="September" ;; Oct) RELEASE_MONTH="October" ;; Nov) RELEASE_MONTH="November" ;; Dec) RELEASE_MONTH="December" ;; *) echo "Unknown month $MONTH??" ;; esac unset DATE MONTH YEAR echo "Generating configuration file for setserial version $RELEASE_VERSION" echo "Release date is ${RELEASE_MONTH}, ${RELEASE_YEAR}" # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:566: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_CC="gcc" break fi done IFS="$ac_save_ifs" fi fi CC="$ac_cv_prog_CC" if test -n "$CC"; then echo "$ac_t""$CC" 1>&6 else echo "$ac_t""no" 1>&6 fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:596: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_prog_rejected=no ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" break fi done IFS="$ac_save_ifs" if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# -gt 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift set dummy "$ac_dir/$ac_word" "$@" shift ac_cv_prog_CC="$@" fi fi fi fi CC="$ac_cv_prog_CC" if test -n "$CC"; then echo "$ac_t""$CC" 1>&6 else echo "$ac_t""no" 1>&6 fi if test -z "$CC"; then case "`uname -s`" in *win32* | *WIN32*) # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:647: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_CC="cl" break fi done IFS="$ac_save_ifs" fi fi CC="$ac_cv_prog_CC" if test -n "$CC"; then echo "$ac_t""$CC" 1>&6 else echo "$ac_t""no" 1>&6 fi ;; esac fi test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 echo "configure:679: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF #line 690 "configure" #include "confdefs.h" main(){return(0);} EOF if { (eval echo configure:695: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then ac_cv_prog_cc_cross=no else ac_cv_prog_cc_cross=yes fi else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_prog_cc_works=no fi rm -fr conftest* ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 echo "configure:721: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 echo "configure:726: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no fi fi echo "$ac_t""$ac_cv_prog_gcc" 1>&6 if test $ac_cv_prog_gcc = yes; then GCC=yes else GCC= fi ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 echo "configure:754: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then ac_cv_prog_cc_g=yes else ac_cv_prog_cc_g=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 if test "$ac_test_CFLAGS" = set; then CFLAGS="$ac_save_CFLAGS" elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break fi done if test -z "$ac_aux_dir"; then { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } fi ac_config_guess=$ac_aux_dir/config.guess ac_config_sub=$ac_aux_dir/config.sub ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 echo "configure:816: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" for ac_dir in $PATH; do # Account for people who put trailing slashes in PATH elements. case "$ac_dir/" in /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do if test -f $ac_dir/$ac_prog; then if test $ac_prog = install && grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : else ac_cv_path_install="$ac_dir/$ac_prog -c" break 2 fi fi done ;; esac done IFS="$ac_save_IFS" fi if test "${ac_cv_path_install+set}" = set; then INSTALL="$ac_cv_path_install" else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL="$ac_install_sh" fi fi echo "$ac_t""$INSTALL" 1>&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' # Make sure we can run config.sub. if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi echo $ac_n "checking host system type""... $ac_c" 1>&6 echo "configure:875: checking host system type" >&5 host_alias=$host case "$host_alias" in NONE) case $nonopt in NONE) if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } fi ;; *) host_alias=$nonopt ;; esac ;; esac host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$host" 1>&6 echo $ac_n "checking build system type""... $ac_c" 1>&6 echo "configure:896: checking build system type" >&5 build_alias=$build case "$build_alias" in NONE) case $nonopt in NONE) build_alias=$host_alias ;; *) build_alias=$nonopt ;; esac ;; esac build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$build" 1>&6 if test $host != $build; then ac_tool_prefix=${host_alias}- else ac_tool_prefix= fi # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:922: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" break fi done IFS="$ac_save_ifs" fi fi STRIP="$ac_cv_prog_STRIP" if test -n "$STRIP"; then echo "$ac_t""$STRIP" 1>&6 else echo "$ac_t""no" 1>&6 fi if test -z "$ac_cv_prog_STRIP"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:954: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_STRIP="strip" break fi done IFS="$ac_save_ifs" test -z "$ac_cv_prog_STRIP" && ac_cv_prog_STRIP=":" fi fi STRIP="$ac_cv_prog_STRIP" if test -n "$STRIP"; then echo "$ac_t""$STRIP" 1>&6 else echo "$ac_t""no" 1>&6 fi else STRIP=":" fi fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 echo "configure:987: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else # This must be in double quotes, not single quotes, because CPP may get # substituted into the Makefile and "${CC-cc}" will confuse make. CPP="${CC-cc} -E" # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:1008: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:1025: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:1042: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* CPP=/lib/cpp fi rm -f conftest* fi rm -f conftest* fi rm -f conftest* ac_cv_prog_CPP="$CPP" fi CPP="$ac_cv_prog_CPP" else ac_cv_prog_CPP="$CPP" fi echo "$ac_t""$CPP" 1>&6 for ac_hdr in asm/ioctls.h linux/hayesesp.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo "configure:1070: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:1080: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` cat >> confdefs.h <&6 fi done trap '' 1 2 15 cat > confcache <<\EOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs. It is not useful on other systems. # If it contains results you don't want to keep, you may remove or edit it. # # By default, configure uses ./config.cache as the cache file, # creating it if it does not exist already. You can give configure # the --cache-file=FILE option to use a different cache file; that is # what configure does when it calls configure scripts in # subdirectories, so they share the cache. # Giving --cache-file=/dev/null disables caching, for debugging configure. # config.status only pays attention to the cache file if you give it the # --recheck option to rerun configure. # EOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote substitution # turns \\\\ into \\, and sed turns \\ into \). sed -n \ -e "s/'/'\\\\''/g" \ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' ;; esac >> confcache if cmp -s $cache_file confcache; then : else if test -w $cache_file; then echo "updating cache $cache_file" cat confcache > $cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Any assignment to VPATH causes Sun make to only execute # the first set of double-colon rules, so remove it if not needed. # If there is a colon in the path, we need to keep it. if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' fi trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. cat > conftest.defs <<\EOF s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g s%\[%\\&%g s%\]%\\&%g s%\$%$$%g EOF DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` rm -f conftest.defs # Without the "./", some shells look in PATH for config.status. : ${CONFIG_STATUS=./config.status} echo creating $CONFIG_STATUS rm -f $CONFIG_STATUS cat > $CONFIG_STATUS </dev/null | sed 1q`: # # $0 $ac_configure_args # # Compiler output produced by configure, useful for debugging # configure, is in ./config.log if it exists. ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" for ac_option do case "\$ac_option" in -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; -version | --version | --versio | --versi | --vers | --ver | --ve | --v) echo "$CONFIG_STATUS generated by autoconf version 2.13" exit 0 ;; -help | --help | --hel | --he | --h) echo "\$ac_cs_usage"; exit 0 ;; *) echo "\$ac_cs_usage"; exit 1 ;; esac done ac_given_srcdir=$srcdir ac_given_INSTALL="$INSTALL" trap 'rm -fr `echo "setserial.8 Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF $ac_vpsub $extrasub s%@SHELL@%$SHELL%g s%@CFLAGS@%$CFLAGS%g s%@CPPFLAGS@%$CPPFLAGS%g s%@CXXFLAGS@%$CXXFLAGS%g s%@FFLAGS@%$FFLAGS%g s%@DEFS@%$DEFS%g s%@LDFLAGS@%$LDFLAGS%g s%@LIBS@%$LIBS%g s%@exec_prefix@%$exec_prefix%g s%@prefix@%$prefix%g s%@program_transform_name@%$program_transform_name%g s%@bindir@%$bindir%g s%@sbindir@%$sbindir%g s%@libexecdir@%$libexecdir%g s%@datadir@%$datadir%g s%@sysconfdir@%$sysconfdir%g s%@sharedstatedir@%$sharedstatedir%g s%@localstatedir@%$localstatedir%g s%@libdir@%$libdir%g s%@includedir@%$includedir%g s%@oldincludedir@%$oldincludedir%g s%@infodir@%$infodir%g s%@mandir@%$mandir%g s%@RELEASE_YEAR@%$RELEASE_YEAR%g s%@RELEASE_MONTH@%$RELEASE_MONTH%g s%@RELEASE_VERSION@%$RELEASE_VERSION%g s%@CC@%$CC%g s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g s%@INSTALL_DATA@%$INSTALL_DATA%g s%@host@%$host%g s%@host_alias@%$host_alias%g s%@host_cpu@%$host_cpu%g s%@host_vendor@%$host_vendor%g s%@host_os@%$host_os%g s%@build@%$build%g s%@build_alias@%$build_alias%g s%@build_cpu@%$build_cpu%g s%@build_vendor@%$build_vendor%g s%@build_os@%$build_os%g s%@STRIP@%$STRIP%g s%@CPP@%$CPP%g CEOF EOF cat >> $CONFIG_STATUS <<\EOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. ac_file=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_cmds # Line after last line for current file. ac_more_lines=: ac_sed_cmds="" while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file else sed "${ac_end}q" conftest.subs > conftest.s$ac_file fi if test ! -s conftest.s$ac_file; then ac_more_lines=false rm -f conftest.s$ac_file else if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f conftest.s$ac_file" else ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" fi ac_file=`expr $ac_file + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_cmds` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case "$ac_file" in *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; *) ac_file_in="${ac_file}.in" ;; esac # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. # Remove last slash and all that follows it. Not all systems have dirname. ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then # The file is in a subdirectory. test ! -d "$ac_dir" && mkdir "$ac_dir" ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" # A "../" for each directory in $ac_dir_suffix. ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` else ac_dir_suffix= ac_dots= fi case "$ac_given_srcdir" in .) srcdir=. if test -z "$ac_dots"; then top_srcdir=. else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; *) # Relative path. srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" top_srcdir="$ac_dots$ac_given_srcdir" ;; esac case "$ac_given_INSTALL" in [/$]*) INSTALL="$ac_given_INSTALL" ;; *) INSTALL="$ac_dots$ac_given_INSTALL" ;; esac echo creating "$ac_file" rm -f "$ac_file" configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." case "$ac_file" in *Makefile*) ac_comsub="1i\\ # $configure_input" ;; *) ac_comsub= ;; esac ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` sed -e "$ac_comsub s%@configure_input@%$configure_input%g s%@srcdir@%$srcdir%g s%@top_srcdir@%$top_srcdir%g s%@INSTALL@%$INSTALL%g " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file fi; done rm -f conftest.s* EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF exit 0 EOF chmod +x $CONFIG_STATUS rm -fr confdefs* $ac_clean_files test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 setserial-2.17/rc.serial0100700003667600366760000000553207044064222014426 0ustar tytsotytso# # /etc/rc.serial # Initializes the serial ports on your system # # chkconfig: 2345 50 75 # description: This initializes the settings of the serial port # # FILE_VERSION: 19981128 # # Distributed with setserial and the serial driver. We need to use the # FILE_VERSION field to assure that we don't overwrite a newer rc.serial # file with a newer one. # # XXXX For now, the autosave feature doesn't work if you are # using the multiport feature; it doesn't save the multiport configuration # (for now). Autosave also doesn't work for the hayes devices. # Will fix later... # # RCLOCKFILE=/var/lock/subsys/serial DIRS="/lib/modules/`uname -r`/misc /lib/modules /usr/lib/modules ." PATH=/bin:/sbin:/usr/bin DRIVER=serial DRIVER_NAME=serial MODULE_REGEXP="serial\b" ALLDEVS="/dev/ttyS?" if /bin/ls /dev/ttyS?? >& /dev/null ; then ALLDEVS="$ALLDEVS /dev/ttyS??" fi SETSERIAL="" if test -x /bin/setserial ; then SETSERIAL=/bin/setserial elif test -x /sbin/setserial ; then SETSERIAL=/sbin/setserial fi # # See if the serial driver is loaded # LOADED="" if test -f /proc/devices; then if grep -q " ttyS$" /proc/devices ; then LOADED="yes" else LOADED="no" fi fi # # Find the serial driver # for i in $DIRS do if test -z "$MODULE" -a -f $i/$DRIVER.o ; then MODULE=$i/$DRIVER.o fi done if ! test -f /proc/modules ; then MODULE="" fi # # Handle System V init conventions... # case $1 in start) action="start"; ;; stop) action="stop"; ;; *) action="start"; esac if test $action = stop ; then if test -n ${SETSERIAL} -a "$LOADED" != "no" -a \ `head -1 /etc/serial.conf`X = "###AUTOSAVE###X" ; then echo -n "Saving state of serial devices... " grep "^#" /etc/serial.conf > /etc/.serial.conf.new ${SETSERIAL} -G -g ${ALLDEVS} >> /etc/.serial.conf.new mv /etc/serial.conf /etc/.serial.conf.old mv /etc/.serial.conf.new /etc/serial.conf echo "done." fi if test -n $MODULE ; then module=`grep $MODULE_REGEXP /proc/modules | awk '{print $1}'` if test -z "$module" ; then echo "The $DRIVER_NAME driver is not loaded." rm -f ${RCLOCKFILE} exit 0 fi if rmmod $module ; then :; else echo "The $DRIVER_NAME driver could NOT be unloaded." exit 1; fi echo "The $DRIVER_NAME driver has been unloaded." fi rm -f ${RCLOCKFILE} exit 0 fi # # If not stop, it must be a start.... # if test -n $MODULE -a "$LOADED" != "yes" ; then if insmod -fm $MODULE $DRIVER_ARG \ > /tmp/$DRIVER.map 2> /tmp/$DRIVER.$$; then :; else echo "Couldn't load $DRIVER_NAME driver." echo "See error logs in /tmp/$DRIVER.$$" exit 1 fi /bin/rm -f /tmp/$DRIVER.$$ fi if test -f /etc/serial.conf ; then if test -n ${SETSERIAL} ; then grep -v ^# < /etc/serial.conf | while read device args do ${SETSERIAL} -z $device $args done fi else echo "###AUTOSAVE###" > /etc/serial.conf fi touch ${RCLOCKFILE} ${SETSERIAL} -bg ${ALLDEVS} setserial-2.17/configure.in0100600003667600366760000000252707044057105015134 0ustar tytsotytsoAC_INIT(setserial.c) dnl dnl This is to figure out the version number and the date.... dnl RELEASE_VERSION=`grep SETSERIAL_VERSION ${srcdir}/version.h \ | awk '{print $3}' | tr \" " " | awk '{print $1}'` DATE=`grep SETSERIAL_DATE ${srcdir}/version.h | awk '{print $3}' \ | tr \" " "` MONTH=`echo $DATE | awk -F- '{print $2}'` YEAR=`echo $DATE | awk -F- '{print $3}'` if expr $YEAR ">" 1900 > /dev/null ; then RELEASE_YEAR=$YEAR elif expr $YEAR ">" 90 >/dev/null ; then RELEASE_YEAR=19$YEAR else RELEASE_YEAR=20$YEAR fi case $MONTH in Jan) RELEASE_MONTH="January" ;; Feb) RELEASE_MONTH="February" ;; Mar) RELEASE_MONTH="March" ;; Apr) RELEASE_MONTH="April" ;; May) RELEASE_MONTH="May" ;; Jun) RELEASE_MONTH="June" ;; Jul) RELEASE_MONTH="July" ;; Aug) RELEASE_MONTH="August" ;; Sep) RELEASE_MONTH="September" ;; Oct) RELEASE_MONTH="October" ;; Nov) RELEASE_MONTH="November" ;; Dec) RELEASE_MONTH="December" ;; *) echo "Unknown month $MONTH??" ;; esac unset DATE MONTH YEAR echo "Generating configuration file for setserial version $RELEASE_VERSION" echo "Release date is ${RELEASE_MONTH}, ${RELEASE_YEAR}" AC_SUBST(RELEASE_YEAR) AC_SUBST(RELEASE_MONTH) AC_SUBST(RELEASE_VERSION) dnl dnl End of version number scheme dnl AC_PROG_CC AC_PROG_INSTALL AC_CHECK_TOOL(STRIP, strip, :) AC_CHECK_HEADERS(asm/ioctls.h linux/hayesesp.h) AC_OUTPUT(setserial.8 Makefile) setserial-2.17/.cvsignore0100600003667600001450000000013506620731436015057 0ustar tytsoconsoleMakefile configure config.log config.cache config.status setserial.8 setserial setserial.cat setserial-2.17/linux/0040755003667600001450000000000007044063466014234 5ustar tytsoconsolesetserial-2.17/linux/serial.h0100644003667600366760000001056107044063200015410 0ustar tytsotytso/* * include/linux/serial.h * * Copyright (C) 1992 by Theodore Ts'o. * * Redistribution of this file is permitted under the terms of the GNU * Public License (GPL) */ #ifndef _LINUX_SERIAL_H #define _LINUX_SERIAL_H struct serial_struct { int type; int line; int port; int irq; int flags; int xmit_fifo_size; int custom_divisor; int baud_base; unsigned short close_delay; char io_type; char reserved_char[1]; int hub6; unsigned short closing_wait; /* time to wait before closing */ unsigned short closing_wait2; /* no longer used... */ unsigned char *iomem_base; unsigned short iomem_reg_shift; int reserved[2]; }; /* * For the close wait times, 0 means wait forever for serial port to * flush its output. 65535 means don't wait at all. */ #define ASYNC_CLOSING_WAIT_INF 0 #define ASYNC_CLOSING_WAIT_NONE 65535 /* * These are the supported serial types. */ #define PORT_UNKNOWN 0 #define PORT_8250 1 #define PORT_16450 2 #define PORT_16550 3 #define PORT_16550A 4 #define PORT_CIRRUS 5 /* usurped by cyclades.c */ #define PORT_16650 6 #define PORT_16650V2 7 #define PORT_16750 8 #define PORT_STARTECH 9 /* usurped by cyclades.c */ #define PORT_16C950 10 /* Oxford Semiconductor */ #define PORT_16654 11 #define PORT_16850 12 #define PORT_MAX 12 #define SERIAL_IO_PORT 0 #define SERIAL_IO_HUB6 1 #define SERIAL_IO_MEM 2 #define SERIAL_IO_GSC 3 struct serial_uart_config { char *name; int dfl_xmit_fifo_size; int flags; }; #define UART_CLEAR_FIFO 0x01 #define UART_USE_FIFO 0x02 #define UART_STARTECH 0x04 /* * Definitions for async_struct (and serial_struct) flags field */ #define ASYNC_HUP_NOTIFY 0x0001 /* Notify getty on hangups and closes on the callout port */ #define ASYNC_FOURPORT 0x0002 /* Set OU1, OUT2 per AST Fourport settings */ #define ASYNC_SAK 0x0004 /* Secure Attention Key (Orange book) */ #define ASYNC_SPLIT_TERMIOS 0x0008 /* Separate termios for dialin/callout */ #define ASYNC_SPD_MASK 0x1030 #define ASYNC_SPD_HI 0x0010 /* Use 56000 instead of 38400 bps */ #define ASYNC_SPD_VHI 0x0020 /* Use 115200 instead of 38400 bps */ #define ASYNC_SPD_CUST 0x0030 /* Use user-specified divisor */ #define ASYNC_SKIP_TEST 0x0040 /* Skip UART test during autoconfiguration */ #define ASYNC_AUTO_IRQ 0x0080 /* Do automatic IRQ during autoconfiguration */ #define ASYNC_SESSION_LOCKOUT 0x0100 /* Lock out cua opens based on session */ #define ASYNC_PGRP_LOCKOUT 0x0200 /* Lock out cua opens based on pgrp */ #define ASYNC_CALLOUT_NOHUP 0x0400 /* Don't do hangups for cua device */ #define ASYNC_HARDPPS_CD 0x0800 /* Call hardpps when CD goes high */ #define ASYNC_SPD_SHI 0x1000 /* Use 230400 instead of 38400 bps */ #define ASYNC_SPD_WARP 0x1010 /* Use 460800 instead of 38400 bps */ #define ASYNC_LOW_LATENCY 0x2000 /* Request low latency behaviour */ #define ASYNC_FLAGS 0x3FFF /* Possible legal async flags */ #define ASYNC_USR_MASK 0x3430 /* Legal flags that non-privileged * users can set or reset */ /* Internal flags used only by kernel/chr_drv/serial.c */ #define ASYNC_INITIALIZED 0x80000000 /* Serial port was initialized */ #define ASYNC_CALLOUT_ACTIVE 0x40000000 /* Call out device is active */ #define ASYNC_NORMAL_ACTIVE 0x20000000 /* Normal device is active */ #define ASYNC_BOOT_AUTOCONF 0x10000000 /* Autoconfigure port on bootup */ #define ASYNC_CLOSING 0x08000000 /* Serial port is closing */ #define ASYNC_CTS_FLOW 0x04000000 /* Do CTS flow control */ #define ASYNC_CHECK_CD 0x02000000 /* i.e., CLOCAL */ #define ASYNC_SHARE_IRQ 0x01000000 /* for multifunction cards */ #define ASYNC_INTERNAL_FLAGS 0xFF000000 /* Internal flags */ /* * Multiport serial configuration structure --- external structure */ struct serial_multiport_struct { int irq; int port1; unsigned char mask1, match1; int port2; unsigned char mask2, match2; int port3; unsigned char mask3, match3; int port4; unsigned char mask4, match4; int port_monitor; int reserved[32]; }; /* * Serial input interrupt line counters -- external structure * Four lines can interrupt: CTS, DSR, RI, DCD */ struct serial_icounter_struct { int cts, dsr, rng, dcd; int rx, tx; int frame, overrun, parity, brk; int buf_overrun; int reserved[9]; }; #ifdef __KERNEL__ /* Export to allow PCMCIA to use this - Dave Hinds */ extern int register_serial(struct serial_struct *req); extern void unregister_serial(int line); #endif /* __KERNEL__ */ #endif /* _LINUX_SERIAL_H */ setserial-2.17/version.h0100600003667600366760000000040107044057056014453 0ustar tytsotytso/* * version.h --- Defines the version number of setserial * * Copyright 1995, 1996, 1997, 1998 by Theodore Ts'o. This file may be * redistributed under the GNU Public License. */ #define SETSERIAL_VERSION "2.17" #define SETSERIAL_DATE "27-Jan-2000" setserial-2.17/setserial.lsm0100600003667600366760000000075407044063646015342 0ustar tytsotytsoBegin3 Title: Setserial Version: 1.17 Entered-date: 27Jan00 Description: Utility for doing run-time configuration of the serial driver. Keywords: utilities, serial, tty Author: tytso@mit.edu (Theodore Tso) Maintained-by: tytso@mit.edu (Theodore Tso) Primary-site: tsx-11.mit.edu /pub/linux/sources/sbin 52kB setserial-2.17.tar.gz 1kB setserial-2.17.lsm Alternate-site: Platforms: linux 2.0.x/2.1.x/2.2.x/2.3.x Copying-policy: GPL End setserial-2.17/setserial.8.in0100600003667600366760000004234507044056451015321 0ustar tytsotytso.\" Copyright 1992, 1993 Rickard E. Faith (faith@cs.unc.edu) .\" May be distributed under the GNU General Public License .\" Portions of this text are from the README in setserial-2.01.tar.z, .\" but I can't figure out who wrote that document. If anyone knows, .\" please tell me .\" .\" [tytso:19940519.2239EDT] I did... - Ted Ts'o (tytso@mit.edu) .\" .TH SETSERIAL 8 "@RELEASE_MONTH@ @RELEASE_YEAR@" "Setserial @RELEASE_VERSION@ .SH NAME setserial \- get/set Linux serial port information .SH SYNOPSIS .B setserial .B "[ \-abqvVWz ]" device .BR "[ " parameter1 " [ " arg " ] ] ..." .B "setserial -g" .B "[ \-abGv ]" device1 ... .SH DESCRIPTION .B setserial is a program designed to set and/or report the configuration information associated with a serial port. This information includes what I/O port and IRQ a particular serial port is using, and whether or not the break key should be interpreted as the Secure Attention Key, and so on. During the normal bootup process, only COM ports 1-4 are initialized, using the default I/O ports and IRQ values, as listed below. In order to initialize any additional serial ports, or to change the COM 1-4 ports to a nonstadard configuration, the .B setserial program should be used. Typically it is called from an .I rc.serial script, which is usually run out of .IR /etc/rc.local . The .I device argument or arguments specifies the serial device which should be configured or interrogated. It will usually have the following form: .BR /dev/cua[0-3] . If no parameters are specified, .B setserial will print out the port type (i.e., 8250, 16450, 16550, 16550A, etc.), the hardware I/O port, the hardware IRQ line, its "baud base," and some of its operational flags. If the .B \-g option is given, the arguments to setserial are interpreted as a list of devices for which the characteristics of those devices should be printed. Without the .B \-g option, the first argument to setserial is interpreted as the device to be modified or characteristics to be printed, and any additional arguments are interpreted as parameters which should be assigned to that serial device. For the most part, superuser privilege is required to set the configuration parameters of a serial port. A few serial port parameters can be set by normal users, however, and these will be noted as exceptions in this manual page. .SH OPTIONS .B Setserial accepts the following options: .TP .B \-a When reporting the configuration of a serial device, print all available information. .TP .B \-b When reporting the configuration of a serial device, print a summary of the device's configuration, which might be suitable for printing during the bootup process, during the /etc/rc script. .TP .B \-G Print out the configuration information of the serial port in a form which can be fed back to setserial as command-line arguments. .TP .B \-q Be quiet. .B Setserial will print fewer lines of output. .TP .B \-v Be verbose. .B Setserial will print additional status output. .TP .B \-V Display version and exit. .TP .B \-W Do wild interrupt initialization and exit. This option is no longer relevant in Linux kernels after version 2.1. .TP .B \-z Zero out the serial flags before starting to set flags. This is related to the automatic saving of serial flags using the \-G flag. .SH PARAMETERS The following parameters can be assigned to a serial port. All argument values are assumed to be in decimal unless preceeded by "0x". .TP .BR port " port_number" The .B port option sets the I/O port, as described above. .TP .BR irq " irq_number" The .B irq option sets the hardware IRQ, as described above. .TP .BR uart " uart_type" This option is used to set the UART type. The permitted types are .BR none , 8250, 16450, 16550, 16550A, 16650, 16650V2, 16654, 16750, 16850, 16950, and 16954. Using UART type .B none will disable the port. Some internal modems are billed as having a "16550A UART with a 1k buffer". This is a lie. They do not have really have a 16550A compatible UART; instead what they have is a 16450 compatible UART with a 1k receive buffer to prevent receiver overruns. This is important, because they do not have a transmit FIFO. Hence, they are not compatible with a 16550A UART, and the autoconfiguration process will correctly identify them as 16450's. If you attempt to override this using the .B uart parameter, you will see dropped characters during file transmissions. These UART's usually have other problems: the .B skip_test parameter also often must be specified. .TP .B autoconfig When this parameter is given, .B setserial will ask the kernel to attempt to automatically configure the serial port. The I/O port must be correctly set; the kernel will attempt to determine the UART type, and if the .B auto_irq parameter is set, Linux will attempt to automatically determine the IRQ. The .B autoconfig parameter should be given after the .BR port , auto_irq ", and " skip_test parameters have been specified. .TP .B auto_irq During autoconfiguration, try to determine the IRQ. This feature is not guaranteed to always produce the correct result; some hardware configurations will fool the Linux kernel. It is generally safer not to use the .B auto_irq feature, but rather to specify the IRQ to be used explicitly, using the .B irq parameter. .TP .B ^auto_irq During autoconfiguration, do .I not try to determine the IRQ. .TP .B skip_test During autoconfiguration, skip the UART test. Some internal modems do not have National Semiconductor compatible UART's, but have cheap imitations instead. Some of these cheasy imitations UART's do not fully support the loopback detection mode, which is used by the kernel to make sure there really is a UART at a particular address before attempting to configure it. So for certain internal modems you will need to specify this parameter so Linux can initialize the UART correctly. .TP .B ^skip_test During autoconfiguration, do .I not skip the UART test. .TP .BR baud_base " baud_base" This option sets the base baud rate, which is the clock frequency divided by 16. Normally this value is 115200, which is also the fastest baud rate which the UART can support. .TP .B spd_hi Use 57.6kb when the application requests 38.4kb. This parameter may be specified by a non-privileged user. .TP .B spd_vhi Use 115kb when the application requests 38.4kb. This parameter may be specified by a non-privileged user. .TP .B spd_shi Use 230kb when the application requests 38.4kb. This parameter may be specified by a non-privileged user. .TP .B spd_warp Use 460kb when the application requests 38.4kb. This parameter may be specified by a non-privileged user. .TP .B spd_cust Use the custom divisor to set the speed when the application requests 38.4kb. In this case, the baud rate is the .B baud_base divided by the .BR divisor . This parameter may be specified by a non-privileged user. .TP .B spd_normal Use 38.4kb when the application requests 38.4kb. This parameter may be specified by a non-privileged user. .TP .BR divisor " divisor" This option sets the custom divison. This divisor will be used then the .B spd_cust option is selected and the serial port is set to 38.4kb by the application. This parameter may be specified by a non-privileged user. .TP .B sak Set the break key at the Secure Attention Key. .TP .B ^sak disable the Secure Attention Key. .TP .B fourport Configure the port as an AST Fourport card. .TP .B ^fourport Disable AST Fourport configuration. .TP .BR close_delay " delay" Specify the amount of time, in hundredths of a second, that DTR should remain low on a serial line after the callout device is closed, before the blocked dialin device raises DTR again. The default value of this option is 50, or a half-second delay. .TP .BR closing_wait " delay" Specify the amount of time, in hundredths of a second, that the kernel should wait for data to be transmitted from the serial port while closing the port. If "none" is specified, no delay will occur. If "infinite" is specified the kernel will wait indefinitely for the buffered data to be transmitted. The default setting is 3000 or 30 seconds of delay. This default is generally appropriate for most devices. If too long a delay is selected, then the serial port may hang for a long time if when a serial port which is not connected, and has data pending, is closed. If too short a delay is selected, then there is a risk that some of the transmitted data is output at all. If the device is extremely slow, like a plotter, the closing_wait may need to be larger. .TP .B session_lockout Lock out callout port (/dev/cuaXX) accesses across different sessions. That is, once a process has opened a port, do not allow a process with a different session ID to open that port until the first process has closed it. .TP .B ^session_lockout Do not lock out callout port accesses across different sessions. .TP .B pgrp_lockout Lock out callout port (/dev/cuaXX) accesses across different process groups. That is, once a process has opened a port, do not allow a process in a different process group to open that port until the first process has closed it. .TP .B ^pgrp_lockout Do not lock out callout port accesses across different process groups. .TP .B hup_notify Notify a process blocked on opening a dial in line when a process has finished using a callout line (either by closing it or by the serial line being hung up) by returning EAGAIN to the open. The application of this parameter is for getty's which are blocked on a serial port's dial in line. This allows the getty to reset the modem (which may have had its configuration modified by the application using the callout device) before blocking on the open again. .TP .B ^hup_notify Do not notify a process blocked on opening a dial in line when the callout device is hung up. .TP .B split_termios Treat the termios settings used by the callout device and the termios settings used by the dialin devices as separate. .TP .B ^split_termios Use the same termios structure to store both the dialin and callout ports. This is the default option. .TP .B callout_nohup If this particular serial port is opened as a callout device, do not hangup the tty when carrier detect is dropped. .TP .B ^callout_nohup Do not skip hanging up the tty when a serial port is opened as a callout device. Of course, the HUPCL termios flag must be enabled if the hangup is to occur. .TP .B low_latency Minimize the receive latency of the serial device at the cost of greater CPU utilization. (Normally there is an average of 5-10ms latency before characters are handed off to the line discpline to minimize overhead.) This is off by default, but certain real-time applications may find this useful. .TP .B ^low_latency Optimize for efficient CPU processing of serial characters at the cost of paying an average of 5-10ms of latency before the characters are processed. This is the default. .SH CONSIDERATIONS OF CONFIGURING SERIAL PORTS It is important to note that setserial merely tells the Linux kernel where it should expect to find the I/O port and IRQ lines of a particular serial port. It does *not* configure the hardware, the actual serial board, to use a particular I/O port. In order to do that, you will need to physically program the serial board, usually by setting some jumpers or by switching some DIP switches. This section will provide some pointers in helping you decide how you would like to configure your serial ports. The "standard MS-DOS" port associations are given below: .nf .RS /dev/ttys0 (COM1), port 0x3f8, irq 4 /dev/ttys1 (COM2), port 0x2f8, irq 3 /dev/ttys2 (COM3), port 0x3e8, irq 4 /dev/ttys3 (COM4), port 0x2e8, irq 3 .RE .fi Due to the limitations in the design of the AT/ISA bus architecture, normally an IRQ line may not be shared between two or more serial ports. If you attempt to do this, one or both serial ports will become unreliable if you try to use both simultaneously. This limitation can be overcome by special multi-port serial port boards, which are designed to share multiple serial ports over a single IRQ line. Multi-port serial cards supported by Linux include the AST FourPort, the Accent Async board, the Usenet Serial II board, the Bocaboard BB-1004, BB-1008, and BB-2016 boards, and the HUB-6 serial board. The selection of an alternative IRQ line is difficult, since most of them are already used. The following table lists the "standard MS-DOS" assignments of available IRQ lines: .nf .RS IRQ 3: COM2 IRQ 4: COM1 IRQ 5: LPT2 IRQ 7: LPT1 .RE .fi Most people find that IRQ 5 is a good choice, assuming that there is only one parallel port active in the computer. Another good choice is IRQ 2 (aka IRQ 9); although this IRQ is sometimes used by network cards, and very rarely VGA cards will be configured to use IRQ 2 as a vertical retrace interrupt. If your VGA card is configured this way; try to disable it so you can reclaim that IRQ line for some other card. It's not necessary for Linux and most other Operating systems. The only other available IRQ lines are 3, 4, and 7, and these are probably used by the other serial and parallel ports. (If your serial card has a 16bit card edge connector, and supports higher interrupt numbers, then IRQ 10, 11, 12, and 15 are also available.) On AT class machines, IRQ 2 is seen as IRQ 9, and Linux will interpret it in this manner. IRQ's other than 2 (9), 3, 4, 5, 7, 10, 11, 12, and 15, should .I not be used, since they are assigned to other hardware and cannot, in general, be changed. Here are the "standard" assignments: .nf .RS IRQ 0 Timer channel 0 IRQ 1 Keyboard IRQ 2 Cascade for controller 2 IRQ 3 Serial port 2 IRQ 4 Serial port 1 IRQ 5 Parallel port 2 (Reserved in PS/2) IRQ 6 Floppy diskette IRQ 7 Parallel port 1 IRQ 8 Real-time clock IRQ 9 Redirected to IRQ2 IRQ 10 Reserved IRQ 11 Reserved IRQ 12 Reserved (Auxillary device in PS/2) IRQ 13 Math coprocessor IRQ 14 Hard disk controller IRQ 15 Reserved .RE .fi .SH MULTIPORT CONFIGURATION Certain multiport serial boards which share multiple ports on a single IRQ use one or more ports to indicate whether or not there are any pending ports which need to be serviced. If your multiport board supports these ports, you should make use of them to avoid potential lockups if the interrupt gets lost. In order to set these ports specify .B set_multiport as a parameter, and follow it with the multiport parameters. The multiport parameters take the form of specifying the .I port that should be checked, a .I mask which indicate which bits in the register are significant, and finally, a .I match parameter which specifies what the significant bits in that register must match when there is no more pending work to be done. Up to four such port/mask/match combinations may be specified. The first such combinations should be specified by setting the parameters .BR port1 , .BR mask1 , and .BR match1 . The second such combination should be specified with .BR port2 , .BR mask2 , and .BR match2 , and so on. In order to disable this multiport checking, set .B port1 to be zero. In order to view the current multiport settings, specify the parameter .B get_multiport on the command line. Here are some multiport settings for some common serial boards: .nf .RS AST FourPort port1 0x1BF mask1 0xf match1 0xf Boca BB-1004/8 port1 0x107 mask1 0xff match1 0 Boca BB-2016 port1 0x107 mask1 0xff match1 0 port2 0x147 mask2 0xff match2 0 .RE .fi .SH Hayes ESP Configuration .B Setserial may also be used to configure ports on a Hayes ESP serial board. .PP The following parameters when configuring ESP ports: .TP .B rx_trigger This is the trigger level (in bytes) of the receive FIFO. Larger values may result in fewer interrupts and hence better performance; however, a value too high could result in data loss. Valid values are 1 through 1023. .TP .B tx_trigger This is the trigger level (in bytes) of the transmit FIFO. Larger values may result in fewer interrupts and hence better performance; however, a value too high could result in degraded transmit performance. Valid values are 1 through 1023. .TP .B flow_off This is the level (in bytes) at which the ESP port will "flow off" the remote transmitter (i.e. tell him to stop stop sending more bytes). Valid values are 1 through 1023. This value should be greater than the receive trigger level and the flow on level. .TP .B flow_on This is the level (in bytes) at which the ESP port will "flow on" the remote transmitter (i.e. tell him to resume sending bytes) after having flowed it off. Valid values are 1 through 1023. This value should be less than the flow off level, but greater than the receive trigger level. .TP .B rx_timeout This is the amount of time that the ESP port will wait after receiving the final character before signaling an interrupt. Valid values are 0 through 255. A value too high will increase latency, and a value too low will cause unnecessary interrupts. .SH CAUTION CAUTION: Configuring a serial port to use an incorrect I/O port can lock up your machine. .SH FILES .BR /etc/rc.local .BR /etc/rc.serial .SH "SEE ALSO" .BR tty (4), .BR ttys (4), kernel/chr_drv/serial.c .SH AUTHOR The original version of setserial was written by Rick Sladkey (jrs@world.std.com), and was modified by Michael K. Johnson (johnsonm@stolaf.edu). This version has since been rewritten from scratch by Theodore Ts'o (tytso@mit.edu) on 1/1/93. Any bugs or problems are solely his responsibility. setserial-2.17/install-sh0100700003667600001450000001256206620731363015067 0ustar tytsoconsole#! /bin/sh # # install - install a program, script, or datafile # This comes from X11R5 (mit/util/scripts/install.sh). # # Copyright 1991 by the Massachusetts Institute of Technology # # Permission to use, copy, modify, distribute, and sell this software and its # documentation for any purpose is hereby granted without fee, provided that # the above copyright notice appear in all copies and that both that # copyright notice and this permission notice appear in supporting # documentation, and that the name of M.I.T. not be used in advertising or # publicity pertaining to distribution of the software without specific, # written prior permission. M.I.T. makes no representations about the # suitability of this software for any purpose. It is provided "as is" # without express or implied warranty. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. # # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 else true fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d $dst ]; then instcmd=: else instcmd=mkdir fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f $src -o -d $src ] then true else echo "install: $src does not exist" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 else true fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` else true fi fi ## this sed command emulates the dirname command dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-${defaultIFS}}" oIFS="${IFS}" # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` IFS="${oIFS}" pathcomp='' while [ $# -ne 0 ] ; do pathcomp="${pathcomp}${1}" shift if [ ! -d "${pathcomp}" ] ; then $mkdirprog "${pathcomp}" else true fi pathcomp="${pathcomp}/" done fi if [ x"$dir_arg" != x ] then $doit $instcmd $dst && if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename $dst` else dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename $dst` else true fi # Make a temp file name in the proper directory. dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp && trap "rm -f ${dsttmp}" 0 && # and set any options; do chmod last to preserve setuid bits # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && $doit $mvcmd $dsttmp $dstdir/$dstfile fi && exit 0 setserial-2.17/serial.conf0100600003667600001450000000560406617472214015215 0ustar tytsoconsole# # This is a sample serial.conf file. You should uncomment out and modify # the relevant lines as necessary. # # These are the standard COM1 through COM4 devices # #/dev/ttyS0 uart 16450 port 0x3F8 irq 4 #/dev/ttyS1 uart 16450 port 0x2F8 irq 3 #/dev/ttyS2 uart 16450 port 0x3E8 irq 4 #/dev/ttyS3 uart 16450 port 0x2E8 irq 3 # These are the first set of AST Fourport ports # #/dev/ttyS4 uart 16450 port 0x1A0 irq 9 fourport #/dev/ttyS5 uart 16450 port 0x1A8 irq 9 fourport #/dev/ttyS6 uart 16450 port 0x1B0 irq 9 fourport #/dev/ttyS7 uart 16450 port 0x1B8 irq 9 fourport # This enables the new multiport masking feature, which is highly recommened # for AST FourPort boards. # #/dev/ttyS4 set_multiport port1 0x1BF mask1 0xf match1 0xf # These are the second set of AST Fourport ports # #/dev/ttyS8 uart 16450 port 0x2A0 irq 5 fourport #/dev/ttyS9 uart 16450 port 0x2A8 irq 5 fourport #/dev/ttyS10 uart 16450 port 0x2B0 irq 5 fourport #/dev/ttyS11 uart 16450 port 0x2B8 irq 5 fourport # This enables the new multiport masking feature, which is highly recommened # for AST FourPort boards. # #/dev/ttyS8 set_multiport port1 0x2BF mask1 0xf match1 0xf # These are the 3rd and 4th ports on the Accent Async board. # #/dev/ttyS12 uart 16450 port 0x330 irq 4 #/dev/ttyS13 uart 16450 port 0x338 irq 4 # These are two spare devices you can use to customize for # some board which is not supported above.... # #/dev/ttyS14 uart XXXXX port XXXX irq X #/dev/ttyS15 uart XXXXX port XXXX irq X # These are the ports used for either the Usenet Serial II # board, or the Boca Board 4, 8, or 16 port boards. # # Uncomment only the first 4 lines for the Usenet Serial II board, # and uncomment the first 4, 8, or all 16 lines for the # Boca Board BB-1004, BB-1008, and BB-2016 respectively. # #/dev/ttyS16 uart 16550A port 0x100 irq 12 #/dev/ttyS17 uart 16550A port 0x108 irq 12 #/dev/ttyS18 uart 16550A port 0x110 irq 12 #/dev/ttyS19 uart 16550A port 0x118 irq 12 #/dev/ttyS20 uart 16550A port 0x120 irq 12 #/dev/ttyS21 uart 16550A port 0x128 irq 12 #/dev/ttyS22 uart 16550A port 0x130 irq 12 #/dev/ttyS23 uart 16550A port 0x138 irq 12 #/dev/ttyS24 uart 16550A port 0x140 irq 12 #/dev/ttyS25 uart 16550A port 0x148 irq 12 #/dev/ttyS26 uart 16550A port 0x150 irq 12 #/dev/ttyS27 uart 16550A port 0x158 irq 12 #/dev/ttyS28 uart 16550A port 0x160 irq 12 #/dev/ttyS29 uart 16550A port 0x168 irq 12 #/dev/ttyS30 uart 16550A port 0x170 irq 12 #/dev/ttyS31 uart 16550A port 0x178 irq 12 # This enables the new multiport masking feature, which is highly recommened # for Bocaboard ports. Uncomment only the first line if you have a # BB-1004 or BB-1008. Uncomment both lines if you have a BB-2016. # These numbers assume the Bocaboard is located at address 0x100. If you # change this, remember to change the port1 and port2 addresses. # #/dev/ttyS16 set_multiport port1 0x107 mask1 0xff match1 0 #/dev/ttyS16 set_multiport port2 0x147 mask2 0xff match2 0 setserial-2.17/config.sub0100700003667600001450000004655006620730253015047 0ustar tytsoconsole#! /bin/sh # Configuration validation subroutine script, version 1.1. # Copyright (C) 1991, 92-97, 1998 Free Software Foundation, Inc. # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. if [ x$1 = x ] then echo Configuration name missing. 1>&2 echo "Usage: $0 CPU-MFR-OPSYS" 1>&2 echo "or $0 ALIAS" 1>&2 echo where ALIAS is a recognized configuration type. 1>&2 exit 1 fi # First pass through any local machine types. case $1 in *local*) echo $1 exit 0 ;; *) ;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in linux-gnu*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple) os= basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco5) os=sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \ | arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \ | 580 | i960 | h8300 | hppa | hppa1.0 | hppa1.1 | hppa2.0 \ | alpha | alphaev5 | alphaev56 | we32k | ns16k | clipper \ | i370 | sh | powerpc | powerpcle | 1750a | dsp16xx | pdp11 \ | mips64 | mipsel | mips64el | mips64orion | mips64orionel \ | mipstx39 | mipstx39el \ | sparc | sparclet | sparclite | sparc64 | v850) basic_machine=$basic_machine-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i[34567]86) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. vax-* | tahoe-* | i[34567]86-* | i860-* | m32r-* | m68k-* | m68000-* \ | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \ | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \ | power-* | none-* | 580-* | cray2-* | h8300-* | i960-* \ | xmp-* | ymp-* | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* \ | alpha-* | alphaev5-* | alphaev56-* | we32k-* | cydra-* \ | ns16k-* | pn-* | np1-* | xps100-* | clipper-* | orion-* \ | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \ | sparc64-* | mips64-* | mipsel-* \ | mips64el-* | mips64orion-* | mips64orionel-* \ | mipstx39-* | mipstx39el-* \ | f301-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-cbm ;; amigaos | amigados) basic_machine=m68k-cbm os=-amigaos ;; amigaunix | amix) basic_machine=m68k-cbm os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | ymp) basic_machine=ymp-cray os=-unicos ;; cray2) basic_machine=cray2-cray os=-unicos ;; [ctj]90-cray) basic_machine=c90-cray os=-unicos ;; crds | unos) basic_machine=m68k-crds ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; i370-ibm* | ibm*) basic_machine=i370-ibm os=-mvs ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i[34567]86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i[34567]86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i[34567]86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i[34567]86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; miniframe) basic_machine=m68000-convergent ;; mipsel*-linux*) basic_machine=mipsel-unknown os=-linux-gnu ;; mips*-linux*) basic_machine=mips-unknown os=-linux-gnu ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; np1) basic_machine=np1-gould ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pentium | p5 | k5 | nexen) basic_machine=i586-pc ;; pentiumpro | p6 | k6 | 6x86) basic_machine=i686-pc ;; pentiumii | pentium2) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | nexen-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | k6-* | 6x86-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=rs6000-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; symmetry) basic_machine=i386-sequent os=-dynix ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; tower | tower-32) basic_machine=m68k-ncr ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; xmp) basic_machine=xmp-cray os=-unicos ;; xps | xps100) basic_machine=xps100-honeywell ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. mips) if [ x$os = x-linux-gnu ]; then basic_machine=mips-unknown else basic_machine=mips-mips fi ;; romp) basic_machine=romp-ibm ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sparc) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -cygwin32* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -uxpv* | -beos*) # Remember, each alternative MUST END IN *, to match a version number. ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -ctix* | -uts*) os=-sysv ;; -ns2 ) os=-nextstep2 ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -xenix) os=-xenix ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in *-acorn) os=-riscix1.2 ;; arm*-semi) os=-aout ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-ibm) os=-aix ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f301-fujitsu) os=-uxpv ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -hpux*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs*) vendor=ibm ;; -ptx*) vendor=sequent ;; -vxsim* | -vxworks*) vendor=wrs ;; -aux*) vendor=apple ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os setserial-2.17/config.guess0100700003667600001450000006410306620730256015401 0ustar tytsoconsole#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc. # # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Written by Per Bothner . # The master version of this file is at the FSF in /home/gd/gnu/lib. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit system type (host/target name). # # Only a few systems have been added to this list; please add others # (but try to keep the structure clean). # # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 8/24/94.) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15 # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in alpha:OSF1:*:*) if test $UNAME_RELEASE = "V4.0"; then UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` fi # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. cat <dummy.s .globl main .ent main main: .frame \$30,0,\$26,0 .prologue 0 .long 0x47e03d80 # implver $0 lda \$2,259 .long 0x47e20c21 # amask $2,$1 srl \$1,8,\$2 sll \$2,2,\$2 sll \$0,3,\$0 addl \$1,\$0,\$0 addl \$2,\$0,\$0 ret \$31,(\$26),1 .end main EOF ${CC-cc} dummy.s -o dummy 2>/dev/null if test "$?" = 0 ; then ./dummy case "$?" in 7) UNAME_MACHINE="alpha" ;; 15) UNAME_MACHINE="alphaev5" ;; 14) UNAME_MACHINE="alphaev56" ;; 10) UNAME_MACHINE="alphapca56" ;; 16) UNAME_MACHINE="alphaev6" ;; esac fi rm -f dummy.s dummy echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr [[A-Z]] [[a-z]]` exit 0 ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit 0 ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-cbm-sysv4 exit 0;; amiga:NetBSD:*:*) echo m68k-cbm-netbsd${UNAME_RELEASE} exit 0 ;; amiga:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit 0 ;; arc64:OpenBSD:*:*) echo mips64el-unknown-openbsd${UNAME_RELEASE} exit 0 ;; arc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; hkmips:OpenBSD:*:*) echo mips-unknown-openbsd${UNAME_RELEASE} exit 0 ;; pmax:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sgi:OpenBSD:*:*) echo mips-unknown-openbsd${UNAME_RELEASE} exit 0 ;; wgrisc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit 0;; arm32:NetBSD:*:*) echo arm-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` exit 0 ;; SR2?01:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit 0;; 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 0 ;; NILE:*:*:dcosx) echo pyramid-pyramid-svr4 exit 0 ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; i86pc:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; 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 0 ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit 0 ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit 0 ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit 0 ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit 0 ;; atari*:NetBSD:*:*) echo m68k-atari-netbsd${UNAME_RELEASE} exit 0 ;; atari*:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sun3*:NetBSD:*:*) echo m68k-sun-netbsd${UNAME_RELEASE} exit 0 ;; sun3*:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mac68k:NetBSD:*:*) echo m68k-apple-netbsd${UNAME_RELEASE} exit 0 ;; mac68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme88k:OpenBSD:*:*) echo m88k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit 0 ;; macppc:NetBSD:*:*) echo powerpc-apple-netbsd${UNAME_RELEASE} exit 0 ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit 0 ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit 0 ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit 0 ;; 2020:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit 0 ;; mips:*:*:UMIPS | mips:*:*:RISCos) sed 's/^ //' << EOF >dummy.c int main (argc, argv) int argc; char **argv; { #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF ${CC-cc} dummy.c -o dummy \ && ./dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ && rm dummy.c dummy && exit 0 rm -f dummy.c dummy echo mips-mips-riscos${UNAME_RELEASE} exit 0 ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit 0 ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit 0 ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit 0 ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit 0 ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \ -o ${TARGET_BINARY_INTERFACE}x = x ] ; then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit 0 ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit 0 ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit 0 ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit 0 ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit 0 ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit 0 ;; ????????: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 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i?86:AIX:*:*) echo i386-ibm-aix exit 0 ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then sed 's/^ //' << EOF >dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0 rm -f dummy.c dummy echo rs6000-ibm-aix3.2.5 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit 0 ;; *:AIX:*:4) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'` if /usr/sbin/lsattr -EHl ${IBM_CPU_ID} | grep POWER >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=4.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit 0 ;; *:AIX:*:*) echo rs6000-ibm-aix exit 0 ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit 0 ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC NetBSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit 0 ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit 0 ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit 0 ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit 0 ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit 0 ;; 9000/[34678]??:HP-UX:*:*) case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/6?? | 9000/7?? | 9000/80[24] | 9000/8?[13679] | 9000/892 ) sed 's/^ //' << EOF >dummy.c #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF ${CC-cc} dummy.c -o dummy && HP_ARCH=`./dummy` rm -f dummy.c dummy esac HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit 0 ;; 3050*:HI-UX:*:*) sed 's/^ //' << EOF >dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0 rm -f dummy.c dummy echo unknown-hitachi-hiuxwe2 exit 0 ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit 0 ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit 0 ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit 0 ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit 0 ;; i?86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit 0 ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit 0 ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit 0 ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit 0 ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit 0 ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit 0 ;; CRAY*X-MP:*:*:*) echo xmp-cray-unicos exit 0 ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} exit 0 ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ exit 0 ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} exit 0 ;; CRAY-2:*:*:*) echo cray2-cray-unicos exit 0 ;; F300:UNIX_System_V:*:*) FUJITSU_SYS=`uname -p | tr [A-Z] [a-z] | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit 0 ;; F301:UNIX_System_V:*:*) echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'` exit 0 ;; hp3[0-9][05]:NetBSD:*:*) echo m68k-hp-netbsd${UNAME_RELEASE} exit 0 ;; hp300:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit 0 ;; i?86:BSD/386:*:* | *:BSD/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit 0 ;; *:FreeBSD:*:*) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit 0 ;; *:NetBSD:*:*) echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` exit 0 ;; *:OpenBSD:*:*) echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` exit 0 ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin32 exit 0 ;; i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit 0 ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin32 exit 0 ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; *:GNU:*:*) echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit 0 ;; *:Linux:*:*) # uname on the ARM produces all sorts of strangeness, and we need to # filter it out. case "$UNAME_MACHINE" in arm* | sa110*) UNAME_MACHINE="arm" ;; esac # The BFD linker knows what the default object file format is, so # first see if it will tell us. ld_help_string=`ld --help 2>&1` ld_supported_emulations=`echo $ld_help_string \ | sed -ne '/supported emulations:/!d s/[ ][ ]*/ /g s/.*supported emulations: *// s/ .*// p'` case "$ld_supported_emulations" in i?86linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0 ;; i?86coff) echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0 ;; sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; armlinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; m68klinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; elf32ppc) echo "powerpc-unknown-linux-gnu" ; exit 0 ;; esac if test "${UNAME_MACHINE}" = "alpha" ; then sed 's/^ //' <dummy.s .globl main .ent main main: .frame \$30,0,\$26,0 .prologue 0 .long 0x47e03d80 # implver $0 lda \$2,259 .long 0x47e20c21 # amask $2,$1 srl \$1,8,\$2 sll \$2,2,\$2 sll \$0,3,\$0 addl \$1,\$0,\$0 addl \$2,\$0,\$0 ret \$31,(\$26),1 .end main EOF LIBC="" ${CC-cc} dummy.s -o dummy 2>/dev/null if test "$?" = 0 ; then ./dummy case "$?" in 7) UNAME_MACHINE="alpha" ;; 15) UNAME_MACHINE="alphaev5" ;; 14) UNAME_MACHINE="alphaev56" ;; 10) UNAME_MACHINE="alphapca56" ;; 16) UNAME_MACHINE="alphaev6" ;; esac objdump --private-headers dummy | \ grep ld.so.1 > /dev/null if test "$?" = 0 ; then LIBC="libc1" fi fi rm -f dummy.s dummy echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0 elif test "${UNAME_MACHINE}" = "mips" ; then cat >dummy.c </dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0 rm -f dummy.c dummy else # Either a pre-BFD a.out linker (linux-gnuoldld) # or one that does not give us useful --help. # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout. # If ld does not provide *any* "supported emulations:" # that means it is gnuoldld. echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:" test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0 case "${UNAME_MACHINE}" in i?86) VENDOR=pc; ;; *) VENDOR=unknown; ;; esac # Determine whether the default compiler is a.out or elf cat >dummy.c < main(argc, argv) int argc; char *argv[]; { #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 printf ("%s-${VENDOR}-linux-gnu\n", argv[1]); # else printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); # endif # else printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); # endif #else printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]); #endif return 0; } EOF ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0 rm -f dummy.c dummy fi ;; # 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. i?86:DYNIX/ptx:4*:*) echo i386-sequent-sysv4 exit 0 ;; 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 0 ;; i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*) if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE} fi exit 0 ;; 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|egrep Release|sed -e 's/.*= //')` (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit 0 ;; i?86:UnixWare:*:*) if /bin/uname -X 2>/dev/null >/dev/null ; then (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 fi echo ${UNAME_MACHINE}-unixware-${UNAME_RELEASE}-${UNAME_VERSION} exit 0 ;; pc:*:*:*) # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp exit 0 ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit 0 ;; paragon:*:*:*) echo i860-intel-osf1 exit 0 ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit 0 ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit 0 ;; M68*:*:R3V[567]*:*) test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; 3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4.3${OS_REL} && exit 0 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4 && exit 0 ;; m68*:LynxOS:2.*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit 0 ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit 0 ;; i?86:LynxOS:2.*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit 0 ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit 0 ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit 0 ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit 0 ;; PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit 0 ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit 0 ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit 0 ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit 0 ;; news*:NEWS-OS:*:6*) echo mips-sony-newsos6 exit 0 ;; R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R4000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit 0 ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit 0 ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit 0 ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit 0 ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 cat >dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) #if !defined (ultrix) printf ("vax-dec-bsd\n"); exit (0); #else printf ("vax-dec-ultrix\n"); exit (0); #endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm dummy.c dummy && exit 0 rm -f dummy.c dummy # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit 0 ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; c34*) echo c34-convex-bsd exit 0 ;; c38*) echo c38-convex-bsd exit 0 ;; c4*) echo c4-convex-bsd exit 0 ;; esac fi #echo '(Unable to guess system type)' 1>&2 exit 1 setserial-2.17/setserial.80100644003667600366760000004230607044062470014717 0ustar tytsotytso.\" Copyright 1992, 1993 Rickard E. Faith (faith@cs.unc.edu) .\" May be distributed under the GNU General Public License .\" Portions of this text are from the README in setserial-2.01.tar.z, .\" but I can't figure out who wrote that document. If anyone knows, .\" please tell me .\" .\" [tytso:19940519.2239EDT] I did... - Ted Ts'o (tytso@mit.edu) .\" .TH SETSERIAL 8 "January 2000" "Setserial 2.17 .SH NAME setserial \- get/set Linux serial port information .SH SYNOPSIS .B setserial .B "[ \-abqvVWz ]" device .BR "[ " parameter1 " [ " arg " ] ] ..." .B "setserial -g" .B "[ \-abGv ]" device1 ... .SH DESCRIPTION .B setserial is a program designed to set and/or report the configuration information associated with a serial port. This information includes what I/O port and IRQ a particular serial port is using, and whether or not the break key should be interpreted as the Secure Attention Key, and so on. During the normal bootup process, only COM ports 1-4 are initialized, using the default I/O ports and IRQ values, as listed below. In order to initialize any additional serial ports, or to change the COM 1-4 ports to a nonstadard configuration, the .B setserial program should be used. Typically it is called from an .I rc.serial script, which is usually run out of .IR /etc/rc.local . The .I device argument or arguments specifies the serial device which should be configured or interrogated. It will usually have the following form: .BR /dev/cua[0-3] . If no parameters are specified, .B setserial will print out the port type (i.e., 8250, 16450, 16550, 16550A, etc.), the hardware I/O port, the hardware IRQ line, its "baud base," and some of its operational flags. If the .B \-g option is given, the arguments to setserial are interpreted as a list of devices for which the characteristics of those devices should be printed. Without the .B \-g option, the first argument to setserial is interpreted as the device to be modified or characteristics to be printed, and any additional arguments are interpreted as parameters which should be assigned to that serial device. For the most part, superuser privilege is required to set the configuration parameters of a serial port. A few serial port parameters can be set by normal users, however, and these will be noted as exceptions in this manual page. .SH OPTIONS .B Setserial accepts the following options: .TP .B \-a When reporting the configuration of a serial device, print all available information. .TP .B \-b When reporting the configuration of a serial device, print a summary of the device's configuration, which might be suitable for printing during the bootup process, during the /etc/rc script. .TP .B \-G Print out the configuration information of the serial port in a form which can be fed back to setserial as command-line arguments. .TP .B \-q Be quiet. .B Setserial will print fewer lines of output. .TP .B \-v Be verbose. .B Setserial will print additional status output. .TP .B \-V Display version and exit. .TP .B \-W Do wild interrupt initialization and exit. This option is no longer relevant in Linux kernels after version 2.1. .TP .B \-z Zero out the serial flags before starting to set flags. This is related to the automatic saving of serial flags using the \-G flag. .SH PARAMETERS The following parameters can be assigned to a serial port. All argument values are assumed to be in decimal unless preceeded by "0x". .TP .BR port " port_number" The .B port option sets the I/O port, as described above. .TP .BR irq " irq_number" The .B irq option sets the hardware IRQ, as described above. .TP .BR uart " uart_type" This option is used to set the UART type. The permitted types are .BR none , 8250, 16450, 16550, 16550A, 16650, 16650V2, 16654, 16750, 16850, 16950, and 16954. Using UART type .B none will disable the port. Some internal modems are billed as having a "16550A UART with a 1k buffer". This is a lie. They do not have really have a 16550A compatible UART; instead what they have is a 16450 compatible UART with a 1k receive buffer to prevent receiver overruns. This is important, because they do not have a transmit FIFO. Hence, they are not compatible with a 16550A UART, and the autoconfiguration process will correctly identify them as 16450's. If you attempt to override this using the .B uart parameter, you will see dropped characters during file transmissions. These UART's usually have other problems: the .B skip_test parameter also often must be specified. .TP .B autoconfig When this parameter is given, .B setserial will ask the kernel to attempt to automatically configure the serial port. The I/O port must be correctly set; the kernel will attempt to determine the UART type, and if the .B auto_irq parameter is set, Linux will attempt to automatically determine the IRQ. The .B autoconfig parameter should be given after the .BR port , auto_irq ", and " skip_test parameters have been specified. .TP .B auto_irq During autoconfiguration, try to determine the IRQ. This feature is not guaranteed to always produce the correct result; some hardware configurations will fool the Linux kernel. It is generally safer not to use the .B auto_irq feature, but rather to specify the IRQ to be used explicitly, using the .B irq parameter. .TP .B ^auto_irq During autoconfiguration, do .I not try to determine the IRQ. .TP .B skip_test During autoconfiguration, skip the UART test. Some internal modems do not have National Semiconductor compatible UART's, but have cheap imitations instead. Some of these cheasy imitations UART's do not fully support the loopback detection mode, which is used by the kernel to make sure there really is a UART at a particular address before attempting to configure it. So for certain internal modems you will need to specify this parameter so Linux can initialize the UART correctly. .TP .B ^skip_test During autoconfiguration, do .I not skip the UART test. .TP .BR baud_base " baud_base" This option sets the base baud rate, which is the clock frequency divided by 16. Normally this value is 115200, which is also the fastest baud rate which the UART can support. .TP .B spd_hi Use 57.6kb when the application requests 38.4kb. This parameter may be specified by a non-privileged user. .TP .B spd_vhi Use 115kb when the application requests 38.4kb. This parameter may be specified by a non-privileged user. .TP .B spd_shi Use 230kb when the application requests 38.4kb. This parameter may be specified by a non-privileged user. .TP .B spd_warp Use 460kb when the application requests 38.4kb. This parameter may be specified by a non-privileged user. .TP .B spd_cust Use the custom divisor to set the speed when the application requests 38.4kb. In this case, the baud rate is the .B baud_base divided by the .BR divisor . This parameter may be specified by a non-privileged user. .TP .B spd_normal Use 38.4kb when the application requests 38.4kb. This parameter may be specified by a non-privileged user. .TP .BR divisor " divisor" This option sets the custom divison. This divisor will be used then the .B spd_cust option is selected and the serial port is set to 38.4kb by the application. This parameter may be specified by a non-privileged user. .TP .B sak Set the break key at the Secure Attention Key. .TP .B ^sak disable the Secure Attention Key. .TP .B fourport Configure the port as an AST Fourport card. .TP .B ^fourport Disable AST Fourport configuration. .TP .BR close_delay " delay" Specify the amount of time, in hundredths of a second, that DTR should remain low on a serial line after the callout device is closed, before the blocked dialin device raises DTR again. The default value of this option is 50, or a half-second delay. .TP .BR closing_wait " delay" Specify the amount of time, in hundredths of a second, that the kernel should wait for data to be transmitted from the serial port while closing the port. If "none" is specified, no delay will occur. If "infinite" is specified the kernel will wait indefinitely for the buffered data to be transmitted. The default setting is 3000 or 30 seconds of delay. This default is generally appropriate for most devices. If too long a delay is selected, then the serial port may hang for a long time if when a serial port which is not connected, and has data pending, is closed. If too short a delay is selected, then there is a risk that some of the transmitted data is output at all. If the device is extremely slow, like a plotter, the closing_wait may need to be larger. .TP .B session_lockout Lock out callout port (/dev/cuaXX) accesses across different sessions. That is, once a process has opened a port, do not allow a process with a different session ID to open that port until the first process has closed it. .TP .B ^session_lockout Do not lock out callout port accesses across different sessions. .TP .B pgrp_lockout Lock out callout port (/dev/cuaXX) accesses across different process groups. That is, once a process has opened a port, do not allow a process in a different process group to open that port until the first process has closed it. .TP .B ^pgrp_lockout Do not lock out callout port accesses across different process groups. .TP .B hup_notify Notify a process blocked on opening a dial in line when a process has finished using a callout line (either by closing it or by the serial line being hung up) by returning EAGAIN to the open. The application of this parameter is for getty's which are blocked on a serial port's dial in line. This allows the getty to reset the modem (which may have had its configuration modified by the application using the callout device) before blocking on the open again. .TP .B ^hup_notify Do not notify a process blocked on opening a dial in line when the callout device is hung up. .TP .B split_termios Treat the termios settings used by the callout device and the termios settings used by the dialin devices as separate. .TP .B ^split_termios Use the same termios structure to store both the dialin and callout ports. This is the default option. .TP .B callout_nohup If this particular serial port is opened as a callout device, do not hangup the tty when carrier detect is dropped. .TP .B ^callout_nohup Do not skip hanging up the tty when a serial port is opened as a callout device. Of course, the HUPCL termios flag must be enabled if the hangup is to occur. .TP .B low_latency Minimize the receive latency of the serial device at the cost of greater CPU utilization. (Normally there is an average of 5-10ms latency before characters are handed off to the line discpline to minimize overhead.) This is off by default, but certain real-time applications may find this useful. .TP .B ^low_latency Optimize for efficient CPU processing of serial characters at the cost of paying an average of 5-10ms of latency before the characters are processed. This is the default. .SH CONSIDERATIONS OF CONFIGURING SERIAL PORTS It is important to note that setserial merely tells the Linux kernel where it should expect to find the I/O port and IRQ lines of a particular serial port. It does *not* configure the hardware, the actual serial board, to use a particular I/O port. In order to do that, you will need to physically program the serial board, usually by setting some jumpers or by switching some DIP switches. This section will provide some pointers in helping you decide how you would like to configure your serial ports. The "standard MS-DOS" port associations are given below: .nf .RS /dev/ttys0 (COM1), port 0x3f8, irq 4 /dev/ttys1 (COM2), port 0x2f8, irq 3 /dev/ttys2 (COM3), port 0x3e8, irq 4 /dev/ttys3 (COM4), port 0x2e8, irq 3 .RE .fi Due to the limitations in the design of the AT/ISA bus architecture, normally an IRQ line may not be shared between two or more serial ports. If you attempt to do this, one or both serial ports will become unreliable if you try to use both simultaneously. This limitation can be overcome by special multi-port serial port boards, which are designed to share multiple serial ports over a single IRQ line. Multi-port serial cards supported by Linux include the AST FourPort, the Accent Async board, the Usenet Serial II board, the Bocaboard BB-1004, BB-1008, and BB-2016 boards, and the HUB-6 serial board. The selection of an alternative IRQ line is difficult, since most of them are already used. The following table lists the "standard MS-DOS" assignments of available IRQ lines: .nf .RS IRQ 3: COM2 IRQ 4: COM1 IRQ 5: LPT2 IRQ 7: LPT1 .RE .fi Most people find that IRQ 5 is a good choice, assuming that there is only one parallel port active in the computer. Another good choice is IRQ 2 (aka IRQ 9); although this IRQ is sometimes used by network cards, and very rarely VGA cards will be configured to use IRQ 2 as a vertical retrace interrupt. If your VGA card is configured this way; try to disable it so you can reclaim that IRQ line for some other card. It's not necessary for Linux and most other Operating systems. The only other available IRQ lines are 3, 4, and 7, and these are probably used by the other serial and parallel ports. (If your serial card has a 16bit card edge connector, and supports higher interrupt numbers, then IRQ 10, 11, 12, and 15 are also available.) On AT class machines, IRQ 2 is seen as IRQ 9, and Linux will interpret it in this manner. IRQ's other than 2 (9), 3, 4, 5, 7, 10, 11, 12, and 15, should .I not be used, since they are assigned to other hardware and cannot, in general, be changed. Here are the "standard" assignments: .nf .RS IRQ 0 Timer channel 0 IRQ 1 Keyboard IRQ 2 Cascade for controller 2 IRQ 3 Serial port 2 IRQ 4 Serial port 1 IRQ 5 Parallel port 2 (Reserved in PS/2) IRQ 6 Floppy diskette IRQ 7 Parallel port 1 IRQ 8 Real-time clock IRQ 9 Redirected to IRQ2 IRQ 10 Reserved IRQ 11 Reserved IRQ 12 Reserved (Auxillary device in PS/2) IRQ 13 Math coprocessor IRQ 14 Hard disk controller IRQ 15 Reserved .RE .fi .SH MULTIPORT CONFIGURATION Certain multiport serial boards which share multiple ports on a single IRQ use one or more ports to indicate whether or not there are any pending ports which need to be serviced. If your multiport board supports these ports, you should make use of them to avoid potential lockups if the interrupt gets lost. In order to set these ports specify .B set_multiport as a parameter, and follow it with the multiport parameters. The multiport parameters take the form of specifying the .I port that should be checked, a .I mask which indicate which bits in the register are significant, and finally, a .I match parameter which specifies what the significant bits in that register must match when there is no more pending work to be done. Up to four such port/mask/match combinations may be specified. The first such combinations should be specified by setting the parameters .BR port1 , .BR mask1 , and .BR match1 . The second such combination should be specified with .BR port2 , .BR mask2 , and .BR match2 , and so on. In order to disable this multiport checking, set .B port1 to be zero. In order to view the current multiport settings, specify the parameter .B get_multiport on the command line. Here are some multiport settings for some common serial boards: .nf .RS AST FourPort port1 0x1BF mask1 0xf match1 0xf Boca BB-1004/8 port1 0x107 mask1 0xff match1 0 Boca BB-2016 port1 0x107 mask1 0xff match1 0 port2 0x147 mask2 0xff match2 0 .RE .fi .SH Hayes ESP Configuration .B Setserial may also be used to configure ports on a Hayes ESP serial board. .PP The following parameters when configuring ESP ports: .TP .B rx_trigger This is the trigger level (in bytes) of the receive FIFO. Larger values may result in fewer interrupts and hence better performance; however, a value too high could result in data loss. Valid values are 1 through 1023. .TP .B tx_trigger This is the trigger level (in bytes) of the transmit FIFO. Larger values may result in fewer interrupts and hence better performance; however, a value too high could result in degraded transmit performance. Valid values are 1 through 1023. .TP .B flow_off This is the level (in bytes) at which the ESP port will "flow off" the remote transmitter (i.e. tell him to stop stop sending more bytes). Valid values are 1 through 1023. This value should be greater than the receive trigger level and the flow on level. .TP .B flow_on This is the level (in bytes) at which the ESP port will "flow on" the remote transmitter (i.e. tell him to resume sending bytes) after having flowed it off. Valid values are 1 through 1023. This value should be less than the flow off level, but greater than the receive trigger level. .TP .B rx_timeout This is the amount of time that the ESP port will wait after receiving the final character before signaling an interrupt. Valid values are 0 through 255. A value too high will increase latency, and a value too low will cause unnecessary interrupts. .SH CAUTION CAUTION: Configuring a serial port to use an incorrect I/O port can lock up your machine. .SH FILES .BR /etc/rc.local .BR /etc/rc.serial .SH "SEE ALSO" .BR tty (4), .BR ttys (4), kernel/chr_drv/serial.c .SH AUTHOR The original version of setserial was written by Rick Sladkey (jrs@world.std.com), and was modified by Michael K. Johnson (johnsonm@stolaf.edu). This version has since been rewritten from scratch by Theodore Ts'o (tytso@mit.edu) on 1/1/93. Any bugs or problems are solely his responsibility. setserial-2.17/Makefile.in0100600003667600366760000000463007044063233014664 0ustar tytsotytso# setserial.mk - makefile for setserial - rick sladkey # modified by Michael K. Johnson, johnsonm@stolaf.edu srcdir = @srcdir@ VPATH = @srcdir@ VERSION = @RELEASE_VERSION@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ STRIP = @STRIP@ CC = @CC@ RM = rm -f CFLAGS = @CFLAGS@ DEFS = @DEFS@ INCS = -I. TAR = tar all: setserial setserial.cat setserial: setserial.c $(CC) $(CFLAGS) $(DEFS) $(INCS) setserial.c -o setserial setserial.cat: setserial.8 nroff -man setserial.8 > setserial.cat install: setserial setserial.8 $(INSTALL_PROGRAM) setserial $(DESTDIR)/bin $(STRIP) $(DESTDIR)/bin/setserial $(INSTALL_DATA) setserial.8 $(DESTDIR)/usr/man/man8 clean: $(RM) setserial setserial.o setserial.cat *~ distclean: clean $(RM) config.status config.log config.cache MCONFIG Makefile \ setserial.8 realclean: distclean $(RM) configure SRCROOT = `echo setserial-$(VERSION) | sed -e 's/-WIP//' \ -e 's/pre-//' -e 's/-PLUS//'` $(srcdir)/.exclude-file: a=$(SRCROOT); \ (cd $(srcdir)/.. ; find setserial \( -name \*~ -o -name \*.orig \ -o -name CVS -o -name \*.rej \) -print) \ | sed -e "s/setserial/$$a/" > $(srcdir)/.exclude-file echo "$(SRCROOT)/Makefile" >> $(srcdir)/.exclude-file echo "$(SRCROOT)/build" >> $(srcdir)/.exclude-file echo "$(SRCROOT)/Attic" >> $(srcdir)/.exclude-file echo "$(SRCROOT)/rpm.log" >> $(srcdir)/.exclude-file echo "$(SRCROOT)/config.log" >> $(srcdir)/.exclude-file echo "$(SRCROOT)/config.cache" >> $(srcdir)/.exclude-file echo "$(SRCROOT)/config.status" >> $(srcdir)/.exclude-file echo "$(SRCROOT)/setserial" >> $(srcdir)/.exclude-file echo "$(SRCROOT)/setserial.cat" >> $(srcdir)/.exclude-file echo "$(SRCROOT)/setserial.o" >> $(srcdir)/.exclude-file echo "$(SRCROOT)/.exclude-file" >> $(srcdir)/.exclude-file echo $(SRCROOT)/e2fsprogs-$(VERSION).tar.gz \ >> $(srcdir)/.exclude-file source_tar_file: $(srcdir)/.exclude-file (cd $(srcdir)/..; a=$(SRCROOT); rm -f $$a ; ln -sf setserial $$a ; \ $(TAR) -c -h -v -f - \ -X $$a/.exclude-file $$a | \ gzip -9 > setserial-$(VERSION).tar.gz) rm -f $(srcdir)/.exclude-file $(srcdir)/../setserial-$(VERSION) ${srcdir}/configure: configure.in # aclocal.m4 cd ${srcdir} && autoconf Makefile: Makefile.in config.status CONFIG_FILES=Makefile ./config.status setserial.8: setserial.8.in config.status CONFIG_FILES=setserial.8 ./config.status config.status: configure ./config.status --recheck setserial-2.17/Documentation/0040755003667600366760000000000007044056570015446 5ustar tytsotytsosetserial-2.17/Documentation/byterunner-setup0100644003667600366760000000777406772750424020746 0ustar tytsotytso Thanks to Cokey, Maurice, de Paul, and Ted (maintainer of setserial) . Your help has been invaluable. Just another proof that free software rules! To-do: a bit experiment to do with more irq on the same board. Just to be able to see more consoles at the same time. ================part console output to /dev/ttyS0============= 1.rm /etc/ioctl.save (to erase the recorded term charasteristics. Could be at a different speed than what you want) 2.joe /etc/inittab: 1:2345:respawn:/sbin/mingetty tty1 2:2345:respawn:/sbin/mingetty tty2 3:2345:respawn:/sbin/mingetty tty3 4:2345:respawn:/sbin/mingetty tty4 5:2345:respawn:/sbin/mingetty tty5 6:2345:respawn:/sbin/mingetty tty6 #S0:2345:respawn:/sbin/mingetty ttyS0 #S1:2345:respawn:/sbin/mingetty ttyS1 S0:2345:respawn:/sbin/getty ttyS0 DT9600 vt100 # The DT9600 is in /etc/gettydefs, and there # are others. But the F9600 doesn't work # too well. With the working Apple powerbook # and ZTerm in from serial port to serial port, # only gets echo out. Cannot get Apple keyboard # input 3.init q init Q (well, not sure, so run both. This is to tell init to read the updated inittab:P) 4.in /etc/lilo.conf: boot=/dev/rd/c0d0 map=/boot/map install=/boot/boot.b prompt timeout=50 serial=0,9600n8 image=/boot/vmlinuz-2.2.5-15 label=abyx_ttyS0 root=/dev/rd/c0d0p1 password="" initrd=/boot/initrd-2.2.5-15.img append="console=tty0 console=ttyS0,9600" read-only image=/boot/vmlinuz-2.2.5-15 label=linux_tty0 root=/dev/rd/c0d0p1 password="" initrd=/boot/initrd-2.2.5-15.img append="console=ttyS0,9600 console=tty0" read-only 5.Run lilo. 6.Reboot. voila. If communicating from another serial port, remember to use null-modem cable. It's just a cross-over cable that links rcpt to send, and send to rcpt and so on. =======================start part 8-port byterunner======= 0. To make the orientation right, put the board on your desk, with the RS xxx connector on the right hand side, and with jumper side of the board facing you. 1. Make sure the clock multiplier (JP 10-21) are at x1. That should be close for JP 12, 15, 18, 21. (JP 10 is at the top of the column) (my case they sent from the factory as x4. And according to the printing on board, it looks like a x1, because ther's a little 1 on the side of one of the x4 pins. That took me a long time to figure out.) 2.jumper the board for irq 10 for all 8 ports. Allow the irq 10 on another set of jumpers on bottom-left. There are on-board printed remarks for these two set of jumpers. 3.Set the blue S1 (switch) to UNIX mode 1(off, on, on, off. And yes, this time the ON mark was printed on the correct side), and the rest of the jumpers should be at default. 4.cd /dev 5.for in in 16 17 18 19 20 21 22 23; do ./MAKEDEV ttyS$i; done 6.run: setserial /dev/ttyS16 port 0x180 irq 10 uart 16550A ^fourport setserial /dev/ttyS17 port 0x188 irq 10 uart 16550A ^fourport setserial /dev/ttyS18 port 0x190 irq 10 uart 16550A ^fourport setserial /dev/ttyS19 port 0x198 irq 10 uart 16550A ^fourport setserial /dev/ttyS20 port 0x1a0 irq 10 uart 16550A ^fourport setserial /dev/ttyS21 port 0x1a8 irq 10 uart 16550A ^fourport setserial /dev/ttyS22 port 0x1b0 irq 10 uart 16550A ^fourport setserial /dev/ttyS23 port 0x1b8 irq 10 uart 16550A ^fourport setserial /dev/ttyS16 set_multiport port1 0x1c0 mask1 0xff match1 0xff (er. joe up a /etc/rc.d/rc.serial file that has these and a #!/bin/bash on the first row, and run it from rc.local. Note the mask1 shoud be the same with match1, 0xff, while 4-port models would be 0xf. Also port1 is the interrupt vector address printed on the manual. Each UNIX mode has its own. UNIX mode 0 has 0x140, mode 1 has 0x1c0, etc.) 7.And then shutdown. Plug-in card and make sure it's in the slot. 8.Boot computer. Reserve IRQ 10 for ISA in your BIOS. 9.Link the first com port on baord to ttyS0 (the console output done as above) 10.minicom -s (for /dev/ttyS16, at 9600, 8n1) voila! ================================================================== Shuo Lin Sitepak: nouvelle vision Internet pour l'entreprise http://www.sitepak.com