most-5.0.0a/0000755002657400265740000000000010671016030011655 5ustar davisdavismost-5.0.0a/src/0000755002657400265740000000000010671016030012444 5ustar davisdavismost-5.0.0a/src/Makefile.in0000644002657400265740000000636510671015731014532 0ustar davisdavisCC = @CC@ CFLAGS = @CFLAGS@ @SLANG_DLL_CFLAGS@ LDFLAGS = @LDFLAGS@ SLANG_INC = @SLANG_INC@ SLANG_LIB = @SLANG_LIB@ -lslang MISCLIBS = @TERMCAP@ RPATH = @RPATH@ #----------------------------------------------------------------------------- # Location where object files are placed (Absolute path) #----------------------------------------------------------------------------- SRCDIR = @CONFIG_DIR@/src OBJDIR = @CONFIG_DIR@/src/$(ARCH)objs #---------------------------------------------------------------------------- # 5. Install location #---------------------------------------------------------------------------- INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ DESTDIR = prefix = @prefix@ exec_prefix = @exec_prefix@ datarootdir = @datarootdir@ BIN_DIR = $(prefix)/bin MAN_DIR = $(datarootdir)/man DOC_DIR = $(datarootdir)/doc/most SYS_INITFILE = @sysconfdir@/most.conf MKINSDIR = ../autoconf/mkinsdir.sh DOC_FILES = most.doc README most-fun.txt lesskeys.rc most.rc changes.txt #---------------------------------------------------------------------------- # Nothing below here should require changing. #---------------------------------------------------------------------------- DEST_DOCDIR = $(DESTDIR)$(DOC_DIR) DEST_MANDIR = $(DESTDIR)$(MAN_DIR) DEST_BINDIR = $(DESTDIR)$(BIN_DIR) # SHELL = /bin/sh OBJS = @PROGRAM_OBJECTS@ OFILES = @PROGRAM_OFILES@ EXEC = most CONFIG_H = config.h INCS = $(SLANG_INC) ALL_CFLAGS = $(CFLAGS) -Dunix $(INCS) EXECLIBS = $(RPATH) $(SLANG_LIB) $(MISCLIBS) -lm # most_O_DEP = $(SRCDIR)/version.h UPDATE_VERSION_SCRIPT = $(HOME)/bin/update_changes_version COMPILE_CMD = $(CC) -c $(ALL_CFLAGS) -DMOST_SYSTEM_INITFILE='"$(SYS_INITFILE)"' # all: $(EXEC) $(EXEC): $(OBJDIR) $(CONFIG_H) slangversion $(OBJDIR)/$(EXEC) @echo $(EXEC) created in $(OBJDIR) $(OBJDIR)/$(EXEC): $(OBJS) cd $(OBJDIR); $(CC) $(OFILES) -o $(EXEC) $(LDFLAGS) $(EXECLIBS) # $(OBJDIR): -mkdir $(OBJDIR) # $(CONFIG_H) : $(SRCDIR)/sysconf.h /bin/cp $(SRCDIR)/sysconf.h $(CONFIG_H) # slangversion: $(OBJDIR)/chkslang $(OBJDIR)/chkslang $(EXEC) 20000 # $(OBJDIR)/chkslang: $(OBJDIR)/chkslang.o $(CC) $(OBJDIR)/chkslang.o -o $(OBJDIR)/chkslang # $(SRCDIR)/version.h: $(SRCDIR)/../changes.txt if [ -x $(UPDATE_VERSION_SCRIPT) ]; then \ $(UPDATE_VERSION_SCRIPT) $(SRCDIR)/../changes.txt $(SRCDIR)/version.h; \ fi # clean: /bin/rm -f $(OBJDIR)/* *~ distclean: clean /bin/rm -rf $(OBJDIR) Makefile sysconf.h installdirs: $(MKINSDIR) $(DEST_DOCDIR) $(MKINSDIR) $(DEST_MANDIR)/man1 $(MKINSDIR) $(DEST_BINDIR) install: all installdirs $(INSTALL) -s $(OBJDIR)/most $(DEST_BINDIR) $(INSTALL_DATA) ../most.1 $(DEST_MANDIR)/man1 @for i in $(DOC_FILES); \ do \ i=../$$i; \ echo $(INSTALL_DATA) $$i $(DEST_DOCDIR); \ $(INSTALL_DATA) $$i $(DEST_DOCDIR); \ if [ "$$?" != "0" ]; then \ exit 1; \ fi; \ done # The symlinks target is for my own private use. It simply creates the object # directory as a symbolic link to a local disk instead of an NFS mounted one. symlinks: -/bin/rm -f $(ARCH)objs mkdir -p $(HOME)/sys/$(ARCH)/objs/most/src ln -s $(HOME)/sys/$(ARCH)/objs/most/src $(ARCH)objs #--------------------------------------------------------------------------- # Rules (automatically generated) #--------------------------------------------------------------------------- most-5.0.0a/src/config.hin0000644002657400265740000000407210606342424014423 0ustar davisdavis/* -*- C -*- */ /* Note: this is for authentic unix systems only. * See mostconf.h for other systems. */ #ifndef MOST_CONFIG_H #define MOST_CONFIG_H /* Define if you want the MMAP support */ #undef USE_MMAP /* define if you have long long type */ #undef HAVE_LONG_LONG #undef off_t #undef size_t #undef SIZEOF_OFF_T #undef SIZEOF_SHORT #undef SIZEOF_INT #undef SIZEOF_LONG #undef SIZEOF_FLOAT #undef SIZEOF_DOUBLE #undef SIZEOF_LONG_LONG /* The following set defines may be necessary to activate long file support */ #undef _FILE_OFFSET_BITS #undef _LARGE_FILES #undef _LARGEFILE_SOURCE /* define if you have stdlib.h */ #undef HAVE_STDLIB_H /* define if you have unistd.h */ #undef HAVE_UNISTD_H /* define if you have memory.h */ #undef HAVE_MEMORY_H /* define if you have malloc.h */ #undef HAVE_MALLOC_H /* define if you have memset */ #undef HAVE_MEMSET /* define if you have memcpy */ #undef HAVE_MEMCPY /* define if you have this. */ #undef HAVE_GETCWD #undef HAVE_MMAP #undef HAVE_TCGETPGRP #undef HAVE_GETPGRP #undef HAVE_DIRENT_H #undef HAVE_SYS_NDIR_H #undef HAVE_SYS_DIR_H #undef HAVE_NDIR_H #undef HAVE_SNPRINTF #undef HAVE_SYS_MMAN_H #undef mode_t #undef pid_t #undef uid_t #undef pid_t #ifdef _AIX # ifndef _POSIX_SOURCE # define _POSIX_SOURCE # endif # ifndef _ALL_SOURCE # define _ALL_SOURCE # endif /* This may generate warnings but the fact is that without it, xlc will * INCORRECTLY inline many str* functions. */ # undef __STR__ #endif #define MAX_PATHLEN 1024 #if defined(USE_MMAP) && defined(HAVE_MMAP) && defined(HAVE_SYS_MMAN_H) # define MOST_HAS_MMAP 1 #else # define MOST_HAS_MMAP 0 #endif #if defined(HAVE_LONG_LONG) && (SIZEOF_OFF_T == SIZEOF_LONG_LONG) && (SIZEOF_LONG_LONG > SIZEOF_LONG) typedef long long MOST_INT; typedef unsigned long long MOST_UINT; # define MOST_INT_D_FMT "%lld" #else # if (SIZEOF_OFF_T == SIZEOF_INT) typedef int MOST_INT; typedef unsigned int MOST_UINT; # define MOST_INT_D_FMT "%d" # else typedef long MOST_INT; typedef unsigned long MOST_UINT; # define MOST_INT_D_FMT "%ld" # endif #endif #endif /* MOST_CONFIG_H */ most-5.0.0a/src/keym.c0000644002657400265740000005316310630436657013605 0ustar davisdavis/* This file is part of MOST. Copyright (c) 1991, 1999, 2002, 2005, 2006, 2007 John E. Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "config.h" #include #include #include #include "jdmacros.h" #include "most.h" #include "keym.h" #include "display.h" #include "window.h" #include "search.h" #include "edit.h" #include "sysdep.h" #include "file.h" #include "keyparse.h" int *Most_Digit_Arg; static char Last_Char; static int Edt_Direction = 1; static void digit_arg_cmd(void); static void page_down_cmd (void) { int n = 1; if (Most_Digit_Arg != (int *) NULL) n = *Most_Digit_Arg; if (n < 0) n = 1; n = Most_C_Line + n * (Most_Win->bot - Most_Win->top + 1); most_read_to_line (n + 50); most_update_windows (n); } static void page_up_cmd (void) { int n = 1; if (Most_Digit_Arg != (int *) NULL) n = *Most_Digit_Arg; n = Most_C_Line - n * (Most_Win->bot - Most_Win->top + 1); if (n < 1) n = 1; most_update_windows (n); } static void page_right_cmd (void) { int n = 1; if (Most_Digit_Arg != (int *) NULL) n = *Most_Digit_Arg; Most_Column = Most_Column + n * 59; most_update_windows(Most_C_Line); } static void page_left_cmd(void) { int n = 1; if (Most_Digit_Arg != (int *) NULL) n = *Most_Digit_Arg; Most_Column = Most_Column - n * 59; most_update_windows(Most_C_Line); } static void column_right_cmd (void) { int n = 1; if (Most_Digit_Arg != (int *) NULL) n = *Most_Digit_Arg; Most_Column = Most_Column + n; most_update_windows(Most_C_Line); } static void column_left_cmd(void) { int n = 1; if (Most_Digit_Arg != (int *) NULL) n = *Most_Digit_Arg; Most_Column = Most_Column - n; most_update_windows(Most_C_Line); } static void next_line_cmd(void) { int n = 1; if (Most_Digit_Arg != (int *) NULL) n = *Most_Digit_Arg; most_read_to_line (Most_C_Line + n + 50); most_update_windows(Most_C_Line + n); } static void previous_line_cmd(void) { int n = 1; if (Most_Digit_Arg != (int *) NULL) n = *Most_Digit_Arg; most_update_windows(Most_C_Line - n); } static void tail_mode_cmd (void) { Most_Tail_Mode = 1; do { if (0 != most_read_file_dsc (-1)) most_update_windows (-1); most_message ("Most Tail Mode-- MOST keys are still active.", 0); most_put_message (); most_point_cursor (); SLsmg_refresh (); } while (0 == SLang_input_pending (15)); Most_Tail_Mode = 0; } static void top_of_buffer_cmd(void) { most_update_windows(1); } static void end_of_buffer_cmd(void) { while ((Most_Buf->fd != -1) && (0 != most_read_file_dsc(-1))) ; most_update_windows (-1); } #ifdef unix # include #endif static void sys_spawn_cmd(void) { #ifdef IBMPC_SYSTEM most_message ("Not implemented.", 1); #else int update = 0; # ifndef VMS static int can_suspend = -1; if (can_suspend == -1) { can_suspend = 0; # ifdef SIGTSTP if (SIG_DFL == SLsignal (SIGTSTP, SIG_DFL)) can_suspend = 1; # endif } if (can_suspend == 0) { most_message ("Shell forbids suspension.", 1); return; } # endif if (Most_Secure_Mode || Most_Captive_Mode) { most_message ("Operation not permitted by this account.", 1); return; } most_reset_tty(); most_reset_display(); # ifdef VMS if (Last_Char == '\032') exit(0); if (most_do_shell_command()) update = 1; /* scroll region reset by message facility */ # else # ifdef SIGTSTP kill(0, SIGTSTP); # endif update = 1; # endif most_init_tty(); most_init_display (); if (update) most_redraw_display(); #endif /* IBMPC_SYSTEM */ } static void redraw_cmd(void) { most_redraw_display(); } static int read_integer (char *prompt, MOST_INT *n) { int status; Most_Mini_Buf[0] = 0; status = most_read_from_minibuffer(prompt, NULL, (char *) Most_Mini_Buf, MOST_MINI_BUF_LEN); if (status < 0) return -1; if (1 != sscanf((char *) Most_Mini_Buf, MOST_INT_D_FMT, n)) { most_message ("Expecting an integer", 1); return -1; } Most_Mini_Buf[0] = 0; return 0; } static void goto_line_cmd(void) { MOST_INT n; if (Most_Digit_Arg != (int *) NULL) n = *Most_Digit_Arg; else { if (-1 == read_integer ("Goto Line: ", &n)) return; } most_update_windows ((int)n); } static void goto_percent_cmd(void) { unsigned char *pos; MOST_INT n; if (Most_Digit_Arg != NULL) n = *Most_Digit_Arg; else { if (-1 == read_integer ("Goto Percent: ", &n)) return; } if (n < 0) n = 0; else if (n > 100) n = 100; if (Most_Buf->fd != -1) most_read_file_dsc(-1); pos = Most_Beg + (n * (Most_Eob - Most_Beg))/100; n = most_what_line(pos); most_update_windows (n); } static void set_mark_cmd(void) { Most_Buf->mark = Most_C_Line; most_message("Mark Set.",0); } static void goto_mark_cmd(void) { int mark = Most_Buf->mark; Most_Buf->mark = Most_C_Line; most_update_window(mark); most_message("Mark Set.",0); } static void one_window_cmd(void) { most_one_window(); } static void two_window_cmd(void) { most_two_windows(); } static void del_window_cmd(void) { most_delete_window(); } static void other_window_cmd(void) { int n = 1; if (Most_Digit_Arg != (int *) NULL) n = *Most_Digit_Arg; most_other_window(n); } static void find_next_cmd(void) { MOST_INT col, line, n = 1; unsigned long ofs; if (Most_Digit_Arg != NULL) n = *Most_Digit_Arg; line = most_search ((Most_Beg + Most_Curs_Offset) + Most_Search_Dir, n, &col); if (line < 1) return; ofs = Most_Curs_Offset; if ((line < Most_Win->beg_line) || (line > Most_Win->beg_line + Most_Win->bot - Most_Win->top)) most_update_window(line); Most_Curs_Offset = ofs; Most_Curs_Row = line - Most_C_Line + 1; Most_Curs_Col = col; } static void find_next_opposite_dir_cmd (void) { Most_Search_Dir = -Most_Search_Dir; find_next_cmd (); Most_Search_Dir = -Most_Search_Dir; } static void search_cmd_dir (char *prompt, int dir) { char buf[MOST_SEARCH_BUF_LEN]; if (-1 == most_read_from_minibuffer(prompt, NULL, buf, MOST_SEARCH_BUF_LEN)) return; Most_Search_Dir = dir; if (*buf) strcpy (Most_Search_Str, buf); /* no buffer overflow here */ Most_Curs_Offset = Most_C_Offset; find_next_cmd (); } static void search_cmd(void) { search_cmd_dir ( #ifdef SLANG_REGEXP "Regexp Search: ", #else "Search: ", #endif 1); } static void search_back_cmd(void) { search_cmd_dir ( #ifdef SLANG_REGEXP "Regexp Search Backwards: ", #else "Search Backwards: ", #endif -1); } static void help_cmd(void) { most_do_help_command(); } static void find_file_cmd(void) { most_user_get_file(); } static void time_cmd(void) { most_message(most_get_time(),0); } static void toggle_width_cmd(void) { if (SLtt_Screen_Cols == 80) { if (!Most_Restore_Width_To) Most_Restore_Width_To = 80; most_set_width(132, 1); } else if (SLtt_Screen_Cols == 132) { if (!Most_Restore_Width_To) Most_Restore_Width_To = 132; most_set_width(80, 1); } } static void edt_forward_cmd(void) { Edt_Direction = 1; } static void edt_back_cmd(void) { Edt_Direction = 0; } static void edt_page_cmd(void) { if (Edt_Direction == 0) { page_up_cmd(); } else { page_down_cmd(); } } static void edt_line_cmd(void) { if (Edt_Direction == 0) { previous_line_cmd(); } else { next_line_cmd(); } } static void edt_find_cmd(void) { if (Edt_Direction == 0) { search_back_cmd(); } else { search_cmd(); } } static void edt_find_next_cmd(void) { if (Edt_Direction == 0) { Most_Search_Dir = -1; } else { Most_Search_Dir = 1; } find_next_cmd(); } #define A_KEY(s, f) {s, (int (*)(void)) f} SLKeymap_Function_Type Most_Functions [] = { A_KEY("edit", most_edit_cmd), A_KEY("suspend", sys_spawn_cmd), A_KEY("next_file", most_next_file), A_KEY("toggle_options", most_toggle_options), A_KEY("toggle_lock", most_toggle_lock), A_KEY("extended_key", most_extended_key_cmd), A_KEY("toggle_case", most_toggle_case), A_KEY("delete_file", most_delete_file_cmd), A_KEY("bob", top_of_buffer_cmd), A_KEY("delete_window", del_window_cmd), A_KEY("digit_arg", digit_arg_cmd), A_KEY("down", next_line_cmd), A_KEY("edt_backward", edt_back_cmd), A_KEY("edt_find", edt_find_cmd), A_KEY("edt_find_next", edt_find_next_cmd), A_KEY("edt_forward", edt_forward_cmd), A_KEY("edt_line", edt_line_cmd), A_KEY("edt_page", edt_page_cmd), A_KEY("eob", end_of_buffer_cmd), A_KEY("exit", most_exit_most), A_KEY("find_file", find_file_cmd), A_KEY("find_next", find_next_cmd), A_KEY("find_next_other_dir", find_next_opposite_dir_cmd), A_KEY("goto_line", goto_line_cmd), A_KEY("goto_mark", goto_mark_cmd), A_KEY("goto_percent", goto_percent_cmd), A_KEY("help", help_cmd), A_KEY("one_window", one_window_cmd), A_KEY("other_window", other_window_cmd), A_KEY("page_down", page_down_cmd ), A_KEY("page_left", page_left_cmd), A_KEY("page_right", page_right_cmd ), A_KEY("page_up", page_up_cmd ), A_KEY("column_left", column_left_cmd ), A_KEY("column_right", column_right_cmd ), A_KEY("redraw", redraw_cmd), A_KEY("search_backward", search_back_cmd), A_KEY("search_forward", search_cmd), A_KEY("set_mark", set_mark_cmd), A_KEY("show_time", time_cmd), A_KEY("tail_mode", tail_mode_cmd), A_KEY("toggle_width", toggle_width_cmd), A_KEY("two_windows", two_window_cmd), A_KEY("up", previous_line_cmd), {(char *) NULL, NULL} }; SLKeyMap_List_Type *Most_Keymap; #ifdef IBMPC_SYSTEM static void gobble_mouse_cmd(void) { SLang_flush_input (); } #endif void most_init_keymaps (void) { char *err = "Unable to create keymaps!"; char esc[3], gold[5], dig[2]; int i; if (NULL == (Most_Keymap = SLang_create_keymap ("Most", NULL))) most_exit_error (err); Most_Keymap->functions = Most_Functions; esc[0] = 27; esc[2] = 0; gold[0] = 27; gold[1] = 'O'; gold[2] = 'P'; gold[4] = 0; dig[1] = 0; for (i = '0'; i <= '9'; i++) { dig[0] = (char) i; esc[1] = (char) i; gold[3] = (char) i; SLkm_define_key (dig, (FVOID_STAR) digit_arg_cmd, Most_Keymap); SLkm_define_key (esc, (FVOID_STAR) digit_arg_cmd, Most_Keymap); SLkm_define_key (gold, (FVOID_STAR) digit_arg_cmd, Most_Keymap); } dig[0] = '-'; esc[1] = '-'; gold[3] = '-'; SLkm_define_key (dig, (FVOID_STAR) digit_arg_cmd, Most_Keymap); SLkm_define_key (esc, (FVOID_STAR) digit_arg_cmd, Most_Keymap); SLkm_define_key (gold, (FVOID_STAR) digit_arg_cmd, Most_Keymap); SLkm_define_key (" ", (FVOID_STAR) page_down_cmd, Most_Keymap); SLkm_define_key ("$", (FVOID_STAR) sys_spawn_cmd, Most_Keymap); SLkm_define_key ("%", (FVOID_STAR) goto_percent_cmd, Most_Keymap); SLkm_define_key (",", (FVOID_STAR) goto_mark_cmd, Most_Keymap); SLkm_define_key ("/", (FVOID_STAR) search_cmd, Most_Keymap); SLkm_define_key (":", (FVOID_STAR) most_extended_key_cmd, Most_Keymap); SLkm_define_key ("<", (FVOID_STAR) page_left_cmd, Most_Keymap); SLkm_define_key (">", (FVOID_STAR) page_right_cmd, Most_Keymap); SLkm_define_key ("?", (FVOID_STAR) search_back_cmd, Most_Keymap); SLkm_define_key ("B", (FVOID_STAR) end_of_buffer_cmd, Most_Keymap); SLkm_define_key ("D", (FVOID_STAR) page_down_cmd, Most_Keymap); SLkm_define_key ("E", (FVOID_STAR) most_edit_cmd, Most_Keymap); SLkm_define_key ("F", (FVOID_STAR) tail_mode_cmd, Most_Keymap); SLkm_define_key ("G", (FVOID_STAR) goto_line_cmd, Most_Keymap); SLkm_define_key ("H", (FVOID_STAR) help_cmd, Most_Keymap); SLkm_define_key ("J", (FVOID_STAR) goto_line_cmd, Most_Keymap); SLkm_define_key ("L", (FVOID_STAR) most_toggle_lock, Most_Keymap); SLkm_define_key ("M", (FVOID_STAR) set_mark_cmd, Most_Keymap); SLkm_define_key ("n", (FVOID_STAR) find_next_cmd, Most_Keymap); SLkm_define_key ("N", (FVOID_STAR) find_next_opposite_dir_cmd, Most_Keymap); SLkm_define_key ("O", (FVOID_STAR) other_window_cmd, Most_Keymap); SLkm_define_key ("Q", (FVOID_STAR) most_exit_most, Most_Keymap); SLkm_define_key ("R", (FVOID_STAR) redraw_cmd, Most_Keymap); SLkm_define_key ("S", (FVOID_STAR) search_cmd, Most_Keymap); SLkm_define_key ("T", (FVOID_STAR) top_of_buffer_cmd, Most_Keymap); SLkm_define_key ("U", (FVOID_STAR) page_up_cmd , Most_Keymap); SLkm_define_key ("V", (FVOID_STAR) next_line_cmd, Most_Keymap); SLkm_define_key ("W", (FVOID_STAR) toggle_width_cmd, Most_Keymap); SLkm_define_key ("X", (FVOID_STAR) most_exit_most, Most_Keymap); SLkm_define_key ("\033$", (FVOID_STAR) sys_spawn_cmd, Most_Keymap); SLkm_define_key ("\033<", (FVOID_STAR) top_of_buffer_cmd, Most_Keymap); SLkm_define_key ("\033>", (FVOID_STAR) end_of_buffer_cmd, Most_Keymap); #if !defined(IBMPC_SYSTEM) SLkm_define_key ("\033OA", (FVOID_STAR) previous_line_cmd, Most_Keymap); SLkm_define_key ("\033OB", (FVOID_STAR) next_line_cmd, Most_Keymap); SLkm_define_key ("\033OC", (FVOID_STAR) column_right_cmd, Most_Keymap); SLkm_define_key ("\033OD", (FVOID_STAR) column_left_cmd, Most_Keymap); SLkm_define_key ("\033OPE", (FVOID_STAR) most_exit_most, Most_Keymap); SLkm_define_key ("\033OPO", (FVOID_STAR) one_window_cmd, Most_Keymap); SLkm_define_key ("\033OPQ", (FVOID_STAR) most_exit_most, Most_Keymap); SLkm_define_key ("\033OPS", (FVOID_STAR) sys_spawn_cmd, Most_Keymap); SLkm_define_key ("\033OPV", (FVOID_STAR) del_window_cmd, Most_Keymap); SLkm_define_key ("\033OPX", (FVOID_STAR) two_window_cmd, Most_Keymap); SLkm_define_key ("\033OP\033OR", (FVOID_STAR) edt_find_cmd, Most_Keymap); SLkm_define_key ("\033OP\033On", (FVOID_STAR) goto_mark_cmd, Most_Keymap); SLkm_define_key ("\033OP\033Ot", (FVOID_STAR) end_of_buffer_cmd, Most_Keymap); SLkm_define_key ("\033OP\033Ou", (FVOID_STAR) top_of_buffer_cmd, Most_Keymap); SLkm_define_key ("\033OP\033[A", (FVOID_STAR) other_window_cmd, Most_Keymap); SLkm_define_key ("\033OP\033[B", (FVOID_STAR) other_window_cmd, Most_Keymap); SLkm_define_key ("\033OP\033[C", (FVOID_STAR) page_right_cmd, Most_Keymap); SLkm_define_key ("\033OP\033[D", (FVOID_STAR) page_left_cmd, Most_Keymap); SLkm_define_key ("\033OQ", (FVOID_STAR) help_cmd, Most_Keymap); SLkm_define_key ("\033OR", (FVOID_STAR) edt_find_next_cmd, Most_Keymap); SLkm_define_key ("\033On", (FVOID_STAR) set_mark_cmd, Most_Keymap); SLkm_define_key ("\033Op", (FVOID_STAR) edt_line_cmd, Most_Keymap); SLkm_define_key ("\033Ot", (FVOID_STAR) edt_forward_cmd, Most_Keymap); SLkm_define_key ("\033Ou", (FVOID_STAR) edt_back_cmd, Most_Keymap); SLkm_define_key ("\033Ox", (FVOID_STAR) edt_page_cmd, Most_Keymap); SLkm_define_key ("\033V", (FVOID_STAR) page_up_cmd , Most_Keymap); SLkm_define_key ("\033[1~", (FVOID_STAR) search_cmd, Most_Keymap); SLkm_define_key ("\033[2~", (FVOID_STAR) goto_mark_cmd, Most_Keymap); SLkm_define_key ("\033[28~", (FVOID_STAR) help_cmd, Most_Keymap); SLkm_define_key ("\033[4~", (FVOID_STAR) set_mark_cmd, Most_Keymap); SLkm_define_key ("\033[5~", (FVOID_STAR) page_up_cmd , Most_Keymap); SLkm_define_key ("\033[6~", (FVOID_STAR) page_down_cmd, Most_Keymap); SLkm_define_key ("\033[A", (FVOID_STAR) previous_line_cmd, Most_Keymap); SLkm_define_key ("\033[B", (FVOID_STAR) next_line_cmd, Most_Keymap); SLkm_define_key ("\033[C", (FVOID_STAR) column_right_cmd, Most_Keymap); SLkm_define_key ("\033[D", (FVOID_STAR) column_left_cmd, Most_Keymap); SLkm_define_key ("^@", (FVOID_STAR) set_mark_cmd, Most_Keymap); #else SLkm_define_key ("^@H", (FVOID_STAR) previous_line_cmd, Most_Keymap); SLkm_define_key ("^@P", (FVOID_STAR) next_line_cmd, Most_Keymap); SLkm_define_key ("^@M", (FVOID_STAR) column_right_cmd, Most_Keymap); SLkm_define_key ("^@K", (FVOID_STAR) column_left_cmd, Most_Keymap); SLkm_define_key ("^@Q", (FVOID_STAR) page_down_cmd, Most_Keymap); SLkm_define_key ("^@I", (FVOID_STAR) page_up_cmd, Most_Keymap); SLkm_define_key ("^@G", (FVOID_STAR) top_of_buffer_cmd, Most_Keymap); SLkm_define_key ("^@O", (FVOID_STAR) end_of_buffer_cmd, Most_Keymap); SLkm_define_key ("\xE0H", (FVOID_STAR) previous_line_cmd, Most_Keymap); SLkm_define_key ("\xE0P", (FVOID_STAR) next_line_cmd, Most_Keymap); SLkm_define_key ("\xE0M", (FVOID_STAR) column_right_cmd, Most_Keymap); SLkm_define_key ("\xE0K", (FVOID_STAR) column_left_cmd, Most_Keymap); SLkm_define_key ("\xE0Q", (FVOID_STAR) page_down_cmd, Most_Keymap); SLkm_define_key ("\xE0I", (FVOID_STAR) page_up_cmd, Most_Keymap); SLkm_define_key ("\xE0G", (FVOID_STAR) top_of_buffer_cmd, Most_Keymap); SLkm_define_key ("\xE0O", (FVOID_STAR) end_of_buffer_cmd, Most_Keymap); SLkm_define_key ("\033[M", (FVOID_STAR) gobble_mouse_cmd, Most_Keymap); #endif SLkm_define_key ("\t", (FVOID_STAR) page_right_cmd, Most_Keymap); SLkm_define_key ("^", (FVOID_STAR) previous_line_cmd, Most_Keymap); SLkm_define_key ("^?", (FVOID_STAR) page_up_cmd , Most_Keymap); SLkm_define_key ("^D", (FVOID_STAR) page_down_cmd, Most_Keymap); SLkm_define_key ("^F", (FVOID_STAR) search_cmd, Most_Keymap); SLkm_define_key ("^H", (FVOID_STAR) help_cmd, Most_Keymap); SLkm_define_key ("^KE", (FVOID_STAR) most_exit_most, Most_Keymap); SLkm_define_key ("^KG", (FVOID_STAR) find_file_cmd, Most_Keymap); SLkm_define_key ("^K^B", (FVOID_STAR) set_mark_cmd, Most_Keymap); SLkm_define_key ("^K^J", (FVOID_STAR) goto_mark_cmd, Most_Keymap); SLkm_define_key ("^K^M", (FVOID_STAR) goto_mark_cmd, Most_Keymap); SLkm_define_key ("^L", (FVOID_STAR) redraw_cmd, Most_Keymap); SLkm_define_key ("^M", (FVOID_STAR) next_line_cmd, Most_Keymap); SLkm_define_key ("^N", (FVOID_STAR) next_line_cmd, Most_Keymap); SLkm_define_key ("^P", (FVOID_STAR) previous_line_cmd, Most_Keymap); SLkm_define_key ("^R", (FVOID_STAR) redraw_cmd, Most_Keymap); SLkm_define_key ("^T", (FVOID_STAR) time_cmd, Most_Keymap); SLkm_define_key ("^U", (FVOID_STAR) page_up_cmd , Most_Keymap); SLkm_define_key ("^V", (FVOID_STAR) page_down_cmd, Most_Keymap); SLkm_define_key ("^W0", (FVOID_STAR) del_window_cmd, Most_Keymap); SLkm_define_key ("^W1", (FVOID_STAR) one_window_cmd, Most_Keymap); SLkm_define_key ("^W2", (FVOID_STAR) two_window_cmd, Most_Keymap); SLkm_define_key ("^WO", (FVOID_STAR) other_window_cmd, Most_Keymap); SLkm_define_key ("^X0", (FVOID_STAR) del_window_cmd, Most_Keymap); SLkm_define_key ("^X1", (FVOID_STAR) one_window_cmd, Most_Keymap); SLkm_define_key ("^X2", (FVOID_STAR) two_window_cmd, Most_Keymap); SLkm_define_key ("^XO", (FVOID_STAR) other_window_cmd, Most_Keymap); SLkm_define_key ("^X^C", (FVOID_STAR) most_exit_most, Most_Keymap); SLkm_define_key ("^X^F", (FVOID_STAR) find_file_cmd, Most_Keymap); SLkm_define_key ("^Z", (FVOID_STAR) sys_spawn_cmd, Most_Keymap); SLkm_define_key ("b", (FVOID_STAR) end_of_buffer_cmd, Most_Keymap); SLkm_define_key ("d", (FVOID_STAR) page_down_cmd, Most_Keymap); SLkm_define_key ("e", (FVOID_STAR) most_edit_cmd, Most_Keymap); SLkm_define_key ("f", (FVOID_STAR) search_cmd, Most_Keymap); SLkm_define_key ("g", (FVOID_STAR) goto_line_cmd, Most_Keymap); SLkm_define_key ("j", (FVOID_STAR) goto_line_cmd, Most_Keymap); SLkm_define_key ("l", (FVOID_STAR) most_toggle_lock, Most_Keymap); SLkm_define_key ("m", (FVOID_STAR) set_mark_cmd, Most_Keymap); SLkm_define_key ("n", (FVOID_STAR) find_next_cmd, Most_Keymap); SLkm_define_key ("o", (FVOID_STAR) other_window_cmd, Most_Keymap); SLkm_define_key ("q", (FVOID_STAR) most_exit_most, Most_Keymap); SLkm_define_key ("r", (FVOID_STAR) redraw_cmd, Most_Keymap); SLkm_define_key ("s", (FVOID_STAR) search_cmd, Most_Keymap); SLkm_define_key ("t", (FVOID_STAR) top_of_buffer_cmd, Most_Keymap); SLkm_define_key ("v", (FVOID_STAR) next_line_cmd, Most_Keymap); SLkm_define_key ("w", (FVOID_STAR) toggle_width_cmd, Most_Keymap); SLkm_define_key ("x", (FVOID_STAR) most_exit_most, Most_Keymap); if (SLang_get_error()) most_exit_error (err); (void) most_load_user_keymaps (); } static void sldo_key (void) { SLang_Key_Type *key; key = SLang_do_key (Most_Keymap, most_getkey); SLKeyBoard_Quit = 0; SLang_set_error (0); Last_Char = SLang_Last_Key_Char; if ((key == NULL) || (key->f.f == NULL) || (key->type != SLKEY_F_INTRINSIC)) { SLtt_beep (); } else (((void (*)(void))(key->f.f)) ()); } static void digit_arg_cmd(void) { char num[15], ch; int j = 0; static int digits; num[j++] = Last_Char; ch = most_getkey(); while ((ch >= '0') && (ch <= '9')) { if (j == 15) return; num[j++] = ch; ch = most_getkey(); } if (((j == 1) && (Last_Char != '-')) || (j > 1)) { num[j] = '\0'; sscanf(num,"%d",&digits); Most_Digit_Arg = &digits; } Last_Char = ch; SLang_ungetkey (ch); sldo_key (); } void most_execute_key (void) { static int refresh_pending = 0; if (Most_Want_Exit) return; most_check_minibuffer (); if (Most_Mini_Buf[0] != '\0') most_put_message (); Most_Digit_Arg = (int *) NULL; most_point_cursor (); if (SLang_input_pending (0)) refresh_pending++; else refresh_pending = 0; if ((refresh_pending == 0) || (refresh_pending > 4)) { refresh_pending = 0; SLsmg_refresh (); } sldo_key (); } most-5.0.0a/src/display.c0000644002657400265740000000267210605757777014317 0ustar davisdavis/* This file is part of MOST. Copyright (c) 1991, 1999, 2002, 2005, 2006, 2007 John E. Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include #include "jdmacros.h" #include "display.h" void most_narrow_width(void) { SLsmg_refresh (); SLtt_write_string ("\033[?3l"); } void most_wide_width(void) { SLsmg_refresh (); SLtt_write_string ("\033[?3h"); } void most_tt_set_color (int color) { SLsmg_set_color (color); } void most_tt_bold_video (void) { SLsmg_set_color (MOST_BOLD_COLOR); } void most_tt_normal_video (void) { SLsmg_set_color (0); } void most_tt_underline_video (void) { SLsmg_set_color (MOST_ULINE_COLOR); } void most_tt_reverse_video (void) { SLsmg_set_color (MOST_STATUS_COLOR); } void most_goto_rc (int r, int c) { SLsmg_gotorc (r - 1, c - 1); } most-5.0.0a/src/Makefile.w320000644002657400265740000000676010425445274014544 0ustar davisdavis# DJGPP and MINGW32 Makefile for most -*- sh -*- #--------------------------------------------------------------------------- # 1. Choose a C compiler. It must understand prototypes. #----------------------------------------------------------------------------- CC = gcc CFLAGS = -Wall -W -O2 -fno-strength-reduce LDFLAGS = # If using DJGPP, set ARCH to djg. Use gw32 for MINGW32 #ARCH=djg ARCH=gw32 SLANGINC = ../../slang/src# Location of slang.h SLANGLIB = $(SLANGINC)/$(ARCH)objs# Location of libslang.a #----------------------------------------------------------------------------- # 4. Location where object files are placed #----------------------------------------------------------------------------- OBJDIR = $(ARCH)objs SRCDIR = . #---------------------------------------------------------------------------- # Nothing below here should require changing. #---------------------------------------------------------------------------- OBJS = $(OBJDIR)/buffer.o $(OBJDIR)/cmd.o $(OBJDIR)/display.o $(OBJDIR)/edit.o $(OBJDIR)/file.o $(OBJDIR)/help.o $(OBJDIR)/keym.o $(OBJDIR)/keyparse.o $(OBJDIR)/line.o $(OBJDIR)/main.o $(OBJDIR)/most.o $(OBJDIR)/search.o $(OBJDIR)/sysdep.o $(OBJDIR)/window.o OFILES = buffer.o cmd.o display.o edit.o file.o help.o keym.o keyparse.o line.o main.o most.o search.o sysdep.o window.o EXEC = most CONFIG_H = config.h ALL_CFLAGS = $(CFLAGS) -I$(SLANGINC) EXECLIBS = -L../$(SLANGLIB) -lslang # COMPILE_CMD = $(CC) -c $(ALL_CFLAGS) # all: $(EXEC) $(EXEC): $(OBJDIR) $(CONFIG_H) $(OBJDIR)/$(EXEC) @echo $(EXEC) created in $(OBJDIR) $(OBJDIR)/$(EXEC): $(OBJS) cd $(OBJDIR); $(CC) *.o -o $(EXEC) $(LDFLAGS) $(EXECLIBS) # $(OBJDIR): -mkdir $(OBJDIR) # $(CONFIG_H) : $(SRCDIR)/w32conf.h cp $(SRCDIR)/w32conf.h $(CONFIG_H) clean: rm -f $(OBJDIR)/* *~ $(OBJDIR)/buffer.o : $(SRCDIR)/buffer.c $(DOT_O_DEPS) $(buffer_O_DEP) $(COMPILE_CMD) $(SRCDIR)/buffer.c -o $(OBJDIR)/buffer.o $(OBJDIR)/cmd.o : $(SRCDIR)/cmd.c $(DOT_O_DEPS) $(cmd_O_DEP) $(COMPILE_CMD) $(SRCDIR)/cmd.c -o $(OBJDIR)/cmd.o $(OBJDIR)/display.o : $(SRCDIR)/display.c $(DOT_O_DEPS) $(display_O_DEP) $(COMPILE_CMD) $(SRCDIR)/display.c -o $(OBJDIR)/display.o $(OBJDIR)/edit.o : $(SRCDIR)/edit.c $(DOT_O_DEPS) $(edit_O_DEP) $(COMPILE_CMD) $(SRCDIR)/edit.c -o $(OBJDIR)/edit.o $(OBJDIR)/file.o : $(SRCDIR)/file.c $(DOT_O_DEPS) $(file_O_DEP) $(COMPILE_CMD) $(SRCDIR)/file.c -o $(OBJDIR)/file.o $(OBJDIR)/help.o : $(SRCDIR)/help.c $(DOT_O_DEPS) $(help_O_DEP) $(COMPILE_CMD) $(SRCDIR)/help.c -o $(OBJDIR)/help.o $(OBJDIR)/keym.o : $(SRCDIR)/keym.c $(DOT_O_DEPS) $(keym_O_DEP) $(COMPILE_CMD) $(SRCDIR)/keym.c -o $(OBJDIR)/keym.o $(OBJDIR)/keyparse.o : $(SRCDIR)/keyparse.c $(DOT_O_DEPS) $(keyparse_O_DEP) $(COMPILE_CMD) $(SRCDIR)/keyparse.c -o $(OBJDIR)/keyparse.o $(OBJDIR)/line.o : $(SRCDIR)/line.c $(DOT_O_DEPS) $(line_O_DEP) $(COMPILE_CMD) $(SRCDIR)/line.c -o $(OBJDIR)/line.o $(OBJDIR)/main.o : $(SRCDIR)/main.c $(DOT_O_DEPS) $(main_O_DEP) $(COMPILE_CMD) $(SRCDIR)/main.c -o $(OBJDIR)/main.o $(OBJDIR)/most.o : $(SRCDIR)/most.c $(DOT_O_DEPS) $(most_O_DEP) $(COMPILE_CMD) $(SRCDIR)/most.c -o $(OBJDIR)/most.o $(OBJDIR)/search.o : $(SRCDIR)/search.c $(DOT_O_DEPS) $(search_O_DEP) $(COMPILE_CMD) $(SRCDIR)/search.c -o $(OBJDIR)/search.o $(OBJDIR)/sysdep.o : $(SRCDIR)/sysdep.c $(DOT_O_DEPS) $(sysdep_O_DEP) $(COMPILE_CMD) $(SRCDIR)/sysdep.c -o $(OBJDIR)/sysdep.o $(OBJDIR)/window.o : $(SRCDIR)/window.c $(DOT_O_DEPS) $(window_O_DEP) $(COMPILE_CMD) $(SRCDIR)/window.c -o $(OBJDIR)/window.o most-5.0.0a/src/sysdep.c0000644002657400265740000004013410606342424014130 0ustar davisdavis/* This file is part of MOST. Copyright (c) 1991, 1999, 2002, 2005, 2006, 2007 John E. Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "config.h" /* * HISTORY * {1} 19-Mar-91 Henk D. Davids * History started. Added default input file name so you do not * have to specify name or type if you want it to be *. * Changes indicated by "-hdd" in comment. * * 2. 4/4/91 John E. Davis * I added code to read the teminal size for unix systems-- at least it * works on a sun4 (BSD ?). In addition I have also recently added file * deletion code for both unix and vms. */ #ifdef VMS # include # include # include # include # include # include # include # include # include /* #include */ #endif /* VMS */ #ifdef HAVE_STDLIB_H # include #endif #include #include "jdmacros.h" #ifdef unix # include # ifdef SYSV # include # include # endif # include #endif #ifdef __os2__ # include #endif #include #include "sysdep.h" #include "display.h" #include "window.h" #include "most.h" #ifdef VMS typedef struct { /* I/O status block */ short i_cond; /* Condition value */ short i_xfer; /* Transfer count */ long i_info; /* Device information */ } iosb; typedef struct { /* Terminal characteristics */ char t_class; /* Terminal class */ char t_type; /* Terminal type */ short t_width; /* Terminal width in characters */ long t_mandl; /* Terminal's mode and length */ long t_extend; /* Extended terminal characteristics */ } termchar; static short TTY_CHANNEL_GLOBAL; static int zero = 0; #else int TTY_DESCR; #endif /* VMS */ /* * * * SHELL COMMANDS * */ #ifdef VMS /* these two from emacs source */ # if 0 static define_logical_name (char *varname, char *string) { static char sstring[200], svarname[200]; struct dsc$descriptor_s strdsc = {strlen (string), DSC$K_DTYPE_T, DSC$K_CLASS_S, sstring}; struct dsc$descriptor_s envdsc = {strlen (varname), DSC$K_DTYPE_T, DSC$K_CLASS_S, svarname}; struct dsc$descriptor_s lnmdsc = {7, DSC$K_DTYPE_T, DSC$K_CLASS_S, "LNM$JOB"}; strcpy(sstring, string); strcpy(svarname, varname); LIB$SET_LOGICAL (&envdsc, &strdsc, &lnmdsc, 0, 0); } static delete_logical_name (char *varname) { struct dsc$descriptor_s envdsc = {strlen (varname), DSC$K_DTYPE_T, DSC$K_CLASS_S, varname}; struct dsc$descriptor_s lnmdsc = {7, DSC$K_DTYPE_T, DSC$K_CLASS_S, "LNM$JOB"}; LIB$DELETE_LOGICAL (&envdsc, &lnmdsc); } int most_do_emacs_command() { unsigned long pid; char *pidstr; if((pidstr = getenv("EMACS_PID")) != NULL) { (void) sscanf(pidstr,"%X",&pid); if (lib$attach(&pid) == SS$_NORMAL) /* we attach to emacs */ return(1); else return(0); /* printf("Can't attach to pid %X\n",pid); */ } else return(0); } # endif /* if 0 */ static unsigned long SHELL_PID = 0; /* returns 0 on success */ int most_do_shell_command() { /* here we try to attach to the parent otherwise just spawn a new one */ unsigned long parent_pid; unsigned long status = 0; char str[80]; $DESCRIPTOR(MOST_$_descr, "MOST > "); if (Most_Secure_Mode) { most_message ("Spawning not permitted in secure mode.", 1); return 0; } parent_pid = getppid(); if (parent_pid && (parent_pid != 0xffffffffU)) /* we attach to parent */ status = lib$attach(&parent_pid); else if (SHELL_PID && (SHELL_PID != 0xffffffffU)) /* try to attach to previous shell */ status = lib$attach (&SHELL_PID); if (status != SS$_NORMAL) /* others fail so spawn a new shell */ { status = 0; SLtt_write_string("Spawning MOST DCL SUBPROCESS (Logout when finished)..."); lib$spawn(0,0,0,0,0,&SHELL_PID,&status,0,0,0,&MOST_$_descr); /* if we attach back, status may come back unchanged */ if ((status != 0) && (status != SS$_NORMAL)) { sprintf(str,"Unable to spawn subprocess. Error = %X", status); most_message(str,1); return(0); } } most_message(" ",0); /* make sure message window is restored */ return(1); } #endif /* VMS */ /* * FILE IO * */ #ifdef VMS int most_expand_file_name(char *file,char *expanded_file) { unsigned long status; static int context = 0, len = 0; static char inputname[MAX_PATHLEN] = ""; $DESCRIPTOR(file_desc,inputname); $DESCRIPTOR(default_dsc,"SYS$DISK:[]*.*;"); static struct dsc$descriptor_s result = {0, DSC$K_DTYPE_T, DSC$K_CLASS_D, NULL}; if (strcmp(inputname, file)) { if (context) { lib$find_file_end(&context); } context = 0; strcpy(inputname, file); len = strlen(inputname); } file_desc.dsc$w_length = len; status = lib$find_file(&file_desc,&result,&context, &default_dsc,0,0,&zero); if (status == RMS$_NORMAL) { memcpy(expanded_file, result.dsc$a_pointer, result.dsc$w_length); expanded_file[result.dsc$w_length] = '\0'; } else expanded_file[0] = '\0'; /* so file comes back as zero width */ return status; } #endif /* VMS */ /* * * * Terminal IO * */ #ifdef VMS /* * Exit Handler Control Block */ static struct argument_block { int forward_link; int (*exit_routine)(); int arg_count; int *status_address; int exit_status; } Exit_Block = { 0, NULL, 1, &Exit_Block.exit_status, 0 }; #endif /* VMS */ #ifdef unix # include # if !defined(sun) # include # endif # ifndef NO_UNISTD_H # include # endif # if HAS_TERMIOS # include # endif # ifdef SYSV # include # include # include # include # endif # include # include # include #if defined(SIGHUP) && !defined(IBMPC_SYSTEM) static void unix_hangup(int sig) { most_exit_error ("most: Exiting on signal %d.", sig); } #endif #endif /* unix */ static int Want_Window_Size_Change; static int Most_TTY_Inited = 0; #ifdef REAL_UNIX_SYSTEM static int handle_interrupts (void) { if (Want_Window_Size_Change) most_resize_display (); return 0; } #endif #ifdef SIGWINCH static void sigwinch_handler (int sig) { (void) sig; Want_Window_Size_Change = 1; (void) SLsignal_intr (SIGWINCH, sigwinch_handler); } #endif #if defined(SIGBUS) && MOST_HAS_MMAP static void sigbus_handler (int sig) { (void) sig; most_reset_tty (); most_reset_display (); fprintf (stderr, "SIGBUS caught--- fatal error\n"); if ((Most_Buf != NULL) && Most_Buf->is_mmaped) fprintf (stderr, "This may be due to a modified memory mapped file\n"); exit (1); } #endif void most_resize_display (void) { Want_Window_Size_Change = 0; if (Most_Display_Inited == 0) return; most_get_term_dimensions(&SLtt_Screen_Cols, &SLtt_Screen_Rows); if (Most_Win != NULL) most_one_window (); #if SLANG_VERSION > 10305 SLsmg_reinit_smg (); #else SLsmg_reset_smg (); SLsmg_init_smg (); #endif most_redraw_display (); } static int init_tty (void) { #if defined(REAL_UNIX_SYSTEM) SLsig_block_signals (); #endif if (-1 == SLang_init_tty (7, 0, 1)) { fprintf (stderr, "most: failed to init terminal.\n"); exit (1); } #if !defined(IBMPC_SYSTEM) SLtt_enable_cursor_keys (); #endif #if defined(REAL_UNIX_SYSTEM) SLsig_unblock_signals (); SLang_getkey_intr_hook = handle_interrupts; #endif return 0; } void most_init_tty (void) { int i; if (Most_TTY_Inited) return; (void) init_tty (); #if !defined(IBMPC_SYSTEM) SLsig_block_signals (); #endif for (i = 1; i < 32; i++) { switch (i) { #ifdef SIGHUP case SIGHUP: #endif #ifdef SIGQUIT case SIGQUIT: #endif #ifdef SIGTERM case SIGTERM: # ifdef REAL_UNIX_SYSTEM SLsignal_intr (i, unix_hangup); # else (void) i; # endif break; #endif #ifdef SIGWINCH case SIGWINCH: (void) SLsignal_intr (SIGWINCH, sigwinch_handler); break; #endif #if defined(SIGBUS) && MOST_HAS_MMAP case SIGBUS: (void) SLsignal_intr (SIGBUS, sigbus_handler); break; #endif #ifdef SIGCONT case SIGCONT: #endif #ifdef SIGTSTP case SIGTSTP: #endif #ifdef SIGINT case SIGINT: #endif #ifdef SIGCHLD case SIGCHLD: #endif default: break; #ifdef SIGPIPE case SIGPIPE: (void) SLsignal_intr (SIGPIPE, SIG_IGN); break; #endif } } SLang_set_abort_signal (NULL); Most_TTY_Inited = 1; #if !defined(IBMPC_SYSTEM) SLsig_unblock_signals (); #endif } void most_reset_tty (void) { if (Most_TTY_Inited == 0) return; SLang_reset_tty (); Most_TTY_Inited = 0; } int most_reinit_terminal (void) { if (Most_TTY_Inited == 0) return 0; most_reset_tty (); (void) init_tty (); Most_TTY_Inited = 1; return 0; } /* slang uses select to wait for terminal input. If SIGINT is * generated, then slang returns ^G and sets SLKeyBoard_Quit * to 1 bypassing the read altogether. If most was used in * conjunction with xargs (find . -print | xargs most) and ^G * is pressed, a SIGINT will be generated killing xargs and * leaving most an orphan unable to access the terminal. * Unfortunately, the select call will continue to time-out * causing most continue running in the background. To * workaround this problem, exit if the terminal is not in the * same process group as most. */ static void check_if_foreground (void) { #if defined(HAVE_GETPGRP) && defined(HAVE_TCGETPGRP) pid_t pgid = getpgrp (); if ((SLang_TT_Read_FD != -1) && (pgid != tcgetpgrp (SLang_TT_Read_FD))) { most_exit_error ("\007Fatal Error: Most is not in the terminal's process group."); } #endif } int most_getkey() { unsigned int ch; static int last_was_sigint; /* This non-sense involving last_was_sigint is to handle a race condition. * The shell may not have had time to change the pgids, so sleep a bit * here. Yea, its ugly and does not really solve the problem... */ if (last_was_sigint) { sleep (1); check_if_foreground (); last_was_sigint = 0; } ch = SLang_getkey (); if (ch == SLANG_GETKEY_ERROR) most_exit_error ("most: getkey error."); if (SLKeyBoard_Quit) { check_if_foreground (); last_was_sigint = 1; } SLKeyBoard_Quit = 0; SLang_set_error (0); return (int) ch; } /* * * Misc Termial stuff * * */ /* This is to get the size of the terminal */ void most_get_term_dimensions(int *cols, int *rows) { SLtt_get_screen_size (); *rows = SLtt_Screen_Rows; *cols = SLtt_Screen_Cols; } /* returns 0 on failure, 1 on sucess */ int most_delete_file(char *filename) { #ifdef VMS return (1 + delete(filename)); /* 0: sucess; -1 failure */ #else return(1 + remove(filename)); #endif } /* This routine converts unix type names to vms names */ #ifdef VMS static int locate(char ch, char *string) { int i; char c; i = 0; while (c = string[i++], (c != ch) && (c != '\0')); if (c == ch) return(i); else return (0); } char *most_unix2vms(char *file) { int i,device,j,first,last; static char vms_name[MAX_PATHLEN]; char ch; if (locate('[',file)) return(file); /* vms_name syntax */ if (!locate('/',file)) return(file); /* vms_name syntax */ /* search for the ':' which means a device is present */ device = locate(':',file); i = 0; if (device) { while (ch = file[i], i < device) vms_name[i++] = ch; } j = i; /* go from the end looking for a '/' and mark it */ i = strlen(file) - 1; while(ch = file[i], ch != '/' && i-- >= 0); if (ch == '/') { file[i] = ']'; last = 0; } else last = 1; i = j; vms_name[j++] = '['; vms_name[j++] = '.'; first = 0; while(ch = file[i++], ch != '\0') { switch (ch) { case '.': if (last) vms_name[j++] = '.'; if (last) break; ch = file[i++]; if (ch == '.') { if (!first) j--; /* overwrite the dot */ vms_name[j++] = '-'; } else if (ch == '/'); /* './' combinations-- do nothing */ else if (ch == ']') { last = 1; if (vms_name[j-1] == '.') j--; vms_name[j++] = ']'; } else vms_name[j++] = '.'; break; case '/': if (first) { vms_name[j++] = '.'; } else { first = 1; /* if '/' is first char or follows a colon do nothing */ if ((i!=1) && (file[i-2] != ':')) { vms_name[j++] = '.'; } else j--; /* overwrite the '.' following '[' */ } break; case ']': last = 1; if (vms_name[j-1] == '.') j--; vms_name[j++] = ']'; break; default: vms_name[j++] = ch; } } return (vms_name); } /* main(int argc, char **argv) { puts(unix2vms(argv[1])); } */ #endif /* VMS */ #include char *most_get_time() { time_t clk; char *the_time; clk = time((time_t *) 0); the_time = (char *) ctime(&clk); /* returns the form Sun Sep 16 01:03:52 1985\n\0 */ the_time[24] = '\0'; return(the_time); } void most_set_width (int width, int redraw) { #ifdef IBMPC_SYSTEM (void) width; (void) redraw; #else #ifdef VMS short fd; int status; iosb iostatus; static termchar tc; /* Terminal characteristics */ $DESCRIPTOR( devnam, "SYS$ERROR"); #else # ifdef TIOCGWINSZ struct winsize wind_struct; # endif #endif /* Switching physical terminal to narrow/wide mode.*/ if(width <= 80) { width = 80; most_narrow_width(); } else { width = 132; most_wide_width(); } SLtt_Screen_Cols = width; #ifdef VMS /* Assign input to a channel */ status = sys$assign(&devnam, &fd, 0, 0); if ((status & 1) == 0) exit(status); /* Get current terminal characteristics */ status = sys$qiow( /* Queue and wait */ 0, /* Wait on event flag zero */ fd, /* Channel to input terminal */ IO$_SENSEMODE, /* Get current characteristic */ &iostatus, /* Status after operation */ 0, 0, /* No AST service */ &tc, /* Terminal characteristics buf */ sizeof(tc), /* Size of the buffer */ 0, 0, 0, 0); /* P3-P6 unused */ /*set terminal characteristics */ tc.t_width=width; status = sys$qiow( /* Queue and wait */ 0, /* Wait on event flag zero */ fd, /* Channel to input terminal */ IO$_SETMODE, /* Get current characteristic */ &iostatus, /* Status after operation */ 0, 0, /* No AST service */ &tc, /* Terminal characteristics buf */ sizeof(tc), /* Size of the buffer */ 0, 0, 0, 0); /* P3-P6 unused */ if( (sys$dassgn(fd) & 1)==0) exit(status); /* here we redraw the screen, on unix, we assume that the terminal * driver sends the appropriate signal that most catches to redraw so we * do not redraw because it is likely that screen will be redrawn twice */ if (redraw) most_resize_display (); #else (void) redraw; # ifdef TIOCGWINSZ /* this may need work on other unix-- works for sun4 */ if (-1 != ioctl(TTY_DESCR,TIOCGWINSZ,&wind_struct)) { wind_struct.ws_col = width; ioctl(TTY_DESCR,TIOCSWINSZ,&wind_struct); } # endif #endif /* VMS */ #endif /* NOT IBMPC_SYSTEM */ } most-5.0.0a/src/jdmacros.h0000644002657400265740000000226310425445274014437 0ustar davisdavis#ifndef _JD_MACROS_H_ # define _JD_MACROS_H_ /* This file defines some macros that I use with programs that link to * the slang library. */ # ifdef HAVE_MALLOC_H # include # endif # ifdef HAVE_MEMORY_H # include # endif # ifndef SLMEMSET # ifdef HAVE_MEMSET # define SLMEMSET memset # else # define SLMEMSET SLmemset # endif # endif # ifndef SLMEMCHR # ifdef HAVE_MEMCHR # define SLMEMCHR memchr # else # define SLMEMCHR SLmemchr # endif # endif # ifndef SLMEMCPY # ifdef HAVE_MEMCPY # define SLMEMCPY memcpy # else # define SLMEMCPY SLmemcpy # endif # endif /* Note: HAVE_MEMCMP requires an unsigned memory comparison!!! */ # ifndef SLMEMCMP # ifdef HAVE_MEMCMP # define SLMEMCMP memcmp # else # define SLMEMCMP SLmemcmp # endif # endif # if SLANG_VERSION < 9934 # define SLmemcmp jed_memcmp # define SLmemcpy jed_memcpy # define SLmemset jed_memset # define SLmemchr jed_memchr # endif # ifndef SLFREE # define SLFREE free # endif # ifndef SLMALLOC # define SLMALLOC malloc # endif # ifndef SLCALLOC # define SLCALLOC calloc # endif # ifndef SLREALLOC # define SLREALLOC realloc # endif #endif /* _JD_MACROS_H_ */ most-5.0.0a/src/keym.h0000644002657400265740000000530110605757777013614 0ustar davisdavis/* This file is part of MOST. Copyright (c) 1991, 1999, 2002, 2005, 2006, 2007 John E. Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ extern void most_init_keymaps (void); extern void most_execute_key (void); extern int *Most_Digit_Arg; extern void most_do_help_command (void); /* These are in cmd.c */ extern void most_extended_key_cmd(void); extern void most_next_file (void); extern void most_toggle_case (void); extern void most_delete_file_cmd (void); extern void most_toggle_options (void); #if 0 extern void ctrl_x_map_cmd(void); extern void ctrl_k_map_cmd(void); extern void ctrl_w_map_cmd(void); extern void pf1_map_cmd(void); extern void pf1_esc_map_cmd(void); extern void dec_extended_map_cmd(void); extern void esc_map_cmd(void); extern void page_down_cmd(void); extern void search_cmd(void); extern void next_line_cmd(void); extern void previous_line_cmd(void); extern void extended_cmd_cmd(void); extern void redraw_cmd(void); extern void goto_line_cmd(void); extern void time_cmd(void); extern void page_up_cmd(void); extern void page_up_cmd(void); extern void column_left_cmd(void); extern void column_right_cmd(void); extern void page_right_cmd(void); extern void sys_spawn_cmd(void); extern void set_mark_cmd(void); extern void top_of_buffer_cmd(void); extern void goto_mark_cmd(void); extern void search_back_cmd(void); extern void find_next_cmd(void); extern void end_of_buffer_cmd(void); extern void exit_cmd(void); extern void one_window_cmd(void); extern void two_window_cmd(void); extern void del_window_cmd(void); extern void other_window_cmd(void); extern void O_map_cmd(void); extern void find_file_cmd(void); extern void digit_arg_cmd(void); extern void edit_cmd(void); extern void toggle_width_cmd(void); extern void goto_percent_cmd(void); extern void edt_page_cmd(void); extern void edt_forward_cmd(void); extern void edt_back_cmd(void); extern void edt_line_cmd(void); extern void edt_find_cmd(void); extern void edt_find_next_cmd(void); extern int do_extended_key(void); extern int do_extended_cmd(void); extern void do_help_command(void); extern void execute_key(void); #endif most-5.0.0a/src/display.h0000644002657400265740000000251410636660067014304 0ustar davisdavis/* This file is part of MOST. Copyright (c) 1991, 1999, 2002, 2005, 2006, 2007 John E. Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* These numbers match ANSI escape sequences of form ESC [ x m */ #define MOST_BOLD_COLOR 1 #define MOST_ULINE_COLOR 4 #define MOST_STATUS_COLOR 7 #define MOST_EMBEDDED_COLOR_OFFSET 32 extern void most_tt_set_color (int color); extern void most_tt_reverse_video(void); extern void most_tt_bold_video(void); extern void most_tt_underline_video(void); extern void most_tt_normal_video(void); extern void most_wide_width(void); extern void most_narrow_width(void); extern void most_enable_cursor_keys(void); extern void most_goto_rc (int, int); extern void most_setup_colors (void); most-5.0.0a/src/sysdep.h0000644002657400265740000000275710605757777014172 0ustar davisdavis#ifndef __DAVIS_SYSDEP_H__ # define __DAVIS_SYSDEP_H__ /* This file is part of MOST. Copyright (c) 1991, 1999, 2002, 2005, 2006, 2007 John E. Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ # include # if defined(sequent) || defined(apollo) # define HAS_TERMIOS 0 # else # define HAS_TERMIOS 1 # endif # ifdef VMS extern int most_do_emacs_command(void); extern int most_do_shell_command(); extern int most_expand_file_name(char *,char *); extern char *most_unix2vms(char *); # endif /* VMS */ extern int most_reinit_terminal (void); extern void most_init_tty(void); extern void most_reset_tty(void); extern int most_getkey(void); extern void most_get_term_dimensions(int *, int *); extern int most_delete_file(char *); extern void most_set_width(int, int); extern char *most_get_time(void); extern void most_resize_display (void); #endif /* __DAVIS_SYSDEP_H__ */ most-5.0.0a/src/RTL.OPT0000644002657400265740000000003310425445274013502 0ustar davisdavisSYS$LIBRARY:VAXCRTL/SHARE most-5.0.0a/src/most.c0000644002657400265740000003103010630436657013607 0ustar davisdavis/* This file is part of MOST. Copyright (c) 1991, 1999, 2002, 2005, 2006, 2007 John E. Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "config.h" #include #include #ifdef HAVE_STDLIB_H # include #endif #ifdef HAVE_UNISTD_H # include #endif #ifdef VMS # include #endif #include #include #include #include "version.h" #include "jdmacros.h" #include "most.h" #include "search.h" #include "window.h" #include "file.h" #include "sysdep.h" #include "keym.h" #include "display.h" #include "line.h" int Most_S_Opt = 0; /* squeeze liness */ int Most_A_Opt = 1; /* automatically choose -b if necessary */ int Most_V_Opt = 0; /* display control chars */ int Most_B_Opt = 0; /* display Binary File */ int Most_T_Opt = 0; /* display tab as ^I-- valid only with V option */ int Most_D_Opt = 0; /* delete file mode (see ':D') */ int Most_K_Opt = 0; /* Display 8 bit unformatted (Kanji) */ int Most_Z_Opt = 0; /* Gunzip on the fly */ int Most_Want_Exit; int Most_Secure_Mode; int Most_Captive_Mode; #if MOST_HAS_MMAP int Most_Disable_MMap = 0; #endif int Most_UTF8_Mode = -1; /* -1:auto, 0:off, 1:on */ static int Most_Starting_Line; char *Most_Program; /* Program Name (argv[0]) */ static char *Most_Version = MOST_VERSION_STR; #ifdef VMS # ifndef isalpha # define isalpha(x) \ (((x >= 'A') && (x <= 'Z'))||((x >= 'a') && (x <= 'z')) ? 1 : 0) # endif #endif void most_usage (void) { fprintf(stderr,"MOST version %s (S-Lang version %s)\n", Most_Version, SLang_Version_String); if (SLang_Version != SLANG_VERSION) fprintf (stderr, " *Note: This executable was compiled against S-Lang %s\n", SLANG_VERSION_STRING); fprintf (stderr, "Usage:\n"); fprintf(stderr, "most [-1Cbcdkstvw] [+/string] [+line number] [+s] [+d] file...\n"); fputs(" where: -1: assume VT100 terminal. (VMS only)\n", stderr); fputs(" -b: Startup in binary mode.\n", stderr); fputs(" -C: disable color support\n", stderr); fputs(" -c: Make searches case sensitive.\n", stderr); fputs(" -d: Do not display the \\ wrap marker when wrapping lines.\n", stderr); /* fputs(" -k: Kanji mode.\n", stderr); */ #if MOST_HAS_MMAP fputs(" -M: Do not attempt to mmap files.\n", stderr); #endif fputs(" -s: Squeeze out excess blank lines.\n", stderr); fputs(" -t: Display tabs as ^I. If this option is immediately followed\n", stderr); fputs(" by an integer, the integer sets the tab width.\n", stderr); fputs(" -u: Disable UTF-8 mode\n", stderr); fputs(" -v: Do not interpret backspace formatting characters.\n", stderr); fputs(" -w: Wrap lines.\n", stderr); fputs(" -z: No gunzip-on-the-fly.\n", stderr); fputs(" +/string:\n", stderr); fputs(" Search for string\n", stderr); fputs(" +line number\n", stderr); fputs(" Start up at specified line number.\n", stderr); fputs(" +d: Allow file deletion.\n", stderr); fputs(" +s: Secure Mode-- no edit, cd, shell, and reading files not\n", stderr); fputs(" already listed on the command line.\n", stderr); fputs(" +u: Enable UTF-8 mode.\n", stderr); fprintf(stderr, "\nExample: most -ct4 +82 keymap.c\n"); fputs(" makes searches case sensitive, sets tabwidth to 4, and displays the file\n", stderr); fputs(" keymap.c starting at line 82.\n", stderr); } static void do_switches(char *str); static void do_extended_switches(char *str) { int i; char ch; char numstr [256]; i = 0; ch = *(++str); if ( ch == '/') { strcpy (Most_Search_Str,++str); return; } if (ch >= '0' && ch <= '9') { while ((ch >= '0' && ch <= '9') && (i < 10)) { numstr[i++] = ch; ch = *(++str); } numstr[i] = '\0'; if (1 == sscanf (numstr,"%d", &i)) Most_Starting_Line = i; return; } if (isalpha(ch)) { while (1) { switch (ch) { case 0: return; case ' ': case '+': break; case '-': do_switches (str); return; case 'D': case 'd': Most_D_Opt = 1; /* delete file mode */ break; case 'S': case 's': Most_Secure_Mode = 1; break; case 'U': case 'u': Most_UTF8_Mode = 1; /* +u */ break; default: fprintf(stderr,"%s invalid extended option %c ignored.\n", Most_Program, ch); } ch = *(++str); } } fprintf(stderr,"%s: switch '+%s' not valid.\n", Most_Program, str); exit (1); } /* if non-zero, assume terminal is only a generic vt100 */ static int assume_vt100 = 0; static int No_Colors = 0; static void do_switches(char *str) { char ch; if (*str == '-') str++; while ((ch = *str++) != '\0') { switch (ch) { default: fprintf(stderr,"%s: invalid switch %c ignored.\n", Most_Program, ch); break; case 'C': No_Colors = 1; break; case 'c': Most_Case_Sensitive = 1; break; case 'd': case 'D': Most_Show_Wrap_Marker = 0; case 's': case 'S': Most_S_Opt = 1; break; case 'V': case 'v': Most_V_Opt = 1; /* verbose-- convert control chars to '^' 'ch' */ break; case 'W': case 'w': Most_W_Opt = 1; break; case 'K': /* Kanji option */ case 'k': /* Most_K_Opt = 1; break; */ break; case 'B': case 'b': Most_B_Opt = 1; /* Binary display 8 bit */ break; case 'M': #if MOST_HAS_MMAP Most_Disable_MMap = 1; #endif break; case 'z': case 'Z': Most_Z_Opt = 1; /* NO Gunzip-on-the-fly */ break; case 't': case 'T': /* expand tabs to '^I'; meaningful only with 'v' */ ch = *str; if ((ch <= '9') && (ch >= '0')) { str++; Most_Tab_Width = (int) ch - '0'; if (Most_Tab_Width == 0) Most_T_Opt = 1; } else Most_T_Opt = 1; break; case 'n': case 'N': /* could be the Gopher Naive user switch --- ignored. */ break; case '1': assume_vt100 = 1; break; case 'u': case 'U': Most_UTF8_Mode = 0; /* -u */ break; /* Allow MOST_SWITCHES environment variable to contain + forms, * e.g., "-sn+d" or "-s -n +d" */ case ' ': case '-': break; case '+': do_extended_switches (str - 1); /* include '+' */ return; } } } void most_exit_error(char *fmt,...) { va_list ap; most_reset_tty (); most_reset_display(); if (fmt != NULL) { va_start (ap, fmt); vfprintf(stderr, fmt, ap); va_end (ap); putc ('\n', stderr); } #ifdef MALLOC_DEBUG SLmalloc_dump_statistics (); #endif exit(1); } static void play_cat(char *file) { char buf[4096 * 4]; int n; FILE *fp; if (file == NULL) fp = stdin; else { fp = fopen(file, "r"); if (fp == NULL) return; } while ((n = fread(buf, 1, 4096 * 4, fp)) > 0) { int m; m = fwrite (buf, 1, n, stdout); if (m != n) { fprintf (stderr, "fwrite returned %d, errno = %d\n", m, errno); exit (1); } } } void most_initialize_most (void) { Most_S_Opt = 0; Most_A_Opt = 1; Most_V_Opt = 0; Most_B_Opt = 0; Most_T_Opt = 0; Most_D_Opt = 0; Most_K_Opt = 0; Most_W_Opt = 0; Most_Selective_Display = 0; *Most_Search_Str = 0; Most_Search_Dir = 1; Most_Top_Win = Most_Win = NULL; Most_Buf = NULL; Most_Eob = NULL; Most_Beg = NULL; Most_Captive_Mode = Most_Secure_Mode = 0; Most_Want_Exit = 0; } static void do_most (char *file, int start) { int piped; MOST_INT row, col; most_get_cdir(Most_C_Dir); row = col = 0; if (file[0] == '\0') piped = 1; else piped = 0; if ((-1 == most_find_file (file)) && (Most_Num_Files == 1)) most_exit_error ("%s: failed to open for reading.", file); most_init_display (); most_goto_line(start); Most_Curs_Offset = Most_C_Offset; if (*Most_Search_Str && ((row = most_search (Most_Beg + Most_C_Offset, 1, &col)) > 0)) most_goto_line(row); else { row = Most_C_Line; col = 1; } most_window_buffer(); Most_Curs_Row = Most_Win->curs_line = row - Most_C_Line + 1; Most_Win->curs_offset = Most_Curs_Offset; Most_Curs_Col = Most_Win->curs_col = col; most_redraw_window(); most_update_status(); while (Most_Want_Exit == 0) { most_execute_key(); } } void most_exit_most (void) { if (Most_Want_Exit) return; Most_Want_Exit = 1; most_clear_minibuffer (); most_reset_tty (); most_reset_display (); most_free_windows (); #ifdef MALLOC_DEBUG SLmalloc_dump_statistics (); #endif } static void utf8_config (void) { int utf8_mode = Most_UTF8_Mode; utf8_mode = SLutf8_enable (-1); /* returns 0 or 1 */ if (Most_UTF8_Mode == -1) Most_UTF8_Mode = utf8_mode; else if (utf8_mode != Most_UTF8_Mode) { if (utf8_mode == 1) (void) SLsmg_utf8_enable (0); /* locale is UTF-8, but -u passed */ else (void) SLsmg_utf8_enable (1); /* locale not UTF-8, but +u passed */ } } int most (int argc, char **argv) { char file[MAX_PATHLEN], *switches; int file_i = 0, quit,i,piped,a_opt; unsigned long context; int status = 0; #ifdef VMS char filename[256]; #else int j; #endif Most_Program = argv[0]; piped = 0; switches = getenv ("MOST_PROMPT"); if ((switches != NULL) && (*switches != 0)) Most_Global_Msg = switches; switches = getenv("MOST_SWITCHES"); if (switches != NULL) do_switches(switches); i = 1; if (argc > 1) { quit = 0; while ((!quit) && (i < argc)) { if (argv[i][0] == '-') do_switches(argv[i++]); else if (argv[i][0] == '+') do_extended_switches(argv[i++]); else quit = 1; } } #if MOST_HAS_MMAP /* if (Most_D_Opt) */ /* Most_Disable_MMap = 1; */ #endif if (i == argc) { if (isatty(0)) /* 1 if stdin is a terminal, 0 otherwise */ { most_usage (); return 0; } /* assume input is from stdin */ file[0] = '\0'; /* tells most this is stdin */ piped = 1; if (!isatty(fileno(stdout))) { play_cat(NULL); return 0; } } else { strncpy (file, argv[i], sizeof(file)); file[sizeof(file)-1] = 0; } if (!isatty(fileno(stdout))) { while (i < argc) play_cat(argv[i++]); exit(0); } Most_Num_Files = 0; context = 0; SLtt_get_terminfo(); utf8_config (); SLtt_Ignore_Beep = 1; if (No_Colors) SLtt_Use_Ansi_Colors = 0; most_setup_colors (); most_init_tty (); most_init_keymaps (); if (Most_B_Opt) Most_A_Opt = 0; /* explicit b overrides a */ a_opt = Most_A_Opt; if (!piped) { file_i = i; #ifdef VMS while(i < argc) { if (Most_Num_Files >= MOST_MAX_FILES) break; if (argv[i][0] == '.') strcpy(file,"*"); else *file = 0; strcat(file, most_unix2vms(argv[i++])); while (RMS$_NORMAL == (status = most_expand_file_name(file,filename))) { Most_File_Ring[Most_Num_Files] = (char*) MOSTMALLOC(strlen(filename) + 1); strcpy(Most_File_Ring[Most_Num_Files++], filename); } if (status == RMS$_NMF) status = RMS$_NORMAL; /* avoid spurious warning message */ } if (Most_Num_Files) strcpy(file,Most_File_Ring[0]); else fputs("%%MOST-W-NOFILES, no files found\n", stderr); #else Most_Num_Files = argc - i; if (Most_Num_Files > MOST_MAX_FILES) { Most_Num_Files = MOST_MAX_FILES; argc = Most_Num_Files + i; } j = 0; while (i < argc) { Most_File_Ring[j++] = argv[i++]; } #endif } if (Most_Num_Files || piped) do_most(file, Most_Starting_Line); else if (Most_Num_Files == 0) fprintf(stderr,"File %s not found\n", argv[file_i]); most_exit_most (); return status; } #if SLANG_VERSION <= 10409 int SLang_set_error (int x) { SLang_Error = x; return 0; } int SLang_get_error (void) { return SLang_Error; } #endif most-5.0.0a/src/w32conf.h0000644002657400265740000000122110425445274014107 0ustar davisdavis/* -*- C -*- */ /* Note: this is for DJGPP and WIN32 systems only. * See mostconf.h for other systems, e.g., Unix. */ #ifndef MOST_CONFIG_H # define MOST_CONFIG_H /* define if you have stdlib.h */ # define HAVE_STDLIB_H 1 /* define if you have unistd.h */ # define HAVE_UNISTD_H 1 /* define if you have memory.h */ # define HAVE_MEMORY_H 1 /* define if you have malloc.h */ # define HAVE_MALLOC_H 1 /* define if you have memset */ # define HAVE_MEMSET 1 /* define if you have memcpy */ # define HAVE_MEMCPY 1 /* define if you have this. */ # define HAVE_GETCWD 1 # define HAVE_DIRENT_H 1 # define MAX_PATHLEN 1024 #endif /* MOST_CONFIG_H */ most-5.0.0a/src/most.h0000644002657400265740000000471210605757777013636 0ustar davisdavis/* This file is part of MOST. Copyright (c) 1991, 1999, 2002, 2005, 2006, 2007 John E. Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "config.h" extern int Most_S_Opt; extern int Most_A_Opt; /* automatically choose -b if necessary */ extern int Most_V_Opt; /* display control chars */ extern int Most_B_Opt; /* display Binary File */ extern int Most_T_Opt; /* display tab as ^I-- valid only with V option */ extern int Most_D_Opt; /* delete file mode (see ':D') */ extern int Most_L_Opt; /* use ^L (formfeed) to clear screen */ extern int Most_W_Opt; /* Wrap mode */ extern int Most_K_Opt; /* Kanji mode */ extern int Most_Z_Opt; /* gunzip-on-the-fly */ #if MOST_HAS_MMAP extern int Most_Disable_MMap; #endif extern int Most_UTF8_Mode; extern int Most_Secure_Mode; extern int Most_Captive_Mode; extern char *Most_Program; extern int most(int, char **); extern char *Most_Global_Msg; extern int Most_Want_Exit; extern void most_initialize_most(void); extern void most_exit_most (void); extern void most_exit_error (char *, ...); extern void most_usage (void); #define MOSTMALLOC most_malloc #define MOSTREALLOC most_realloc extern unsigned char *most_malloc(unsigned int); extern unsigned char *most_realloc(unsigned char *, unsigned int); extern int Most_Tab_Width; #ifdef VMS # ifndef isdigit # define isdigit(x) \ (((x >= '0') && (x <= '9')) ? 1 : 0) # endif #endif /* FIXME: v2.x slang.h exports SLsnprintf */ #ifdef HAVE_SNPRINTF # define _pSLsnprintf snprintf #else # if SLANG_VERSION < 20000 # define _pSLsnprintf _SLsnprintf # endif extern int _pSLsnprintf (char *, unsigned int, char *, ...); #endif #if SLANG_VERSION <= 10409 extern int SLang_get_error (void); extern int SLang_set_error (int); #endif #define SLANG_REGEX 1 most-5.0.0a/src/chkslang.c0000644002657400265740000000456710605757777014451 0ustar davisdavis/* This file is part of MOST. Copyright (c) 1991, 1999, 2002, 2005, 2006, 2007 John E. Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* It is too bad that this cannot be done at the preprocessor level. * Unfortunately, C is not completely portable yet. Basically the #error * directive is the problem. */ #include "config.h" #include #ifdef VMS # include #endif #include #include "jdmacros.h" static char *make_version (unsigned int v) { static char v_string[16]; unsigned int a, b, c; a = v/10000; b = (v - a * 10000) / 100; c = v - (a * 10000) - (b * 100); sprintf (v_string, "%u.%u.%u", a, b, c); return v_string; } int main (int argc, char **argv) { unsigned int min_version, sl_version; unsigned int sug_version; int ret; if ((argc < 3) || (argc > 4)) { fprintf (stderr, "Usage: %s \n", argv[0]); return 1; } #ifndef SLANG_VERSION sl_version = 0; #else sl_version = SLANG_VERSION; #endif sscanf (argv[2], "%u", &min_version); if (argc == 4) sscanf (argv[3], "%u", &sug_version); else sug_version = sl_version; ret = 0; if (sl_version < min_version) { fprintf (stderr, "This version of %s requires slang version %s.\n", argv[1], make_version(min_version)); #ifdef VMS ret = SS$_ABORT; #else ret = 1; #endif } if (sl_version < sug_version) { fprintf (stderr, "Your slang version is %s.\n", make_version(sl_version)); fprintf (stderr, "To fully utilize this program, you should upgrade the slang library to\n"); fprintf (stderr, " version %s\n", make_version(sug_version)); fprintf (stderr, "This library is available via anonymous ftp from\n\ space.mit.edu in pub/davis/slang.\n"); } return ret; } most-5.0.0a/src/mostconf.h0000644002657400265740000000140610426040636014455 0ustar davisdavis/* * Use sysconf.h for unix!!! This file is for NON-unix systems. * * This file is used to indicate capabilities of the C compiler and * operating system. */ /* Basic include files. */ #if defined(__os2__) || defined (__DECC) || defined(VAXC) # define HAVE_STDLIB_H 1 #else # define HAVE_MALLOC_H 1 #endif #if defined (__os2__) # define HAVE_UNISTD_H 1 # define HAVE_MEMORY_H 1 #endif /* * Basic C library functions. */ #if defined(__os2__) # define HAVE_PUTENV 1 #endif #define HAVE_GETCWD 1 #define HAVE_MEMSET 1 #define HAVE_MEMCPY 1 #define HAVE_MEMCHR 1 #ifdef VMS # ifndef __GNUC__ # include # endif #endif #define MAX_PATHLEN 256 #define MOST_INT long #define MOST_UINT unsigned long #define MOST_INT_D_FMT "%ld" #define MOST_HAS_MMAP 0 most-5.0.0a/src/VMSMAKE.COM0000644002657400265740000000334610425445274014132 0ustar davisdavis$! Most Makefile for VMS $! $! S-Lang Include directory (where slang.olb is located) $! $ Link_Flags = "" $ Link_Libs = "" $ slang_dir = "[-.-.slang.src]" $ slang_lib = ",''slang_dir'slang/LIBR" $ defs = "" $ include = slang_dir $! $! If compiling with GCC, uncomment next line $! goto has_gcc $ if (p1 .eqs. "GCC") then goto has_gcc $! $! There should be no need to change anything below here $! $ C_C = "cc/standard=vaxc" $ goto start $ has_gcc: $ C_C = "gcc/warnings/nocase_hack" $ link_libs = "GNU_CC:[000000]GCCLIB/LIB" $! $ start: $ copy mostconf.h config.h $ axp = 0 $ axp = f$getsyi("HW_MODEL").ge.1024 $ exec_name = "most.exe" $ files = "main,buffer,file,window,line,display,sysdep," $ files = files + "keym,most,search,help,cmd,edit,keyparse" $! $ if (p1 .eqs. "LINK") then goto do_link $! $! simple make $! $ if (defs .nes. "") then defs = "/define=(" + defs + ")" $ if (include .nes. "") then include = "/include=(" + include + ")" $ count = 0 $ next_file: $ f = f$element(count, ",", files) $ count = count + 1 $ if (f .eqs. ",") then goto do_link $ objf = f$search("''f'.obj") $ if (objf .eqs. "") then goto compile_it $ tobj = f$file_attr(objf, "RDT") $ tc = f$file_attr("''f'.c", "RDT") $ if (f$cvtime(tc) .lts. f$cvtime(tobj)) then goto next_file $ compile_it: $ write sys$output "''C_C' ''defs' ''include' ''f'.c" $ 'C_C' 'defs' 'include' 'f'.c $ goto next_file $ do_link: $ if axp $ then $ set verify $ link/exec=most.exe 'Link_Flags' 'files', 'slang_dir'slang/LIBR 'Link_Libs' $ set noverify $ else $ set verify $ link/exec=most.exe 'Link_Flags' 'files', 'slang_dir'slang/LIB 'Link_Libs', - sys$input/opt SYS$LIBRARY:VAXCRTL/SHARE $ set noverify $ endif $exit most-5.0.0a/src/DESCRIP.MMS0000644002657400265740000000260110425445274014127 0ustar davisdavis# # MMS file to build MOST. # # Written by Hunter Goatley ( 4-OCT-1993 15:41) # Removed reference to DIR.C, Michael Lemke ( 3-NOV-1995 17:25:44.05) # Moved CC =.. into if clause. New MMS doesn't like redefinition of macros. # 6-AUG-1997 14:43:25.04 Michael Lemke ( 3-NOV-1995 17:25:44.05) # .IFDEF __MATTS_MMS__ .ELSE EXE = .EXE OBJ = .OBJ .ENDIF .IFDEF __ALPHA__ CC = CC/STANDARD=VAXC OPTFILE = OPTIONS = NATIVE = /NONATIVE_ONLY .ELSE CC = CC/STANDARD/VAXC OPTFILE = ,VAXCRTL.OPT OPTIONS = $(OPTFILE)/OPTIONS NATIVE = .ENDIF .IFDEF SLANG_OLB .ELSE SLANG_DIR = [-.SLANG.SRC] SLANG_OLB = $(SLANG_DIR)SLANG$(OLB) .ENDIF CFLAGS = $(CFLAGS)/DEFINE=(USE_SLANG)/INCLUDE=$(SLANG_DIR) LINKFLAGS = $(LINKFLAGS)$(NATIVE)/NOTRACE OBJS = MAIN$(OBJ),- BUFFER$(OBJ),- FILE$(OBJ),- WINDOW$(OBJ),- LINE$(OBJ),- DISPLAY$(OBJ),- SYSDEP$(OBJ),- KEYM$(OBJ),- MOST$(OBJ),- SEARCH$(OBJ),- HELP$(OBJ),- CMD$(OBJ),- EDIT$(OBJ),- KEYPARSE$(OBJ) # DIR$(OBJ),- MOST$(EXE) : config.h $(OBJS)$(OPTFILE) $(LINK)$(LINKFLAGS) $(OBJS)$(OPTIONS),$(SLANG_OLB)/LIBRARY config.h : mostconf.h copy mostconf.h config.h # # Build the linker options file for OpenVMS VAX and VAX C. # VAXCRTL.OPT : @ open/write tmp vaxcrtl.opt @ write tmp "SYS$SHARE:VAXCRTL.EXE/SHARE" @ close tmp most-5.0.0a/src/cmd.c0000644002657400265740000001335510605757777013415 0ustar davisdavis/* This file is part of MOST. Copyright (c) 1991, 1999, 2002, 2005, 2006, 2007 John E. Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "config.h" #include #include #ifdef HAVE_STDLIB_H # include #endif #include #include "jdmacros.h" #include "most.h" #include "search.h" #include "window.h" #include "file.h" #include "keym.h" #include "display.h" #include "sysdep.h" static char getkey_nocase (void) { char ch = most_getkey (); if ((ch >= 'a') && (ch <= 'z')) ch = ch - ' '; SLang_flush_input (); return ch; } void most_next_file (void) { static int next = 1; char *msg = NULL; if (!Most_Num_Files) msg = "File ring is empty."; else if (Most_Num_Files == 1) msg = "There is only one file!"; else { most_do_next_file(&next); } if (msg != NULL) most_message (msg, 1); } void most_toggle_case (void) { char *msg; Most_Case_Sensitive = !Most_Case_Sensitive; if (Most_Case_Sensitive) msg = "Searches now respect case."; else msg = "Searches nolonger respect case."; most_message (msg, 0); } void most_delete_file_cmd (void) { int bell = 0; char ch; char *msg; if ('*' == *Most_Buf->file) return; if (Most_Secure_Mode) Most_D_Opt = 0; if (Most_D_Opt == 0) return; most_select_minibuffer (); SLsmg_printf ("Delete %s? [n]", Most_Buf->file); SLsmg_refresh (); ch = getkey_nocase (); if (ch == 'Y') { if (!most_delete_file(Most_Buf->file)) { msg = "File could not be deleted."; bell = 1; } else msg = "File deleted."; } else msg = "File not deleted."; most_exit_minibuffer (); most_message(msg, bell); } void most_toggle_options (void) { char ch; char *msg = NULL; int n; unsigned int save; most_select_minibuffer(); SLsmg_write_string("Toggle option: b(binary) d(selective display) t(tab) v(verbose) w(wrap)"); SLsmg_gotorc (SLtt_Screen_Rows - 1, 0); SLsmg_refresh (); ch = getkey_nocase(); switch (ch) { default: msg = "\007Invalid option!"; break; case 'B': Most_B_Opt = !Most_B_Opt; Most_Num_Lines = most_count_lines(Most_Beg,Most_Eob); break; case 'D': if (Most_W_Opt) { msg = "\007Selective Display illegal in wrap mode."; break; } if (Most_Digit_Arg == NULL) { msg = "Selective Display off. Prefix with integer to set."; n = 0; } else { msg = "Selective Display is set."; n = abs( *Most_Digit_Arg ); } if (Most_Selective_Display != n) { Most_Selective_Display = n; Most_Num_Lines = most_count_lines(Most_Beg,Most_Eob); most_forward_line (-1); /* This is duplicated below */ /* Most_C_Line = most_count_lines (Most_Beg, Most_C_Pos); */ } break; case 'S': if (Most_B_Opt) msg = "\007Squeezing not available in Binary mode."; else { Most_S_Opt = !Most_S_Opt; Most_Num_Lines = most_count_lines(Most_Beg,Most_Eob); if (Most_S_Opt) msg = "Lines are now squeezed."; else msg = "Line squeezing is turned off"; } break; case 'W': if (Most_Selective_Display) { msg = "\007Wrap mode cannot be enabled while selective display is on."; break; } Most_W_Opt = !Most_W_Opt; Most_Num_Lines = most_count_lines(Most_Beg, Most_Eob); if (Most_W_Opt) msg = "Wrap turned on."; else msg = "Wrap turned off."; break; case 'V': Most_V_Opt = !Most_V_Opt; if (Most_V_Opt) msg = "Control char display is turned on."; else msg = "Control char display is turned off."; break; case 'T': if (Most_Digit_Arg == NULL) Most_T_Opt = !Most_T_Opt; else { Most_Tab_Width = abs( *Most_Digit_Arg ); if (Most_Tab_Width == 0) Most_T_Opt = 1; else Most_T_Opt = 0; } if (Most_T_Opt) msg = "Tabs are nolonger expanded."; else msg = "Tabs are now expanded."; break; } SLsmg_erase_eol (); most_exit_minibuffer(); if ((msg != NULL) && (*msg == '\007')) { most_message (msg + 1, 1); return; } if (!Most_Num_Lines) Most_Num_Lines = 1; most_save_win_flags(Most_Win); save = Most_C_Offset; Most_C_Offset = 0; Most_C_Line = 1; Most_C_Line = most_what_line (Most_Beg + save); Most_C_Offset = save; Most_Win->beg_line = Most_C_Line; most_redraw_window(); most_update_status(); if (msg != NULL) most_message (msg, 0); } /* ----------------------------------------------------------------------*/ void most_extended_key_cmd (void) { char ch; if (Most_Secure_Mode) Most_D_Opt = 0; most_select_minibuffer(); SLsmg_write_string ("Choose: N (next file), C (toggle case), O (toggle options)"); if (Most_D_Opt) SLsmg_write_string (" ,D (delete file)"); SLsmg_gotorc (SLtt_Screen_Rows - 1, 0); SLsmg_refresh (); ch = getkey_nocase(); SLsmg_erase_eol (); most_exit_minibuffer (); switch (ch) { case 'N': most_next_file (); break; case 'C': most_toggle_case (); break; case 'O': most_toggle_options (); break; case 'D': if (Most_D_Opt) { most_delete_file_cmd (); break; } /* drop */ default: most_message ("Invalid option.", 1); } } most-5.0.0a/src/search.c0000644002657400265740000004330710605757777014117 0ustar davisdavis/* -*- mode: C; mode: fold -*- */ /* This file is part of MOST. Copyright (c) 1991, 1999, 2002, 2005, 2006, 2007 John E. Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "config.h" #include #include #include #include "most.h" #include "window.h" #include "line.h" #include "file.h" #include "display.h" #include "search.h" /* Note!!! The regular expression searches may not work. I have not * tested them. * FIXME!!! This whole thing needs to be rewritten. It is a mess. */ int Most_Case_Sensitive = 0; char Most_Search_Str[256]; int Most_Search_Dir = 1; #include "jdmacros.h" #undef SLANG_REGEXP #undef HAVE_V8_REGCOMP #define UPCASE(ch) ((!Most_Case_Sensitive && (ch <= 'z') && (ch >= 'a')) ? (ch - 32) : ch) #if defined(HAVE_V8_REGCOMP) || defined(SLANG_REGEXP) /* * Regular expression stuff * ************************ */ # ifdef HAVE_V8_REGCOMP # include "regexp.h" /* pointer to area malloced by regcomp() */ static struct regexp *regpattern = NULL; # else /* slang regular expression structure */ #if SLANG_VERSION < 20000 static SLRegexp_Type regdata; /* buffer for compiled regular expression */ static unsigned char regbuf[sizeof(Most_Search_Str) * 3]; #else static SLRegexp_Type *Regexp; #endif # endif /* HAVE_V8_REGCOMP */ /* set if regexp compiled OK, 0 if regular expression error */ static int regcompOK = 1; /* uncompiled search pattern */ static char savepattern[sizeof(Most_Search_Str)]; /* * This function is called by the V8 regcomp to report * errors in regular expressions. */ static void regerror(char *s) { char string[256]; regcompOK = 0; /* clear flag, ie regexp error */ sprintf(string, "Regular expression error: %s", s); most_message(string, 1); } /* * Compiles the search pattern "key" into a regular expression for use by * do_regexec() * * Returns: 1 success * 0 error * */ static int do_regcomp(unsigned char *key) { static int old_Most_Case_Sensitive; unsigned char UpCaseKey[sizeof(savepattern)]; # ifndef HAVE_V8_REGCOMP int posn; /* reg exp error at this offset */ # endif /* * Only recompile search string if it has changed */ if ((0 == strcmp ((char *)key, (char *) savepattern)) && (Most_Case_Sensitive == old_Most_Case_Sensitive)) return 1; # ifdef HAVE_V8_REGCOMP if (regpattern != NULL) free(regpattern); # endif if ( strlen((char *)key) >= sizeof(savepattern) ) { regerror("Search string too long"); savepattern[0] = '\0'; return 0; } old_Most_Case_Sensitive = Most_Case_Sensitive; if ( Most_Case_Sensitive == 0 ) { register unsigned char *p; /* ptr to UpCaseKey */ register unsigned char *keyp; /* ptr to key */ register unsigned char c; /* source character */ /* * Make a upper case copy of every character from "key" * into "UpCaseKey" */ p = UpCaseKey; keyp = key; while ( (c = *keyp++) != '\0' ) *p++ = UPCASE(c); *p = '\0'; } strcpy((char *)savepattern, (char *)key); # ifdef HAVE_V8_REGCOMP regpattern = regcomp((char *)(Most_Case_Sensitive ? key : UpCaseKey)); if (regpattern == NULL) { regcompOK = 1; return 1; } # else # if SLANG_VERSION < 20000 regdata.case_sensitive = 1; regdata.buf = regbuf; regdata.pat = Most_Case_Sensitive ? key : UpCaseKey; regdata.buf_len = sizeof (regbuf); posn = SLang_regexp_compile(®data); # else if (Regexp != NULL) SLregexp_free (Regexp); if (NULL == (Regexp = SLregexp_compile ((char *)key, Most_Case_Sensitive ? 0 : SLREGEXP_CASELESS))) posn = -1; else posn = 0; # endif if (posn == 0) { regcompOK = 1; return 1; } regerror ("Unable to compile pattern"); # endif /* HAVE_V8_REGCOMP */ /* * regcomp has already printed error message via regerror(). */ savepattern[0] = '\0'; return 0; /* failure */ } /* * Call the appropriate regular expression execute function */ static unsigned char *do_regexec(unsigned char *string, unsigned int len) { # ifdef HAVE_V8_REGCOMP if ( regexec(regpattern, (char *)string) ) return( (unsigned char *)regpattern->startp[0] ); else return( NULL ); # else # if SLANG_VERSION < 20000 return ( SLang_regexp_match(string, len, ®data) ); # else return (unsigned char *)SLregexp_match (Regexp, (char *)string, len)); # endif # endif /* HAVE_V8_REGCOMP */ } /* * Make a upper case copy of a string. Also changes any "c\b" character * strings into just "" so that highlighted and underlined characters * can be searched. * * Reuses malloced memory, so a copy cannot be retained between calls. */ static unsigned char *StrUpCaseCopy(unsigned char *input) { static unsigned char *uppercase; /* ptr to malloced area */ static size_t bufsize; /* size of malloced area */ unsigned char *src; /* ptr to source */ register unsigned char *dest; /* ptr to destination */ register int idx; /* index into uppercase[] */ register unsigned char c; /* source character */ size_t length; /* size of string to copy */ src = input; length = strlen((char *)src) + 1; /* len of line plus terminator */ if ( length > bufsize ) { if ( uppercase != (unsigned char *)NULL ) free(uppercase); bufsize = (length > 256 ) ? length : 256; /* 256 byte default */ uppercase = (unsigned char *)malloc(bufsize); if ( uppercase == (unsigned char *)NULL ) return(NULL); } /* * Make the copy converting to upper case as we go */ dest = uppercase; for ( idx = 0 ; (c = *src) != '\0' ; src++ ) { if ( c == '\b' ) /* backspace */ { if ( idx-- > 0 ) dest--; /* back up dest pointer */ } else { if ( idx++ >= 0 ) *dest++ = UPCASE(c); } } *dest = '\0'; /* add termination */ return(uppercase); } /* * Given an offset into a copy made by StrUpCaseCopy() and a pointer to the * original string, returns a pointer into the original string corresponding * to this offset. */ static unsigned char *GetOrigPtr(unsigned char *original, int offset) { register unsigned char *p = original; register int j = offset; /* * Step through, adjusting offset according to backspaces found */ while ( *p != '\0' ) { if ( *p == '\b' ) j++; else j--; if ( j < 0 ) break; else p++; } return(p); } #endif /* HAVE_V8_REGCOMP || SLANG_REGEXP */ /* This routine returns the 1 + position of first match of key in str. key is modified to match the case of str. */ /* We should try to optimize this routine */ /* searches from beg up to but not including end */ #if defined(SLANG_REGEXP) static unsigned char * forw_search_region_regexp (unsigned char *beg, unsigned char *end, unsigned char *key) { if (Regexp != NULL) SLregexp_free (Regexp); if (NULL == (Regexp = SLregexp_compile ((char *)key, Most_Case_Sensitive ? 0 : SLREGEXP_CASELESS))) return NULL; if ( do_regcomp(key) == 0 ) return(Most_Eob); /* * For regular expression searches we need to do a line by line * search, so it is necessary to temporarily replace '\n' with '\0' * characters. * * ***** THIS IS NOT ALLOWED FOR MMAPPED FILES!!!!!!!!! ***** */ p = beg; linebeg = beg; while (linebeg < end) { while ((p < end) && (*p != '\n')) p++; if (p == end) break; /* *p = 0; -- not allow for mmapped files */ if ( Most_Case_Sensitive == 0 ) /* i.e. case insensitive */ { copy = StrUpCaseCopy(linebeg); if ( copy == (unsigned char *)NULL ) return(Most_Eob); } /* * Quick sanity check for beginning of line archored tests. * If 1st char of key is "^", then the character before linebeg (which * must be beyond the start of the window), must be a "\n", * otherwise do_regexec() isn't called. */ if ( # if 0 ((*key != '^') || (linebeg > Most_Win->beg_pos && linebeg[-1] == '\n')) && #endif (match = do_regexec(Most_Case_Sensitive ? linebeg : copy))) { /* *p = '\n'; --- NOT ALLOWED */ if ( Most_Case_Sensitive == 0 ) { /* * Use offset into "copy" as idx to find point in * real line. */ return( GetOrigPtr(linebeg, match - copy) ); } else { return( match ); } } /* *p++ = '\n'; */ linebeg = p; } return(Most_Eob); } #endif static unsigned char *forw_search_region(unsigned char *beg, unsigned char *end, unsigned char *key) { #if defined(HAVE_V8_REGCOMP) || defined(SLANG_REGEXP) return forw_search_region_regexp (beg, end, key); #else char ch, char1, work[256]; unsigned char *pos; int key_len,j, str_len; if (Most_Case_Sensitive) { strcpy(work, (char *) key); key_len = strlen((char *) key); } else { /* upcase key */ key_len = 0; while (0 != (ch = key[key_len])) { ch = UPCASE(ch); work[key_len++] = ch; /* null char is ok */ } } if (key_len == 0) return Most_Eob; str_len = (int) (end - beg); if (str_len < key_len) return (Most_Eob); # if 0 str_len -= key_len; /* effective length */ end -= (key_len - 1); # endif char1 = work[0]; while (1) { /* Find first character that matches */ while (1) { if (beg == end) return Most_Eob; ch = *beg++; ch = UPCASE(ch); if (ch == char1) break; } /* so we have a position of possible match */ j = 1; pos = beg; /* save this position so we start from here again */ while (1) { if (j == key_len) return pos - 1; if (beg == end) break; ch = *beg++; /* FIXME: This only works for x^Hx but not x^Hx^Hx... * It is probably better to skip all the ^H characters * until the end. That is, regard "a^Hb^Hc" as 'c'. */ if ((ch == 8) && (beg + 1 < end) && (Most_V_Opt == 0) && ((work[j - 1] == UPCASE(*beg)) || (*beg == '_'))) { ch = *(beg + 1); beg += 2; } else if ((ch == '_') && (beg + 1 < end)) { ch = *beg++; if (ch == 8) ch = *beg++; else { ch = '_'; beg--; } } if (UPCASE(ch) != work[j]) break; j++; } beg = pos; } #endif /* HAVE_V8_REGCOMP || SLANG_REGEXP */ } /* * Search backwards in the buffer "beg" up to, but not including "end" for * pattern "key". */ static unsigned char *back_search_region(unsigned char *beg, unsigned char *end, unsigned char *key) { #if defined(HAVE_V8_REGCOMP) || defined(SLANG_REGEXP) register unsigned char *p; unsigned char *endp, /* end of line */ *lastmatch, /* last match in line */ *endprevline, /* end of line before this one */ *match; /* ptr to matching string */ unsigned char savec; /* last char on line */ /* * Compile "key" into an executable regular expression */ if ( do_regcomp(key) == 0 ) return(Most_Eob); /* * Starting from the end of the buffer, break the buffer into lines * then for each line do forward search to find a match. If one is * found, move pointer forward one character and try again until * unsuccessful. In this way we find the last match on the line * and isn't that what we want to do in a reverse search. */ endp = end; lastmatch = Most_Eob; while ( 1 ) /* forever loop */ { if ( (endp < beg) ) return(Most_Eob); /* Reach start of buffer, no match */ /* Find the real end of current line */ if ( (p = (unsigned char *)strchr((char *)endp, '\n')) != NULL ) endp = p; savec = *endp; *endp = '\0'; /* terminate line with NULL */ /* Find the beginning of line */ for ( p = endp - 1 ; (p >= beg) && (*p != '\n') ; p-- ) { } endprevline = p; p++; /* point to 1st char after newline */ /* * Keep searching forward in this line till no more matches */ if ( Most_Case_Sensitive == 0 ) /* i.e. case insensitive */ { unsigned char *copy; /* ptr to upper case copy */ unsigned char *savecopy; /* copy of "copy" */ copy = StrUpCaseCopy(p); if ( copy == (unsigned char *)NULL ) return(Most_Eob); savecopy = copy; /* * Quick sanity check for beginning of line archored tests. * Must be at start of line. */ while ( ((*key != '^') || (copy == savecopy)) && (match = do_regexec(copy)) ) { if ( GetOrigPtr(p, match - savecopy) > end ) break; lastmatch = match; if ( *lastmatch == '\0' ) /* key must be "$" or "^" */ break; copy = lastmatch + 1; /* character after match */ } if ( lastmatch != Most_Eob ) /* found a match */ lastmatch = GetOrigPtr(p, lastmatch - savecopy); } else { /* * Quick sanity check for beginning of line archored tests. * Must be at start of buffer or start of line */ while ( ( (*key != '^') || (p == endprevline + 1) ) && (match = do_regexec(p)) ) { if ( match > end ) break; lastmatch = match; if ( *lastmatch == '\0' ) /* key must be "$" or "^" */ break; p = lastmatch + 1; /* character after match */ } } *endp = savec; if ( lastmatch != Most_Eob ) /* found a match */ return(lastmatch); endp = endprevline; } #else char ch, char1, work[256]; unsigned char *pos; int key_len,j, str_len; if (Most_Case_Sensitive) { strcpy(work, (char *) key); key_len = strlen((char *) key); } else { /* upcase key */ key_len = 0; while (0 != (ch = key[key_len])) { ch = UPCASE(ch); work[key_len++] = ch; /* null char is ok */ } } if (key_len == 0) return Most_Eob; str_len = (int) (end - beg); if (str_len < key_len) return Most_Eob; # if 0 str_len = str_len - key_len; /* effective length */ beg += key_len; # endif char1 = work [key_len - 1]; while (1) { while (1) { if (end < beg) return Most_Eob; ch = *end--; ch = UPCASE (ch); if (ch == char1) break; } pos = end; /* save this position so we start from here again */ j = key_len - 2; while (1) { if (j < 0) return end + 1; if (end < beg) break; ch = *end--; if ((ch == 8) && (end >= beg + 1) && (Most_V_Opt == 0) && ((work[j + 1] == UPCASE(*end)) || (*end == '_'))) { ch = *(end - 1); end -= 2; } else if ((ch == '_') && (end >= beg + 1) && (Most_V_Opt == 0)) { ch = *end--; if (ch == 8) ch = *end--; else { ch = '_'; end++; } } if (UPCASE (ch) != work[j]) break; j--; } end = pos; } #endif /* HAVE_V8_REGCOMP || SLANG_REGEXP */ } int most_search(unsigned char *from, int repeat, MOST_INT *col) { /* return the line match was found as well as line number, * search from i on; assume that line_array match the i so we need * no initial lookup */ int test; MOST_INT save_line, the_col, row, s_len; char string[300]; unsigned char *pos; unsigned int save_ofs; unsigned int found_ofs; if ((from < Most_Beg) || (from > Most_Eob)) return(-1); save_ofs = Most_C_Offset; save_line = Most_C_Line; found_ofs = Most_Eob - Most_Beg; *col = 0; s_len = strlen (Most_Search_Str); pos = from; if (*Most_Search_Str) { test = repeat && (pos < Most_Eob) && (pos >= Most_Beg); while(test) { if (Most_Search_Dir == 1) { while (1) { unsigned int pos_ofs; pos = forw_search_region(pos, Most_Eob, (unsigned char*) Most_Search_Str); pos_ofs = (unsigned int) (Most_Eob - Most_Beg); if (pos < Most_Eob) break; if (0 == most_read_file_dsc (10)) { /* Pointer may be invalid after this call */ pos = Most_Beg + pos_ofs; break; } /* This might need an adjustment */ pos = Most_Beg + (pos_ofs - s_len); if (pos < Most_Beg) pos = Most_Beg; } } else pos = back_search_region(Most_Beg, pos, (unsigned char *) Most_Search_Str); if (pos < Most_Eob) { repeat--; found_ofs = pos - Most_Beg; if (Most_Search_Dir == 1) pos += s_len; else pos--; } test = repeat && (pos < Most_Eob) && (pos >= Most_Beg); } } if (repeat) /* not found */ { *col = 0; #if defined(HAVE_V8_REGCOMP) || defined(SLANG_REGEXP) if ( regcompOK ) /* don't print error msg if regerr msg */ { #endif if (Most_Search_Str[0] == '\0') most_message("Search string not specified.",1); else { (void) sprintf(string,"Search failed: %s",Most_Search_Str); most_message(string,1); } #if defined(HAVE_V8_REGCOMP) || defined(SLANG_REGEXP) } #endif row = -1; } else /* if ( !Most_T_Opt && !Most_B_Opt) */ /* expand tabs to get col correct */ { most_find_row_column(Most_Beg + found_ofs, &row, &the_col); if (Most_B_Opt) *col = the_col + 52; else *col = 1 + most_apparant_distance(Most_Beg + found_ofs); } Most_C_Offset = save_ofs; Most_C_Line = save_line; if (row > 0) Most_Curs_Offset = found_ofs; return row; } most-5.0.0a/src/window.c0000644002657400265740000005520010670005230014120 0ustar davisdavis/* This file is part of MOST. Copyright (c) 1991, 1999, 2002, 2005, 2006, 2007 John E. Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "config.h" #include #ifndef VMS # include #endif #ifdef HAVE_STDLIB_H # include #endif #ifdef HAVE_UNISTD_H # include #endif #include #include "jdmacros.h" #include "window.h" #include "search.h" #include "display.h" #include "most.h" #include "sysdep.h" #include "file.h" #include "line.h" char *Most_Global_Msg = "Press `Q' to quit, `H' for help, and SPACE to scroll."; Most_Window_Type *Most_Win; Most_Window_Type *Most_Top_Win; int Most_Top_Line; /* row number of top window */ int Most_Curs_Row; int Most_Curs_Col; int Most_Column = 1; int Most_Restore_Width_To = 0; char Most_Mini_Buf[256]; unsigned long Most_Curs_Offset; static int Beep_Mini = 0; static int Minibuffer_Selected; void most_message(char *what, int how) { strcpy (Most_Mini_Buf,what); if (how) Beep_Mini = 1; else Beep_Mini = 0; } static char *Last_Message; void most_select_minibuffer() { SLsmg_gotorc (SLtt_Screen_Rows - 1, 0); SLsmg_erase_eol (); /* SLsmg_refresh (); */ Last_Message = NULL; Minibuffer_Selected = 1; } void most_exit_minibuffer() { #if 0 SLsmg_gotorc (SLtt_Screen_Rows - 1, 0); SLsmg_erase_eol (); #endif Minibuffer_Selected = 0; } static void put_message_1 (char *what) { most_select_minibuffer (); SLsmg_write_string (what); most_exit_minibuffer(); Last_Message = what; } void most_flush_message (char *msg) { SLsmg_gotorc (SLtt_Screen_Rows - 1, 0); SLsmg_write_string (msg); SLsmg_erase_eol (); SLsmg_refresh (); } void most_put_message () { if (Beep_Mini) SLtt_beep(); put_message_1 ((char *) Most_Mini_Buf); if (Beep_Mini) { SLsmg_refresh (); /* wait half a second */ if (SLang_input_pending (5)) { (void) most_getkey (); SLKeyBoard_Quit = 0; SLang_set_error (0); } } Beep_Mini = 0; *Most_Mini_Buf = 0; } /* puts 'what in the minibuffer to be edited. */ /* returns number of chars read */ SLang_RLine_Info_Type *Most_RLI; #if SLANG_VERSION < 20000 typedef SLang_RLine_Info_Type SLrline_Type; static void rline_update (unsigned char *buf, int len, int col) { SLsmg_gotorc (SLtt_Screen_Rows - 1, 0); SLsmg_write_nchars ((char *) buf, len); SLsmg_erase_eol (); SLsmg_gotorc (SLtt_Screen_Rows - 1, col); SLsmg_refresh (); } #else static void rline_update (SLrline_Type *rli, char *prompt, char *buf, unsigned int len, unsigned int point, VOID_STAR client_data) { int col; (void) client_data; (void) rli; while (1) { SLsmg_gotorc (SLtt_Screen_Rows - 1, 0); SLsmg_write_string (prompt); SLsmg_write_nchars (buf, point); col = SLsmg_get_column (); SLsmg_write_nchars (buf + point, len - point); if (col < SLtt_Screen_Cols) break; buf++; point--; len--; /* FIXME for UTF-8 */ } SLsmg_erase_eol (); SLsmg_gotorc (SLtt_Screen_Rows - 1, col); SLsmg_refresh (); } #endif #if SLANG_VERSION < 20000 static SLang_RLine_Info_Type *init_readline (void) { unsigned char *buf = NULL; SLang_RLine_Info_Type *rli; if ((NULL == (rli = (SLang_RLine_Info_Type *) SLMALLOC (sizeof(SLang_RLine_Info_Type)))) || (NULL == (buf = (unsigned char *) SLMALLOC (256)))) { fprintf(stderr, "malloc error.\n"); exit(11); } SLMEMSET ((char *) rli, 0, sizeof (SLang_RLine_Info_Type)); rli->buf = buf; rli->buf_len = 255; rli->tab = 8; rli->dhscroll = 20; rli->getkey = most_getkey; rli->tt_goto_column = NULL; rli->update_hook = rline_update; if (SLang_init_readline (rli) < 0) { most_exit_error ("Unable to initialize readline library."); } return rli; } static char *SLrline_read_line (SLrline_Type *rli, char *prompt, unsigned int *lenp) { int i; rli->prompt = prompt; i = SLang_read_line (rli); if (i < 0) { *lenp = 0; return NULL; } *lenp = i; return SLmake_string ((char *)rli->buf); } static int SLrline_set_line (SLrline_Type *rli, char *what) { strcpy ((char *)rli->buf, what); return 0; } #define SLrline_save_line SLang_rline_save_line static int SLrline_set_point (SLrline_Type *rli, int point) { rli->point = point; return 0; } #else static SLang_RLine_Info_Type *init_readline (void) { SLang_RLine_Info_Type *rli; unsigned int flags = SL_RLINE_BLINK_MATCH; if (Most_UTF8_Mode) flags |= SL_RLINE_UTF8_MODE; if (NULL == (rli = SLrline_open (SLtt_Screen_Cols, flags))) return NULL; (void) SLrline_set_update_hook (rli, rline_update, NULL); return rli; } #endif int most_read_from_minibuffer(char *prompt, char *stuff, char *what, unsigned int buflen) { int i = 0; char *buf; unsigned int len; if (Most_RLI == NULL) { Most_RLI = init_readline (); } #if SLANG_VERSION < 20000 Most_RLI->edit_width = SLtt_Screen_Cols - 1; Most_RLI->prompt = prompt; *Most_RLI->buf = 0; #else SLrline_set_display_width (Most_RLI, SLtt_Screen_Cols); #endif most_select_minibuffer(); /* do not use default. The up arrow can always get it back. */ if (stuff != NULL) { if (-1 == SLrline_set_line (Most_RLI, stuff)) return -1; SLrline_set_point (Most_RLI, strlen (stuff)); } buf = SLrline_read_line (Most_RLI, prompt, &len); if ((buf != NULL) && (0 == SLang_get_error()) && !SLKeyBoard_Quit) { SLrline_save_line (Most_RLI); strncpy(what, (char *) buf, buflen); what[buflen-1] = 0; } SLfree (buf); if (SLKeyBoard_Quit) i = -1; SLang_set_error (0); SLKeyBoard_Quit = 0; most_exit_minibuffer(); if (i == -1) most_message ("Aborted!", 1); return i; } void most_clear_minibuffer() { Most_Mini_Buf[0] = '\0'; Beep_Mini = 0; most_put_message (); } void most_check_minibuffer () { if (*Most_Mini_Buf) most_put_message (); else if (Last_Message != Most_Global_Msg) put_message_1 (Most_Global_Msg); } static int get_scroll(int *line) { /* line is the line we want at the top of the window if possible */ int dtop, dbot,n,top,bot,wsize; top = Most_Win->beg_line; wsize = Most_Win->bot - Most_Win->top; /* actually 1 less than window size */ bot = top + wsize; if ((*line == 1) && (top == 1)) { Most_Curs_Col = Most_Curs_Row = 1; if (Most_C_Offset != 0) { Most_C_Offset = 0; Most_C_Line = 1; return 0; } most_message("Top of Buffer.",0); return(0); } /* handles endof file in a window */ if ((bot > Most_Num_Lines) && *line > Most_C_Line) { *line = top; most_message("End of Buffer.",1); return(0); } if (Most_Num_Lines <= wsize) /* short file */ { *line = 1; return(0); } dtop = top - 1; dbot = Most_Num_Lines - bot; n = *line - top; if ((n>0) && (dbot < n)) { n = dbot; *line = top + n; if (!n) most_message("End of buffer.",1); } else if ((n < 0) && (dtop + n < 0)) { n = -dtop; *line = n + top; if (!n) { Most_Curs_Col = Most_Curs_Row = 1; if (Most_C_Offset != 0) { Most_C_Offset = 0; Most_C_Line = 1; return 0; } most_message("Top of buffer.",0); } } return(n); } static void check_dirty_flag (void) { if (Most_Win->dirty_flag == 0) return; Most_Win->dirty_flag = 0; /* Most_Num_Lines = most_count_lines (Most_Beg, Most_Eob); */ Most_Win->n_lines = Most_Num_Lines; } void most_update_window (int line) { int save_line, save_col; unsigned long save_offset; most_read_to_line (line); check_dirty_flag (); if (Most_Column != Most_Win->col) { if (Most_Column < 1) Most_Column = 1; if (Most_Column != Most_Win->col) { save_offset = Most_Curs_Offset; save_line = Most_Curs_Row; save_col = Most_Curs_Col; most_redraw_window (); most_update_status (); Most_Win->curs_offset = Most_Curs_Offset = save_offset; Most_Win->curs_line = Most_Curs_Row = save_line; Most_Win->curs_col = Most_Curs_Col = save_col; } return; } (void) get_scroll (&line); most_goto_line (line); most_redraw_window (); most_update_status (); } /* updates current window as well as scroll lock ones */ /* Although current window is update in an absolute fashion, scroll locked ones are updated in a relative fashion */ void most_update_windows (int line) { int dline,flg; Most_Window_Type *w; if (line == -1) { check_dirty_flag (); line = Most_Num_Lines; } dline = line - Most_C_Line; most_update_window(line); if (!Most_Win->lock) return; flg = 0; w = Most_Win; while(Most_Win = Most_Win->next, Most_Win != w) { if (Most_Win->lock) { flg = 1; most_set_window(Most_Win); line = Most_C_Line + dline; most_update_window(line); } } Most_Win = w; if (flg) most_set_window(Most_Win); } void most_redraw_window (void) { int n, r; check_dirty_flag (); n = Most_Win->bot - Most_Win->top; if ((Most_C_Line + n) > Most_Num_Lines) most_goto_line (Most_Num_Lines - n); Most_Curs_Offset = Most_C_Offset; Most_Win->curs_offset = Most_Win->top_offset = Most_Curs_Offset; Most_Win->beg_line = Most_C_Line; Most_Win->col = Most_Column; Most_Win->curs_col = Most_Curs_Col = 1; Most_Win->curs_line = Most_Curs_Row = 1; r = Most_Win->top; most_goto_rc (r, 1); most_display_line (); while (n--) { r++; most_goto_rc (r, 1); if (most_forward_line(1)) most_display_line(); else SLsmg_erase_eol (); } Most_C_Offset = Most_Win->top_offset; Most_C_Line = Most_Win->beg_line; } #define MOST_V_OPT 1 #define MOST_T_OPT 2 #define MOST_B_OPT 4 #define MOST_S_OPT 8 #define MOST_W_OPT 16 /* associates current window with current buffer */ void most_save_win_flags(Most_Window_Type *w) { w->flags = 0; if (Most_V_Opt) w->flags |= MOST_V_OPT; if (Most_B_Opt) w->flags |= MOST_B_OPT; if (Most_T_Opt) w->flags |= MOST_T_OPT; if (Most_W_Opt) w->flags |= MOST_W_OPT; if (Most_S_Opt) w->flags |= MOST_S_OPT; w->n_lines = Most_Num_Lines; w->display = Most_Selective_Display; } void most_window_buffer() { Most_Win->beg_line = Most_C_Line; Most_Win->top_offset = Most_C_Offset; Most_Win->col = Most_Column; Most_Win->buf = Most_Buf; Most_Selective_Display = 0; most_save_win_flags(Most_Win); Most_Curs_Row = Most_Win->curs_line = 1; Most_Curs_Col = Most_Win->curs_col = 1; Most_Curs_Offset = Most_Win->curs_offset = Most_Win->top_offset; } static void restore_win_flags (void) { Most_V_Opt = Most_Win->flags & MOST_V_OPT; Most_B_Opt = Most_Win->flags & MOST_B_OPT; Most_T_Opt = Most_Win->flags & MOST_T_OPT; Most_W_Opt = Most_Win->flags & MOST_W_OPT; Most_S_Opt = Most_Win->flags & MOST_S_OPT; Most_Num_Lines = Most_Win->n_lines; Most_Selective_Display = Most_Win->display; } static Most_Window_Type *make_window(int r1,int r2) { Most_Window_Type *neew; neew = (Most_Window_Type *) MOSTMALLOC(sizeof(Most_Window_Type)); SLMEMSET ((char *) neew, 0, sizeof (Most_Window_Type)); #if 0 neew->status = (char *) MOSTMALLOC(256); SLMEMSET (neew->status, 0, SLtt_Screen_Cols + 1); #endif neew->col = Most_Column; neew->top = r1; neew->bot = r2; neew->lock = 0; neew->buf = NULL; most_save_win_flags(neew); neew->dirty_flag = 1; return(neew); } int Most_Display_Inited = 0; static void error_hook (char *msg) { most_message (msg, 1); } void most_init_display () { int h = SLtt_Screen_Rows; if (Most_Display_Inited) return; Most_Display_Inited = 1; most_get_term_dimensions(&SLtt_Screen_Cols, &SLtt_Screen_Rows); if (Most_Win == NULL) { Most_Top_Win = Most_Win = make_window(1,SLtt_Screen_Rows - 2); Most_Win->prev = Most_Win->next = Most_Win; } else if (h > SLtt_Screen_Rows) most_resize_display (); else Most_Top_Win->prev->bot = SLtt_Screen_Rows - 2; SLsmg_init_smg (); SLang_Error_Hook = error_hook; most_goto_rc (Most_Win->top,1); Most_Display_Inited = 1; /* SLsmg_refresh (); */ } void most_reset_display() { if (Most_Display_Inited == 0) return; SLsmg_reset_smg (); if (Most_Restore_Width_To) { most_set_width(Most_Restore_Width_To, 0); Most_Restore_Width_To = 0; } Most_Display_Inited = 0; } static void update_status1 (void) { char info[256]; char buf[32]; char *file; unsigned int len; unsigned int num_chars; unsigned int field_width, info_len; unsigned char *eob; int r; MOST_INT x; eob = Most_Eob; #if MOST_HAS_MMAP if (Most_Buf->is_mmaped) eob = Most_Beg + Most_Buf->mmap_size; #endif if (eob == Most_Beg) x = 100; else { x = Most_C_Offset * 100; x = x / (eob - Most_Beg); } if (Most_C_Line + (Most_Win->bot - Most_Win->top + 1) >= Most_Num_Lines) x = 100; /* for files with end of file above the bottom row (due to window manipulations) */ if (x > 100) x = 100; sprintf (info, "(" MOST_INT_D_FMT ",%d) " MOST_INT_D_FMT "%%", Most_C_Line, Most_Column, x); r = Most_Win->bot + 1; most_goto_rc (r,1); most_tt_reverse_video (); buf[0] = '-'; if (Most_Win->lock) buf[1] = '*'; else buf[1] = '-'; strcpy (buf + 2, " MOST: "); num_chars = strlen (buf); SLsmg_write_nchars (buf, num_chars); /* So far num_chars have been written out. We would like to put the * line number information about info_len charcters from the RHS of the * screen. This leaves a field width of * SLtt_Screen_Cols - (16 + num_chars) for the filename. */ info_len = strlen (info); field_width = 12; if (info_len > field_width) field_width = info_len; field_width = field_width + num_chars; if (field_width > (unsigned int)SLtt_Screen_Cols) field_width = 0; else field_width = (unsigned int)SLtt_Screen_Cols - field_width; file = Most_Win->buf->file; len = strlen (file); if (len >= field_width) { /* Filename does not fit. So, only display the trailing characters * of the Filename. Indicate this with ... */ if (field_width > 3) { buf[0] = '.'; buf[1] = '.'; buf[2] = '.'; SLsmg_write_nchars (buf, 3); len += 3; } file += (len - field_width); } SLsmg_write_string (file); SLsmg_erase_eol (); most_goto_rc (r, num_chars + field_width + 1); SLsmg_write_nchars (info, info_len); most_tt_normal_video(); } void most_update_status (void) { check_dirty_flag (); Most_C_Line = Most_Win->beg_line; Most_C_Offset = Most_Win->top_offset; /* most_set_scroll_region(1,SLtt_Screen_Rows); */ update_status1(); /* most_set_scroll_region(Most_Win->top,Most_Win->bot); */ /* SLsmg_refresh (); */ } /* splits window-- no screen update, does not affect scrolling region */ int most_split_window (void) { Most_Window_Type *new, *old; int b2,t2,b1, line; b2 = Most_Win->bot; b1 = (Most_Win->bot + Most_Win->top) / 2 - 1; t2 = b1 + 2; if ((b1 == Most_Win->top) || (t2 == b2)) return(0); /* line is top line of new window. */ line = Most_Win->beg_line + t2 - Most_Win->top; old = Most_Win; Most_Win->bot = b1; new = make_window(t2,b2); /* add to ring */ Most_Win->next->prev = new; new->next = Most_Win->next; new->prev = Most_Win; Most_Win->next = new; new->beg_line = line; new->buf = Most_Buf; #if 0 /* new window status line is at same position as old */ strcpy(new->status,Most_Win->status); #endif return(1); } void most_two_windows() { int line; Most_Window_Type *nnew, *old; if (!most_split_window()) return; old = Most_Win; nnew = Most_Win->next; line = nnew->beg_line; if (line + nnew->bot - nnew->top > Most_Num_Lines) { most_other_window(1); /* since split window left nnew window undefined... */ Most_C_Offset = old->top_offset; Most_C_Line = old->beg_line; if (Most_Num_Lines <= nnew->bot - nnew->top + 1) { Most_C_Line = nnew->beg_line = 1; Most_C_Offset = 0; nnew->top_offset = 0; most_redraw_window(); most_update_status(); } else if (line > Most_Num_Lines) { most_goto_line(Most_Num_Lines - nnew->bot + nnew->top); Most_Win->top_offset = Most_C_Offset; Most_Win->beg_line = Most_C_Line; most_redraw_window(); most_update_status(); } else { most_goto_line(line); Most_Win->top_offset = Most_C_Offset; Most_Win->beg_line = Most_C_Line; most_update_window(Most_Num_Lines - nnew->bot + nnew->top); } Most_Win->curs_line = 1; Most_Win->curs_col = Most_Column; Most_Win->curs_offset = Most_C_Offset; most_other_window(-1); } else { Most_Win = nnew; (void) most_forward_line(line - old->beg_line); nnew->beg_line = Most_C_Line; nnew->curs_line = 1; nnew->curs_col = Most_Column; nnew->top_offset = Most_C_Offset; nnew->curs_offset = Most_C_Offset; most_update_status(); Most_Win = old; } most_update_status(); } static void delete_other_windows (void) { Most_Window_Type *w, *tmp; if (Most_Win->next == Most_Win) return; w = Most_Win; Most_Win = Most_Win->next; /* delete other windows preserving the ring! */ while (Most_Win != w) { most_free_window_buffer(); /* needs a ring */ tmp = Most_Win->next; #if 0 /* if this is the bottom window, save its status line */ if (tmp == Most_Top_Win) strcpy(w->status,Most_Win->status); #endif tmp->prev = Most_Win->prev; Most_Win->prev->next = tmp; #if 0 SLFREE(Most_Win->status); #endif SLFREE(Most_Win); Most_Win = tmp; } Most_Win = w; } void most_one_window () { /* Note: This is called from a SIGWINCH signal handler. As a result, make * sure that top, bot is set. */ if (Most_Win->next != Most_Win) delete_other_windows (); Most_Win->top = 1; Most_Win->bot = SLtt_Screen_Rows - 2; if (Most_Win->bot < 1) Most_Win->bot = 1; Most_Top_Win = Most_Win; most_redraw_window(); most_update_status(); } void most_set_window (Most_Window_Type *w) { Most_Win = w; if (Most_Win->buf == NULL) { Most_Win->buf = Most_Buf; if (Most_Buf == NULL) return; } most_switch_to_buffer(Most_Win->buf); Most_C_Offset = Most_Win->top_offset; Most_Curs_Offset = Most_Win->curs_offset; Most_Curs_Row = Most_Win->curs_line; Most_Curs_Col = Most_Win->curs_col; Most_C_Line = Most_Win->beg_line; Most_Column = Most_Win->col; restore_win_flags(); check_dirty_flag (); most_point_cursor (); } void most_other_window(int n) { if (!n) return; Most_Win->top_offset = Most_C_Offset; Most_Win->curs_offset = Most_Curs_Offset; Most_Win->curs_line = Most_Curs_Row; Most_Win->curs_col = Most_Curs_Col; Most_Win->beg_line = Most_C_Line; Most_Win->col = Most_Column; most_save_win_flags(Most_Win); if (n < 0) while (n++) Most_Win = Most_Win->prev; else while (n--) Most_Win = Most_Win->next; most_set_window(Most_Win); } /* kills window by moving lower window up */ static void delete_as_top_window (void) { int t1,t2,b1,b2; t1 = Most_Win->top; t2 = Most_Win->next->top; b1 = Most_Win->bot; b2 = Most_Win->next->bot; Most_Win->prev->next = Most_Win->next; Most_Win->next->prev = Most_Win->prev; most_other_window(1); Most_Win->top = t1; most_redraw_window(); most_update_status(); } /* free buffer for this window if no other windows are viewing it. */ void most_free_window_buffer (void) { Most_Window_Type *w; Most_Buffer_Type *b; w = Most_Win->next; while(Most_Win != w) { if (Most_Win->buf == w->buf) return; w = w->next; } b = w->buf; if (b == NULL) return; most_close_buffer_file (b); Most_Win->buf = NULL; SLFREE(b); } void most_free_windows (void) { Most_Window_Type *w; while (Most_Win != NULL) { most_free_window_buffer (); w = Most_Win->next; w->prev = Most_Win->prev; Most_Win->prev->next = w; #if 0 SLFREE (Most_Win->status); #endif SLFREE (Most_Win); if (w == Most_Win) w = NULL; Most_Win = w; } Most_Buf = NULL; Most_Beg = Most_Eob = NULL; Most_C_Line = 0; Most_Num_Lines = Most_C_Line = 0; } void most_delete_window (void) { int new_b, old_b; Most_Window_Type *w; w = Most_Win; if (Most_Win->next == Most_Win) return; most_free_window_buffer(); if (Most_Win->next != Most_Top_Win) { if (Most_Win == Most_Top_Win) { delete_as_top_window (); Most_Top_Win = Most_Win; /* not anymore, this one is */ } else delete_as_top_window(); #if 0 SLFREE(w->status); #endif SLFREE(w); return; } old_b = Most_Win->top - 2; new_b = Most_Win->bot; most_other_window(-1); Most_Win->bot = new_b; most_redraw_window(); #if 0 strcpy(Most_Win->status,w->status); /* share the same line */ #endif Most_Win->next = w->next; Most_Win->next->prev = Most_Win; #if 0 SLFREE (w->status); #endif SLFREE(w); most_update_status(); } void most_redraw_display (void) { Most_Window_Type *w; int n,t; SLsmg_cls (); Last_Message = NULL; most_save_win_flags(Most_Win); w = Most_Win; do { Most_Win = Most_Win->next; most_switch_to_buffer(Most_Win->buf); Most_C_Offset = Most_Win->top_offset; Most_C_Line = Most_Win->beg_line; Most_Column = Most_Win->col; restore_win_flags(); n = Most_Win->bot - Most_Win->top; check_dirty_flag (); t = Most_Win->top; most_goto_rc(t, 1); most_display_line(); while (n--) { t++; most_goto_rc (t, 1); if (most_forward_line(1)) most_display_line(); } Most_C_Line = Most_Win->beg_line; Most_C_Offset = Most_Win->top_offset; update_status1(); } while(Most_Win != w); most_set_window(w); if (Minibuffer_Selected) { most_select_minibuffer (); SLtt_write_string ((char *) Most_Mini_Buf); } SLsmg_refresh (); } void most_toggle_lock() { Most_Win->lock = !(Most_Win->lock); most_update_status(); } void most_point_cursor (void) { int r, c; c = Most_Curs_Col - Most_Column + 1; r = Most_Curs_Row; if (r < 1) r = 1; else if (r > (Most_Win->bot - Most_Win->top + 1)) r = Most_Win->bot - Most_Win->top + 1; if (c > SLtt_Screen_Cols) c = SLtt_Screen_Cols; else if (c < 1) c = 1; most_goto_rc (r + Most_Win->top - 1, c); } most-5.0.0a/src/buffer.c0000644002657400265740000003007710630436657014110 0ustar davisdavis/* This file is part of MOST. Copyright (c) 1991, 1999, 2002, 2005, 2006, 2007 John E. Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "config.h" #include #ifdef HAVE_STDLIB_H # include #endif #include #include #include "jdmacros.h" #include "most.h" #include "buffer.h" #include "display.h" #include "window.h" #include "line.h" #include "file.h" int Most_W_Opt = 0; unsigned char *Most_Beg; /* beginning of current buffer */ unsigned char *Most_Eob; /* end of current buffer */ Most_Buffer_Type *Most_Buf; MOST_INT Most_Num_Lines; MOST_UINT Most_C_Offset; MOST_INT Most_C_Line; /* p>p0 assumed */ #define BSKIP_CHAR(p,p0) \ (((Most_UTF8_Mode == 0) || (0 == ((*(p-1)) & 0x80))) \ ? ((p)--) \ : ((p) = SLutf8_bskip_char ((p0), (p)))) static unsigned char *beg_of_line1(void) { unsigned char *pos; unsigned char *cpos; cpos = pos = Most_Beg + Most_C_Offset; if (pos == Most_Beg) return pos; if (pos != Most_Eob) { if (*pos == '\n') { pos--;/* Skip back over the new-line. */ while ((pos > Most_Beg) && (*pos != '\n')) pos--; if (*pos != '\n') return pos; if (pos + 1 != cpos) return pos + 1; } } else BSKIP_CHAR (pos, Most_Beg); if (*pos != '\n') { while ((pos > Most_Beg) && (*pos != '\n')) pos--; if (*pos != '\n') return Most_Beg; return pos + 1; } /* from here on *pos == '\n' */ if (Most_S_Opt == 0) return pos + 1; while ((pos > Most_Beg) && (*pos == '\n')) pos--; pos += 2; if (pos > cpos) pos = cpos; return pos; } /* does not move point */ static unsigned char *end_of_line1(void) { register unsigned char *pos, *pmax; int n, n2; pos = Most_Beg + Most_C_Offset; pmax = Most_Eob; if (pos >= pmax) return pmax; /* find the first '\n'. If we are wrapping lines, then do not go more * than 3 times the display width. */ if (Most_W_Opt && SLtt_Screen_Cols) { pmax = pos + 3 * SLtt_Screen_Cols; if (pmax > Most_Eob) pmax = Most_Eob; } if (*pos != '\n') { /* This block is UTF-8 safe, because it only scans the buffer * for a new-line, and doesn't count characters. */ n = pmax - pos; n2 = n % 8; pmax = pos + (n - 8); while (pos <= pmax) { if (*pos == '\n') return pos; if (*(pos + 1) == '\n') return pos + 1; if (*(pos + 2) == '\n') return pos + 2; if (*(pos + 3) == '\n') return pos + 3; if (*(pos + 4) == '\n') return pos + 4; if (*(pos + 5) == '\n') return pos + 5; if (*(pos + 6) == '\n') return pos + 6; if (*(pos + 7) == '\n') return pos + 7; pos += 8; } pmax = pos + n2; while ((pos < pmax) && (*pos != '\n')) pos++; return(pos); } if (!Most_S_Opt) return (pos); /* file */ /* if Most_Beg = "....abc\n\n\n\n\ndef..." then we are at some first \n. We want to return the last '\n' unless we wre at the first '\n'. */ /* Here we are on a \n and NOT at the end of the buffer */ if ((pos > Most_Beg) && (*(pos - 1) != '\n')) return (pos); while ((pos < Most_Eob) && (*pos == '\n')) pos++; if (pos == Most_Eob) return pos; if (pos != Most_Beg) pos--; return pos; /* if (pos == Most_Eob) return (pos - 1); return pos; */ } unsigned char *most_beg_of_line(void) { unsigned char *b; unsigned int ncols; unsigned char *e; if (Most_W_Opt == 0) return beg_of_line1(); b = beg_of_line1 (); e = end_of_line1 (); ncols = SLtt_Screen_Cols; if (Most_Show_Wrap_Marker) ncols--; while (1) { unsigned char *next_b = most_forward_columns (b, e, ncols); if ((next_b == e) || (next_b == b)) break; if (next_b >= Most_Beg + Most_C_Offset) break; b = next_b; } return b; } static unsigned char *end_of_line (unsigned char *b) { unsigned char *e, *b1; int ncols; e = end_of_line1(); if (Most_W_Opt == 0) return e; if (b == NULL) b = most_beg_of_line (); ncols = SLtt_Screen_Cols; if (Most_Show_Wrap_Marker) ncols--; b = most_forward_columns (b, e, ncols); /* Do not wrap the line if the last character falls on the last column * of the display. */ if (Most_Show_Wrap_Marker) { if (Most_UTF8_Mode == 0) b1 = b + 1; else b1 = SLutf8_skip_char (b, Most_Eob); if ((b1 <= e) && (b1 < Most_Eob) && (*b1 == '\n')) b = b1; } return b; } MOST_INT most_forward_line (MOST_INT save) { MOST_INT m, n; unsigned char *p; unsigned char *pmax; n = save; pmax = Most_Eob; if (n > 0) { if (Most_B_Opt) { m = (Most_Eob - (Most_Beg + Most_C_Offset)) / 16; if (n > m) n = m; Most_C_Offset += n * 16; Most_C_Line += n; return n; } p = NULL; while (n--) { p = end_of_line (p); Most_C_Offset = p - Most_Beg; if (p == Most_Eob) return (save - (n + 1)); Most_C_Line++; Most_C_Offset++; if (Most_Selective_Display) { /* Skip past lines with too much indentation to the start * of a valid one. */ p = Most_Beg + Most_C_Offset; while (p < pmax) { while ((p < pmax) && (*p <= ' ')) p++; if (most_apparant_distance(p) < Most_Selective_Display) break; Most_C_Offset = (p - Most_Beg); p = end_of_line (p); if (p < pmax) p++; } Most_C_Offset = (p - Most_Beg); } p = Most_Beg + Most_C_Offset; } } else { if (Most_B_Opt) { m = Most_C_Offset / 16; if (n < m) n = m; Most_C_Offset += n * 16; Most_C_Line += n; return n; } else while (n++) { p = most_beg_of_line(); Most_C_Offset = (p - Most_Beg); if (Most_C_Offset == 0) return (n - (save + 1)); Most_C_Line--; Most_C_Offset--; if (Most_Selective_Display) { /* Skip past lines with too much indentation to the start * of a valid one. */ p = Most_Beg + Most_C_Offset; while (p > Most_Beg) { /* skip all blank lines */ while ((p > Most_Beg) && (*p <= ' ')) p--; pmax = p; Most_C_Offset = pmax - Most_Beg; p = most_beg_of_line (); Most_C_Offset = p - Most_Beg; while ((p < pmax) && (*p <= ' ')) p++; if (most_apparant_distance(p) < Most_Selective_Display) break; Most_C_Offset = p - Most_Beg; p = most_beg_of_line (); if (p > Most_Beg) p--; Most_C_Offset = p - Most_Beg; } Most_C_Offset = p - Most_Beg; } } } return(save); } /* Count lines in the region. A half line counts as 1 */ MOST_INT most_count_lines(unsigned char *beg, unsigned char *end) { MOST_INT save_line, n; unsigned char *save_beg, *save_eob; MOST_UINT save_pos; int dn = 1000; if (Most_B_Opt) return(1 + (MOST_INT)(end - beg) / 16); save_line = Most_C_Line; save_beg = Most_Beg; save_eob = Most_Eob; save_pos = Most_C_Offset; Most_Beg = beg; Most_Eob = end; Most_C_Offset = 0; n = 1; while((dn = most_forward_line(dn)) != 0) n += dn; Most_C_Offset = save_pos; Most_Eob = save_eob; Most_Beg = save_beg; Most_C_Line = save_line; return(n); } void most_goto_line (MOST_INT line) { MOST_INT dif_c, dif_b, dif_t; if (line < 1) line = 1; most_read_to_line(line); if (line > Most_Num_Lines) line = Most_Num_Lines; if (Most_B_Opt) { Most_C_Offset = (16 * (line - 1)); Most_C_Line = line; return; } dif_c = line - Most_C_Line; dif_b = line - Most_Num_Lines; dif_t = line - 1; /* 4 possibilites */ if (dif_c <= 0) { if (dif_t < -dif_c) /* go from top */ { Most_C_Line = 1; Most_C_Offset = 0; (void) most_forward_line(dif_t); } else /* from curr back */ { (void) most_forward_line(dif_c); } } else if (dif_c > 0) { if ((dif_c + dif_b) < 0) /* go from curr */ { (void) most_forward_line(dif_c); } else { Most_C_Line = Most_Num_Lines; Most_C_Offset = (Most_Eob - Most_Beg); (void) most_forward_line(dif_b); } } } /* return line the point is on without the final '\n's */ int most_extract_line(unsigned char **beg, unsigned char **end) { *beg = most_beg_of_line(); *end = end_of_line (*beg); return 0; } MOST_INT most_what_line(unsigned char *pos) { unsigned int save_pos; MOST_INT save_line, dir; MOST_INT dif_c, dif_b,dif_t; int ret; if (Most_B_Opt) { return (1 + (pos - Most_Beg)/16); } if (Most_Selective_Display) { return most_count_lines (Most_Beg, pos); } save_pos = Most_C_Offset; save_line = Most_C_Line; dif_c = pos - (Most_Beg + Most_C_Offset); dif_b = pos - Most_Eob; dif_t = pos - Most_Beg; /* 4 possibilites */ if (dif_c <= 0) { if (dif_t < -dif_c) /* go from top */ { Most_C_Line = 1; Most_C_Offset = 0; dir = 1; } else /* from curr back */ { dir = -1; } } else if (dif_c > 0) { if ((dif_c + dif_b) < 0) /* go from curr */ { dir = 1; } else { Most_C_Line = Most_Num_Lines; Most_C_Offset = Most_Eob - Most_Beg; dir = -1; } } if (dir == 1) { while (1) { unsigned char *cpos; cpos = end_of_line (NULL); Most_C_Offset = cpos - Most_Beg; if (cpos >= pos) break; Most_C_Offset++; Most_C_Line++; } } else { while (1) { unsigned char *cpos; cpos = most_beg_of_line (); Most_C_Offset = cpos - Most_Beg; if (pos >= cpos) break; Most_C_Line--; Most_C_Offset--; } } ret = Most_C_Line; Most_C_Offset = save_pos; Most_C_Line = save_line; return(ret); } /* given a buffer position, find the line and column */ void most_find_row_column(unsigned char *pos, MOST_INT *r, MOST_INT *c) { unsigned char *beg; unsigned int save_offset; MOST_INT save_line; if (pos <= Most_Beg) { *r = 1; *c = 1; return; } save_line = Most_C_Line; save_offset = Most_C_Offset; *r = most_what_line(pos); if (Most_B_Opt) { *c = (int) (pos - Most_Beg) - (*r - 1) * 16 + 1; return; } Most_C_Line = *r; Most_C_Offset = pos - Most_Beg; /* Now we have found the line it is on so.... */ beg = most_beg_of_line(); *c = 1; if (Most_UTF8_Mode) { /* FIXME: This should take into account the printable representation * of the characters. */ while ((beg = SLutf8_skip_chars (beg, pos, 1, NULL, 1)) < pos) *c += 1; } else while (beg++ < pos) *c = *c + 1; Most_C_Line = save_line; Most_C_Offset = save_offset; } Most_Buffer_Type *most_switch_to_buffer(Most_Buffer_Type *nnew) { Most_Buffer_Type *old; old = Most_Buf; Most_Buf = nnew; Most_Beg = Most_Buf->beg; Most_Eob = Most_Buf->end; return old; } Most_Buffer_Type *most_create_buffer(char *file) { Most_Buffer_Type *buf; buf = (Most_Buffer_Type *) MOSTMALLOC(sizeof(Most_Buffer_Type)); memset ((char *) buf, 0, sizeof(Most_Buffer_Type)); strcpy(buf->file,file); return(buf); } unsigned char *most_malloc(unsigned int n) { unsigned char *b = (unsigned char *) SLMALLOC(n); if (b == NULL) { most_exit_error("malloc: Memory Allocation Error."); } return b; } unsigned char *most_realloc(unsigned char *p, unsigned int n) { unsigned char *b = (unsigned char *) SLREALLOC(p, n); if (b == NULL) { most_exit_error("malloc: Memory Allocation Error."); } return b; } most-5.0.0a/src/search.h0000644002657400265740000000206010605757777014113 0ustar davisdavis#ifndef _DAVIS_SEARCH_H_ # define _DAVIS_SEARCH_H_ /* This file is part of MOST. Copyright (c) 1991, 1999, 2002, 2005, 2006, 2007 John E. Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ # include # include extern int Most_Case_Sensitive; extern int Most_Search_Dir; #define MOST_SEARCH_BUF_LEN 256 extern char Most_Search_Str[MOST_SEARCH_BUF_LEN]; extern int most_search(unsigned char *, int, MOST_INT *); #endif most-5.0.0a/src/window.h0000644002657400265740000000660210605757777014163 0ustar davisdavis#ifndef _DAVIS_WINDOW_H_ # define _DAVIS_WINDOW_H_ /* This file is part of MOST. Copyright (c) 1991, 1999, 2002, 2005, 2006, 2007 John E. Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ # include "buffer.h" typedef struct _Most_Window_Type { unsigned long top_offset; /* offset of top line of window from bob */ int beg_line; /* line number of top */ int curs_line; /* line number of curs pos */ int curs_col; /* column number of curs pos */ unsigned long curs_offset; /* pos of cursor from bob*/ int col; /* column offset */ int n_lines; /* number of lines of buffer (mode dependent) */ int top; /* screen location of top */ int bot; /* screen location of bot */ int display; /* value of MOST_S_OPT for selective display */ #if 0 char *status; /* status line */ #endif Most_Buffer_Type *buf; /* buffer structure in window */ struct _Most_Window_Type *next; /* next window */ struct _Most_Window_Type *prev; /* prev window */ int flags; /* Squeeze lines, etc.. */ int lock; /* true if locked */ int dirty_flag; } Most_Window_Type; extern Most_Window_Type *Most_Win; extern Most_Window_Type *Most_Top_Win; extern unsigned long Most_Curs_Offset; extern int Most_Column; extern int Most_Curs_Row; extern int Most_Curs_Col; #define MOST_MINI_BUF_LEN 256 extern char Most_Mini_Buf[MOST_MINI_BUF_LEN]; extern int Most_Selective_Display; extern int Most_Restore_Width_To; extern int Most_Display_Inited; extern int most_split_window (void); extern void most_toggle_lock(void); extern void most_update_window(int); /* moves window to have arg lines on the top */ extern void most_update_status(void); extern void most_redraw_window(void); /* redraws window updating the structure */ extern void most_window_buffer(void); extern void most_init_display(void); extern void most_reset_display(void); extern void most_other_window(int); extern void most_set_window (Most_Window_Type *); extern void most_update_windows(int); extern void most_message(char *, int); extern void most_put_message(void); extern void most_clear_minibuffer(void); extern void most_check_minibuffer(void); extern void most_free_window_buffer(void); extern void most_select_minibuffer(void); extern void most_exit_minibuffer(void); extern int most_read_from_minibuffer(char *, char *, char *, unsigned int); extern void most_redraw_display(void); extern void most_one_window(void); extern void most_two_windows(void); extern void most_delete_window(void); extern void most_save_win_flags(Most_Window_Type *); extern void most_free_windows (void); extern void most_flush_message (char *); extern void most_point_cursor (void); #endif most-5.0.0a/src/modules.lis0000644002657400265740000000012410425445274014637 0ustar davisdavisbuffer cmd display edit file help keym keyparse line main most search sysdep window most-5.0.0a/src/buffer.h0000644002657400265740000000525210605757777014125 0ustar davisdavis/* This file is part of MOST. Copyright (c) 1991, 1999, 2002, 2005, 2006, 2007 John E. Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef _DAVIS_BUFFER_H_ # define _DAVIS_BUFFER_H_ typedef struct { char file[MAX_PATHLEN]; /* filename */ unsigned char *beg; /* beginning of buffer */ unsigned char *end; /* end of buffer */ int mark; /* marked line in buffer */ unsigned int flags; int fd; /* file descriptor--- -1 if closed */ FILE *fp; /* use pclose when EOF is reached */ int size; # ifdef VMS int rec; /* record size for reads */ # endif # if MOST_HAS_MMAP int is_mmaped; unsigned int mmap_size; # endif } Most_Buffer_Type; extern Most_Buffer_Type *Most_Buf; extern unsigned char *Most_Beg, *Most_Eob; extern MOST_INT Most_Num_Lines; /* Offset of current position from beginning of buffer */ extern MOST_UINT Most_C_Offset; extern MOST_INT Most_C_Line; /* * Current line number. If at the beginning of the buffer, it is 1. If * we are at the last point of the buffer it is the number of lines. */ /* This routine does not move the point */ extern unsigned char *most_beg_of_line(void); extern MOST_INT most_forward_line(MOST_INT); /* This routine moves the point forward n lines. n can be negative. It returns the number moved. */ extern void most_goto_line (MOST_INT); /* Move the point somewhere on the nth line of the buffer returning C_POS */ extern MOST_INT most_what_line (unsigned char *); /* return the line number of position 'argument'. Does not move point */ /* count the number of lines in the region delimited by beg and end. Counts lines from beg up to end but does not count end. Does not move point. */ extern MOST_INT most_count_lines(unsigned char *, unsigned char *); extern int most_extract_line(unsigned char **, unsigned char **); extern Most_Buffer_Type *most_switch_to_buffer(Most_Buffer_Type *); extern Most_Buffer_Type *most_create_buffer(char *); extern void most_find_row_column(unsigned char *, MOST_INT *, MOST_INT *); #endif most-5.0.0a/src/file.c0000644002657400265740000004064310605757777013571 0ustar davisdavis/* This file is part of MOST. Copyright (c) 1991, 1999, 2002, 2005, 2006, 2007 John E. Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "config.h" #include #include #include #include #ifndef VMS # include # include # include # ifdef HAVE_UNISTD_H # include # endif #else # include # include #endif /* NOT VMS */ #ifdef HAVE_STDLIB_H # include #endif #include #include "jdmacros.h" #ifndef O_RDONLY # define O_RDONLY 0 #endif #include "window.h" #include "file.h" #include "most.h" #include "buffer.h" #include "display.h" #include "sysdep.h" #include "edit.h" char *Most_File_Ring[MOST_MAX_FILES]; char Most_C_Dir[MAX_PATHLEN]; /* current working dir */ int Most_Num_Files; int Most_Tail_Mode = 1; #if !defined(VMS) static int create_gunzip_cmd (char *cmd, char *file, char *buf, unsigned int sizeof_buf) { char *efile; if (NULL == (efile = most_escape_filename (file, '"'))) return -1; _pSLsnprintf (buf, sizeof_buf, cmd, efile); SLfree (efile); return 0; } static int open_compressed_file(char *file, int mode, int *size) { int fd; char buf[4], cmdbuf[2*MAX_PATHLEN]; struct stat st; # ifdef O_BINARY mode |= O_BINARY; # endif # ifdef IBMPC_SYSTEM Most_Z_Opt = 1; # endif if (Most_Z_Opt) { if (stat(file, &st)) return(-1); *size = st.st_size; return (open(file,mode)); } fd = open(file, O_RDONLY); if (fd < 0) return fd; if (4 == read(fd, buf, 4)) { char *cmd = NULL; if ((buf[0] == (char) 0x1f) && (buf[1] == (char) 0x8b) && (buf[2] == (char) 0x08) && ((buf[3] == (char) 0x08) || (buf[3] == (char)0x00))) { cmd = MOST_GUNZIP_POPEN_FORMAT; } else if ((buf[0] == 'B') && (buf[1] == 'Z') && (buf[2] == 'h') && (buf[3] > 47)) { cmd = MOST_BZIP2_POPEN_FORMAT; } if (cmd != NULL) { FILE *fp; close (fd); most_flush_message ("Uncompressing file..."); if (-1 == create_gunzip_cmd (cmd, file, cmdbuf, sizeof(cmdbuf))) return -1; fp = popen (cmdbuf, "r"); /* GLIBC doe not support "rb" */ if (fp == NULL) return -1; *size = 0; fd = fileno (fp); Most_Buf->fp = fp; /* pclose (fp); */ return fd; } } close (fd); if (stat(file, &st)) return(-1); *size = st.st_size; return (open(file,mode)); } #endif /* VMS */ #if MOST_HAS_MMAP #ifdef HAVE_SYS_MMAN_H # include #endif #ifndef MAP_FAILED # define MAP_FAILED -1 #endif static int try_mmap_buffer (int fd) { unsigned char *addr; struct stat st; Most_Buf->is_mmaped = 0; if (Most_Disable_MMap) return -1; if (-1 == fstat (fd, &st)) return -1; addr = (unsigned char *)mmap (NULL,st.st_size,PROT_READ,MAP_SHARED,fd,0); if (addr == (unsigned char *)MAP_FAILED) return -1; Most_Buf->fd = fd; Most_Eob = Most_Beg = Most_Buf->end = Most_Buf->beg = addr; Most_Buf->size = 0; Most_Buf->mmap_size = st.st_size; Most_Buf->is_mmaped = 1; return 0; } static int unmmap_buffer (Most_Buffer_Type *b) { if (b->is_mmaped == 0) return 0; if (b->beg != NULL) munmap ((char *)b->beg, b->size); b->end = b->beg = NULL; if (b == Most_Buf) { Most_Beg = Most_Eob = NULL; Most_C_Line = 0; Most_Num_Lines = Most_C_Line = 0; } return 0; } static int resync_mmap (void) { struct stat st; int line = Most_C_Line; if (Most_Buf->fd == -1) return 0; if (-1 == fstat (Most_Buf->fd, &st)) return -1; if ((unsigned int) st.st_size == Most_Buf->mmap_size) return 0; (void) unmmap_buffer (Most_Buf); if (-1 == try_mmap_buffer (Most_Buf->fd)) return -1; most_goto_line (line); return 0; } #endif /* MOST_HAS_MMAP */ int most_close_buffer_file (Most_Buffer_Type *b) { if (b->fd != -1) { #if !defined(VMS) if (b->fp != NULL) pclose (b->fp); else #endif close(b->fd); } #if MOST_HAS_MMAP unmmap_buffer (b); #endif if (b->beg != NULL) SLFREE(b->beg); b->beg = NULL; b->fd = -1; return 0; } /* If file[0] == 0, the file represents stdin */ static int insert_file(char *file) { int size = 0, fd; /* int mode; */ #ifdef VMS struct stat st; unsigned recsz = 512; /* extern int stat(char *, struct stat *); */ #endif if (file[0] == '\0') /* assume stdin */ { fd = 0; strcpy (Most_Buf->file, "*stdin*"); } else { #ifdef VMS if (stat(file, &st)) return(-1); /* mode = st.st_mode & S_IFMT; */ size = st.st_size; recsz = st.st_fab_mrs; if (recsz <= 255) recsz = 255; /* VMS share options (shr=put) suggested by Henk D. Davids */ /* VMS share options (shr=upi,get,put) suggested by Mark Pizzolato */ fd = open(file,O_RDONLY,"ctx=rec","mbf=8","mbc=16","rop=RAH","shr=upi,get,put"); /* if (fd < 0) fd = open(file,O_RDONLY); */ #else fd = open_compressed_file(file, O_RDONLY, &size); # if MOST_HAS_MMAP if (0 == try_mmap_buffer (fd)) return most_read_file_dsc (1); # endif #endif } if (fd < 0) return(-1); if (!fd || (size <= 0)) size = 0x7FFF; #ifdef VMS Most_Buf->rec = recsz; #endif Most_Buf->fd = fd; /* This will fail on really large files. */ Most_Eob = Most_Beg = Most_Buf->beg = (unsigned char *) MOSTMALLOC(size); Most_Buf->size = size; return most_read_file_dsc (1); } static void update_buffer_windows (Most_Buffer_Type *b) { Most_Window_Type *w; if (NULL == (w = Most_Win)) return; do { if (w->buf == b) w->dirty_flag = 1; w = w->next; } while (w != Most_Win); } static void examine_file_contents (void) { unsigned char *pos, *pos_max; if (Most_B_Opt || Most_K_Opt) return; pos = Most_Beg; pos_max = pos + 512; if (pos_max > Most_Eob) pos_max = Most_Eob; while (pos < pos_max) { if (0 == *pos) { Most_B_Opt = 1; break; } pos++; } /* Check for a FITS file. The header looks like ASCII. */ if (Most_B_Opt == 0) { pos = Most_Beg; pos_max = Most_Eob; if ((pos_max > pos + 80) && (0 == strncmp ((char *) pos, "SIMPLE =", 9))) { Most_V_Opt = 1; Most_W_Opt = 1; } } } static int First_Time_Hack = 0; /* true if reading file for first time */ #if MOST_HAS_MMAP static int read_mmap_file_dsc (int many) { unsigned int size; size = Most_Buf->size; if (many == -1) { if (-1 == resync_mmap ()) return -1; } if (size == Most_Buf->mmap_size) return 0; if (many < 0) size = Most_Buf->mmap_size; else { size += many * 0xFFFF; if (size > Most_Buf->mmap_size) size = Most_Buf->mmap_size; } Most_Eob = Most_Buf->end = Most_Buf->beg + size; Most_Buf->size = size; most_flush_message ("Mapping file..."); if (First_Time_Hack) examine_file_contents (); Most_Num_Lines = most_count_lines (Most_Beg, Most_Eob); most_message(Most_Global_Msg, 0); return 1; } #endif /* if read something, return non zero (1) */ int most_read_file_dsc (int many) { int fd = Most_Buf->fd, n = 0, i; int dsize, size, passes = 0; unsigned char *pos; #ifdef VMS int recsz = Most_Buf->rec; #endif if (fd < 0) return 0; #if MOST_HAS_MMAP if (Most_Buf->is_mmaped) { int ret = read_mmap_file_dsc (many); if (-1 != ret) return ret; if (Most_Buf->is_mmaped) return -1; /* No longer mapped..... */ } #endif dsize = 0x3FFF; while (many--) { passes++; most_flush_message ("Reading..."); size = (Most_Eob - Most_Beg) + dsize; if (Most_Buf->size > size) pos = Most_Beg; else { size = Most_Buf->size + 0xFFFF; pos = (unsigned char *) MOSTREALLOC(Most_Beg, (unsigned) size); Most_Buf->size = size; } Most_Eob = pos + (unsigned int) (Most_Eob - Most_Beg); Most_Beg = pos; pos = Most_Eob; n = 0; while (1) { #ifdef VMS i = read (fd, (char *) pos, recsz); #else i = read (fd, (char *) pos, dsize - n); #endif if (i == -1) { #ifdef EINTR if (errno == EINTR) continue; #endif break; } if (i == 0) { /* EOF */ /* Under linux, for some reason bash when invoked by * man will reset the terminal. Apparantly this is a * result of most being orphaned. */ #ifdef __unix__ if (fd == 0) (void) most_reinit_terminal (); #endif break; } n += i; pos += i; if (n >= dsize) break; } Most_Eob = Most_Buf->end = pos; Most_Buf->beg = Most_Beg; if (n != 0) n = 1; if ((i <= 0) || SLKeyBoard_Quit) { break; } } if (First_Time_Hack) examine_file_contents (); if (n || First_Time_Hack) Most_Num_Lines = most_count_lines (Most_Beg, Most_Eob); update_buffer_windows (Most_Buf); most_message("reading...done", 0); most_put_message(); most_message(Most_Global_Msg, 0); return n; } /* This routines makes sure line n is read in. */ void most_read_to_line(int n) { int dn; long nbytes; if (Most_Buf->fd == -1) return; n += 2 * SLtt_Screen_Rows; dn = n - Most_Num_Lines; if (dn < 0) return; nbytes = 0; if (Most_Num_Lines) nbytes = dn * ((Most_Eob - Most_Beg) / Most_Num_Lines); if (nbytes < 0x3FFF) nbytes = 0x3FFF; while ((Most_Buf->fd != -1) && (n >= Most_Num_Lines) && (0 != most_read_file_dsc (nbytes / 0x3FFF)) && (SLKeyBoard_Quit == 0)) { nbytes = 0; if (Most_Num_Lines) nbytes = dn * ((Most_Eob - Most_Beg) / Most_Num_Lines); if (nbytes < 0x3FFF) nbytes = 0x3FFF; } } int most_find_file(char *file) { Most_Buffer_Type *new_buf; int n; char msg[MAX_PATHLEN+20], *msgp; int ret = 0; new_buf = most_create_buffer(file); (void) most_switch_to_buffer(new_buf); First_Time_Hack = 1; if (insert_file(file) < 0) { sprintf (msg, "%s failed to open.", file); n = strlen (msg); msgp = (char *) MOSTMALLOC((unsigned int) (n + 1)); strcpy (msgp, msg); Most_Buf->beg = (unsigned char *) msgp; Most_Buf->end = Most_Buf->beg + n; Most_Buf->fd = -1; Most_Num_Lines = 1; ret = -1; } First_Time_Hack = 0; Most_Beg = Most_Buf->beg; Most_Eob = Most_Buf->end; Most_C_Offset = 0; Most_C_Line = 1; Most_Column = 1; return ret; } /* if the file is visible in a window, move to the window and return 1 else return 0 */ Most_Window_Type *most_file_visible(char *file) { Most_Window_Type *w; w = Most_Win; Most_Win = Most_Top_Win; do { if (!strcmp(Most_Win->buf->file,file)) { most_set_window(Most_Win); return(Most_Win); } Most_Win = Most_Win->next; } while (Most_Win != Most_Top_Win); Most_Win = w; return(NULL); } void most_reread_file (void) { char file[MAX_PATHLEN]; int line = Most_C_Line; if (-1 == access(Most_Buf->file, 0)) /* does it exist? */ { most_message("File not found.",1); return; } most_one_window (); strcpy (file, Most_Buf->file); most_free_window_buffer (); (void) most_find_file (file); most_goto_line (line); most_window_buffer (); } static int find_file_in_window(char *file) { if (NULL != most_file_visible(file)) { most_message ("File is already visible.", 1); return -2; } if (-1 == access(file, 0)) /* does it exist? */ { most_message("File not found.",1); return -1; } most_free_window_buffer(); (void) most_find_file(file); most_window_buffer(); most_redraw_window(); most_update_status(); return 0; } static void format_next_file (char *mbuf, int j, char *file) { int len, max_len; len = strlen (file); max_len = SLtt_Screen_Cols - 25; if (len > max_len) { sprintf(mbuf, "Next File (%d): ...%s", j, file + (len - max_len)); } else sprintf(mbuf, "Next File (%d): %s", j, file); } void most_do_next_file(int *j) { char mbuf[256], *curr_file; unsigned char ch; most_select_minibuffer(); if (*j >= Most_Num_Files) *j = 0; curr_file = Most_File_Ring[*j]; while (1) { format_next_file (mbuf, *j, curr_file); SLsmg_write_string (mbuf); SLsmg_erase_eol (); SLsmg_gotorc (SLtt_Screen_Rows - 1, 0); SLsmg_refresh (); ch = most_getkey(); #ifndef IBMPC_SYSTEM if (ch != '\033') break; if (ch = most_getkey(), (ch != 'O') && (ch != '[')) continue; if (ch = most_getkey(), (ch != 'A') && (ch != 'B')) continue; #else if ((ch != 0) && (ch != 0xE0)) break; ch = most_getkey (); if (ch != 'H') ch = 'B'; else ch = 'A'; #endif if (ch == 'B') { if (*j == 0) *j = Most_Num_Files; (*j)--; } else /* ch == 'A' */ { (*j)++; if (*j == Most_Num_Files) *j = 0; } curr_file = Most_File_Ring[*j]; } most_exit_minibuffer(); (*j)++; if ((ch == 'Q') || (ch == 'q')) { most_exit_most (); } else find_file_in_window(curr_file); } /* extracts directory from file string, returns false if no dir */ int most_head(char *file, char *dir) { int n; if (file == NULL) return 0; (void) strcpy(dir,file); n = strlen(file) - 1; #ifdef VMS while((n > -1) && (file[n] != ']') && (file[n] != ':')) n--; #else while((n > -1) && file[n] != '/') n--; #endif n++; dir[n] = '\0'; return(n); } /* returns a pointer to the tail of file */ static int tail(char *filed, char **filep) { int n; n = strlen(filed) - 1; #ifdef VMS while((n > -1) && ((filed[n] != ']') && (filed[n] != ':'))) n--; #else while((n > -1) && (filed[n] != '/')) n--; #endif n++; *filep = (filed + n); return(n); } /* assume path is big enough to hold new expanded version */ static int expand_path(char *path) { #ifndef VMS int n; #endif /* really cheat here-- let system do it. The path must exist!! */ if (chdir(path)) { most_message(path,1); return(0); } else { most_get_cdir(path); chdir(Most_C_Dir); #ifndef VMS n = strlen(path); if (path[n-1] == '/') return(1); path[n++] = '/'; path[n] = 0; #endif } return(1); } #if 0 static void most_cd (void) { char tmp_dir[MAX_PATHLEN]; int n; if (Most_Secure_Mode) { most_message ("CD disabled in secure mode.", 1); return; } strcpy(tmp_dir,Most_C_Dir); if (most_read_from_minibuffer("cd ",Most_C_Dir) == -1) return; if (!chdir(Most_C_Dir)) { most_get_cdir(Most_C_Dir); /* expands ../ etc... */ n = strlen(Most_C_Dir); # ifndef VMS if (Most_C_Dir[n-1] == '/') return; Most_C_Dir[n++] = '/'; Most_C_Dir[n] = 0; # endif return; } strcpy(Most_C_Dir,tmp_dir); chdir(Most_C_Dir); most_message("Unable to change directory.",1); } #endif void most_user_get_file() { char path[MAX_PATHLEN], file[MAX_PATHLEN], *name; #ifdef VMS unsigned int i, imax; #endif if (Most_Secure_Mode) { most_message ("Getting a file is not permitted in secure mode.", 1); return; } if (!most_head(Most_Win->buf->file,file)) strcpy(file,Most_C_Dir); if (most_read_from_minibuffer("Find File: ", file, file, sizeof(file)) == -1) return; if (most_head(file,path)) { expand_path(path); tail(file,&name); strcat(path,name); name = path; } else name = file; #ifdef VMS imax = strlen (name); for (i = 0; i < imax; i++) name [i] = toupper (name[i]); #endif if (find_file_in_window(name) < 0) return; /* ** add to file ring if successful */ if ((NULL != most_file_visible(name)) && (Most_Num_Files < MOST_MAX_FILES)) { Most_File_Ring[Most_Num_Files] = (char*) MOSTMALLOC(strlen(name) + 1); strcpy(Most_File_Ring[Most_Num_Files++],name); } } void most_get_cdir(char *dir) { #ifdef sequent getwd(dir); #else # ifdef HAVE_GETCWD getcwd(dir, MAX_PATHLEN); # else getwd(dir); # endif #endif #ifndef VMS { int i; i = strlen(dir); if (i && (dir[i - 1] != '/')) dir[i++] = '/'; dir[i] = 0; } #endif } most-5.0.0a/src/keyparse.c0000644002657400265740000001555210636660067014463 0ustar davisdavis/* This file is part of MOST. Copyright (c) 1991, 1999, 2002, 2005, 2006, 2007 John E. Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "config.h" #include #include #ifdef HAVE_STDLIB_H # include #endif #ifdef __unix__ # ifndef MOST_SYSTEM_INITFILE # define MOST_SYSTEM_INITFILE "/etc/most.conf" # endif #endif /* parses user key definition file */ /* The file is assumed to have a simple format: * * set "keyname" function * unset "keyname" * * For example: * * unsetkey "^K" * setkey exit "^Kx" * * Comments extend from the first '%' character to the end of the line. */ #include #include "jdmacros.h" #include "most.h" #include "keyparse.h" #include "display.h" static unsigned int Line_Num; static void parse_error (char *s) { fprintf(stderr, "Most: Error reading config file on line %u.\n%s\n", Line_Num, s); most_exit_error (NULL); } static int unsetkey_fun (int, SLcmd_Cmd_Table_Type *); static int setkey_fun (int, SLcmd_Cmd_Table_Type *); static int color_fun (int, SLcmd_Cmd_Table_Type *); static int mono_fun (int, SLcmd_Cmd_Table_Type *); static SLcmd_Cmd_Type Startup_File_Cmds[] = { {unsetkey_fun, "unsetkey", "S"}, {setkey_fun, "setkey", "SS"}, {color_fun, "color", "SSS"}, {mono_fun, "mono", "SSsss"}, {NULL, "", ""} }; static SLcmd_Cmd_Table_Type Cmd_Table; static int setkey_fun (int argc, SLcmd_Cmd_Table_Type *table) /*{{{*/ { char *fun = table->string_args[1]; char *key = table->string_args[2]; (void) argc; if (NULL == SLang_find_key_function(fun, Most_Keymap)) { parse_error ("Undefined function"); } if (0 != SLang_define_key (key, fun, Most_Keymap)) parse_error ("Error setting key"); return 0; } static int unsetkey_fun (int argc, SLcmd_Cmd_Table_Type *table) /*{{{*/ { char *key = table->string_args[1]; (void) argc; SLang_undefine_key (key, Most_Keymap); return 0; } static int parse_file (char *file) { char buf[512]; FILE *fp; if (NULL == (fp = fopen (file, "r"))) return 1; Cmd_Table.table = Startup_File_Cmds; Line_Num = 0; while (NULL != fgets (buf, sizeof (buf), fp)) { Line_Num++; (void) SLcmd_execute_string (buf, &Cmd_Table); if (SLang_get_error()) parse_error ("Undefined keyword"); } fclose (fp); if (SLang_get_error ()) { SLang_set_error(0); return -1; } return 0; } int most_load_user_keymaps (void) { #ifndef VMS char filebuf[MAX_PATHLEN]; unsigned int len; #endif char *file; #ifdef MOST_SYSTEM_INITFILE if (MOST_SYSTEM_INITFILE != NULL) { int status; status = parse_file (MOST_SYSTEM_INITFILE); if (status == -1) return -1; } #endif if (NULL == (file = getenv ("MOST_INITFILE"))) { #ifdef VMS file = "SYS$LOGIN:MOST.RC"; #else *filebuf = 0; file = getenv ("HOME"); if (file == NULL) return -1; len = strlen (file); if (len + 8 >= sizeof (filebuf)) /* 8 for strlen("/.mostrc") */ return -1; strcpy (filebuf, file); file = filebuf; if (len && (file[len - 1] == '/')) len--; strcpy (file + len, "/.mostrc"); #endif } return parse_file (file); } /* The following code was borrowed from slrn */ /*{{{ Setting Color/Mono Attributes */ typedef struct /*{{{*/ { char *name; int value; char *fg, *bg; SLtt_Char_Type mono; } /*}}}*/ Color_Handle_Type; /* default colors -- suitable for a color xterm */ static Color_Handle_Type Color_Handles[] = /*{{{*/ { {"normal", 0, "default", "default", 0}, {"status", MOST_STATUS_COLOR, "yellow", "blue", SLTT_REV_MASK}, {"underline", MOST_ULINE_COLOR, "brightgreen", "default", SLTT_ULINE_MASK}, {"overstrike", MOST_BOLD_COLOR, "brightred", "default", SLTT_BOLD_MASK}, {NULL, -1, NULL, NULL, 0} }; static int set_object_color (char *name, char *fg, char *bg) { Color_Handle_Type *ct = Color_Handles; while (ct->name != NULL) { if (!strcmp (ct->name, name)) { SLtt_set_color (ct->value, name, fg, bg); return 0; } ct++; } parse_error ("Undefined color object"); return -1; } static int color_fun (int argc, SLcmd_Cmd_Table_Type *table) { char *what = table->string_args[1]; char *fg = table->string_args[2]; char *bg = table->string_args[3]; (void) argc; return set_object_color (what, fg, bg); } static int mono_fun (int argc, SLcmd_Cmd_Table_Type *table) { char *what = table->string_args[1]; char *attr; int i; Color_Handle_Type *ct = Color_Handles; while (ct->name != NULL) { if (!strcmp (ct->name, what)) { SLtt_Char_Type mono_attr = 0; for (i = 2; i < argc; i++) { attr = table->string_args[i]; if (!strcmp (attr, "bold")) mono_attr |= SLTT_BOLD_MASK; else if (!strcmp (attr, "blink")) mono_attr |= SLTT_BLINK_MASK; else if (!strcmp (attr, "underline")) mono_attr |= SLTT_ULINE_MASK; else if (!strcmp (attr, "reverse")) mono_attr |= SLTT_REV_MASK; else if (!strcmp (attr, "none")) mono_attr = 0; else { parse_error ("Undefined mono attribute"); return -1; } } SLtt_set_mono (ct->value, NULL, mono_attr); return 0; } ct++; } parse_error ("Undefined color object"); return -1; } static char *Ansi_Color_Map[9] = { "black", "red", "green", "yellow", "blue", "magenta", "cyan", "white", "default" }; void most_setup_colors (void) { Color_Handle_Type *h; int i; int fg, bg, at; for (i = 1; i < 128; i++) { SLtt_set_color (i, NULL, "default", "default"); SLtt_set_mono (i, NULL, 0); } for (at = 0; at < 9; at++) { for (fg = 0; fg < 9; fg++) { for (bg = 0; bg < 9; bg++) { i = fg + 9*(bg + 9*at); if (i == 0) continue; i += MOST_EMBEDDED_COLOR_OFFSET; SLtt_set_color (i, NULL, Ansi_Color_Map[fg], Ansi_Color_Map[bg]); } } } h = Color_Handles; while (h->name != NULL) { /* if (h->value != 0)*/ /* Let COLORFGBG apply to initial color */ SLtt_set_color (h->value, NULL, h->fg, h->bg); SLtt_set_color (h->value+MOST_EMBEDDED_COLOR_OFFSET, NULL, h->fg, h->bg); SLtt_set_mono (h->value, NULL, h->mono); SLtt_set_mono (h->value+MOST_EMBEDDED_COLOR_OFFSET, NULL, h->mono); h++; } } most-5.0.0a/src/main.c0000644002657400265740000000240410605757777013567 0ustar davisdavis/* This file is part of MOST. Copyright (c) 1991, 1999, 2002, 2005, 2006, 2007 John E. Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "config.h" #include #include #ifdef HAVE_STDLIB_H # include #endif #include #include "most.h" int main(int argc, char *argv[]) { #if 0 static volatile int debug_me = 1; while (debug_me == 1) { sleep (1); } #endif if (argc > 1) { if ((0 == strcmp (argv[1], "--version")) || (0 == strcmp (argv[1], "--help"))) { most_usage (); exit (1); } } most_initialize_most (); return most (argc, argv); } most-5.0.0a/src/file.h0000644002657400265740000000276310605757777013577 0ustar davisdavis/* This file is part of MOST. Copyright (c) 1991, 1999, 2002, 2005, 2006, 2007 John E. Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "config.h" #define MOST_MAX_FILES 4096 #define MOST_MAX_FILES 4096 #define MOST_GUNZIP_POPEN_FORMAT "gzip -dc \"%s\"" #define MOST_BZIP2_POPEN_FORMAT "bzip2 -dc \"%s\"" extern void most_reread_file (void); extern void most_read_to_line (int); extern Most_Window_Type *most_file_visible (char *); extern void most_user_get_file(void); extern int most_read_file_dsc(int); extern void most_get_cdir(char *); extern int most_get_dir(char *); extern void most_do_next_file(int *); extern int most_find_file(char *); extern int most_head(char *, char *); extern char *Most_File_Ring[MOST_MAX_FILES]; extern int Most_Num_Files; extern char Most_C_Dir[MAX_PATHLEN]; extern int Most_Tail_Mode; extern int most_close_buffer_file (Most_Buffer_Type *); most-5.0.0a/src/edit.c0000644002657400265740000001332510605757777013574 0ustar davisdavis/* This file is part of MOST. Copyright (c) 1991, 1999, 2002, 2005, 2006, 2007 John E. Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "config.h" /* editor functions */ #include #include #ifdef VMS # include # include # include # include /* #include */ # include # include # include #endif #ifdef HAVE_STDLIB_H # include #endif #include #include "most.h" #include "edit.h" #include "window.h" #include "file.h" #include "sysdep.h" /* quote_char is one of: 0, ", or '. It represents the character * that will be used to quote the filename. */ char *most_escape_filename (char *file, char quote_char) { char *efile, *e; if (NULL == (efile = SLmalloc (5 + 2*strlen(file)))) return NULL; e = efile; #ifndef VMS if (quote_char == 0) { /* No quote char was used for the filename command. Add it here. */ *e++ = '"'; } else if (quote_char == '\'') { /* Suppose the file is Bob's Notes. With ' as the quote, when passed * to the shell, it would look like 'Bob's Notes'. Unfortunately, this * would produce an unmatched single quote when processed by the shell. * So, the following escaped form will be used: * ''"Bob's Notes"'' */ *e++ = '\''; *e++ = '"'; } #endif while (1) { char ch = *file++; switch (ch) { case 0: #ifndef VMS if (quote_char == 0) *e++ = '"'; else if (quote_char == '\'') { *e++ = '"'; *e++ = '\''; } #endif *e = 0; return efile; #ifndef VMS /* For a double-quoted string, only the following characters * may be escaped with a backslash. Unfortuinately, escaping * others such as &, *, |, etc will not work. */ case '\\': case '$': case '"': case '`': case '\n': *e++ = '\\'; *e++ = ch; break; #endif default: *e++ = ch; } } } static int create_edit_command (char *edit, char *cmd, unsigned int sizeof_cmd, char *file) { int d, s; char ch, *p = edit; char *efile; char quote_char = '"'; /* Look for %d and %s */ d = s = 0; while (0 != (ch = *p++)) { char q = 0; if (((ch == '\'') || (ch == '"')) && (*p == '%')) { q = ch; ch = '%'; p++; } if (ch != '%') continue; ch = *p++; if (!d && (ch == 'd')) { if (s == 0) d = 1; else d = 2; } else if (!s && (ch == 's')) { if (d == 0) s = 1; else s = 2; if (q && (q != *p)) { most_message ("Unmatched quote character in editor definition", 1); return -1; } quote_char = q; } else { most_message ("Invalid editor definition.", 1); return -1; } } if (NULL == (efile = most_escape_filename (file, quote_char))) return -1; if ((d == 0) && (s == 0)) { /* No %d, %s */ _pSLsnprintf (cmd, sizeof_cmd, "%s \"%s\"", edit, efile); SLfree (efile); return 0; } if (d == 0) { _pSLsnprintf (cmd, sizeof_cmd, edit, efile); SLfree (efile); return 0; } if (d && s) { if (d == 1) _pSLsnprintf (cmd, sizeof_cmd, edit, Most_C_Line, efile); else _pSLsnprintf (cmd, sizeof_cmd, edit, efile, Most_C_Line); SLfree (efile); return 0; } most_message ("Unsupported Editor definition", 1); SLfree (efile); return -1; } #ifdef VMS int call_edt_tpu(int tpu, char *file) { char the_file[MAX_PATHLEN], *strp; extern void edt$edit(); extern void tpu$tpu(); struct dsc$descriptor_s file_desc; if (tpu == 1) /* tpu */ _pSLsnprintf (the_file, sizeof(the_file), "TPU /START=%d ", Most_C_Line); else the_file[0] = '\0'; strcat(the_file, file); /* lose the version number */ strp = the_file; while((*strp != '\0') && (*strp != ';')) strp++; *strp = '\0'; file_desc.dsc$w_length = strlen(the_file); file_desc.dsc$a_pointer = the_file; file_desc.dsc$b_class = DSC$K_CLASS_S; /* scalar, string type */ file_desc.dsc$b_dtype = DSC$K_DTYPE_T; /* ascii string */ if (tpu == 1) tpu$tpu(&file_desc); else edt$edit(&file_desc); return 1; } #endif void most_edit_cmd(void) { char *editor; char cmd[2*MAX_PATHLEN + 30]; #ifdef VMS int tpu = -1; #endif char *file; file = Most_Buf->file; if ((0 == *file) || ('*' == *file)) return; if (Most_Secure_Mode) { most_message ("Editing not permitted in secure mode.", 1); return; } if ((NULL == (editor = getenv("MOST_EDITOR"))) && (NULL == (editor = getenv("SLANG_EDITOR"))) && (NULL == (editor = getenv("EDITOR")))) #ifdef VMS editor = "EDT"; #else editor = "vi"; #endif #ifdef VMS if (!strcmp(editor,"EDT")) tpu = 0; else if (!strcmp(editor,"TPU")) tpu = 1; else #endif if (-1 == create_edit_command(editor, cmd, sizeof(cmd), file)) return; most_reset_tty (); most_reset_display (); #ifdef VMS if (tpu != -1) (void) call_edt_tpu(tpu, file); else #endif SLsystem (cmd); most_reread_file (); most_init_tty (); most_init_display (); most_redraw_display (); } most-5.0.0a/src/line.c0000644002657400265740000003306010670252000013537 0ustar davisdavis/* This file is part of MOST. Copyright (c) 1991, 1999, 2002, 2005, 2006, 2007 John E. Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "config.h" #include #include #include #include #include "jdmacros.h" #include "most.h" #include "line.h" #include "window.h" #include "display.h" int Most_Tab_Width = 8; int Most_Selective_Display = 0; int Most_Show_Wrap_Marker = 1; #define IS_BYTE_PRINTABLE(b) \ ((((b) >= ' ') && ((b) < 0x7F)) \ || ((Most_UTF8_Mode == 0) && ((b) >= SLsmg_Display_Eight_Bit))) /* take 16 binary characters and put them in displayable form */ static void binary_format_line (unsigned char *beg, unsigned char *end, char *buf) { unsigned char *b; char *s, *s1; unsigned char ch; int count; count = 0; b = beg; s = buf; while (b < end) { if (count == 4) { *s++ = ' '; count = 0; } count++; ch = *b++; if ((Most_V_Opt == 0) || (ch & 0x80)) { sprintf (s, "%02X", ch); s += 2; continue; } if ((ch >= ' ') && (ch < 0x7F)) { *s++ = ' '; *s++ = (char) ch; continue; } *s++ = '^'; if (ch < ' ') ch += '@'; else ch = '?'; *s++ = ch; } s1 = buf + (9 * 4) + 4; while (s < s1) *s++ = ' '; b = beg; while (b < end) { ch = *b++; if (IS_BYTE_PRINTABLE(ch)) { *s++ = ch; continue; } *s++ = '.'; } *s = 0; } static void output_binary_formatted_line (void) { unsigned char *beg, *end; char buf[256]; beg = Most_Beg + Most_C_Offset; end = beg + 16; if (end > Most_Eob) end = Most_Eob; sprintf (buf, "0x%08lX: ", (unsigned long) Most_C_Offset); binary_format_line (beg, end, buf + 12); SLsmg_write_string (buf); SLsmg_erase_eol (); } /* Here *begp points to the char after \e. * The general escape sequence parsed here is assumed to look like: * \e[ XX ; ... m * If 30 <= XX <= 37, then it specifies the foreground color * If 40 <= XX <= 47, then a background color is specified * If 0 <= XX <= 8, then an attribute (e.g, 8) is specified. * These numbers will be encoded as: * offset + (FG-30 + 8*(BG-40 + 9*attribute)) */ static int parse_escape (unsigned char **begp, unsigned char *end, int *colorp) { unsigned char *beg = *begp; int fg = 38, bg = 48, at = 0; int xx; if ((beg >= end) || (*beg != '[')) return -1; beg++; /* skip [ */ while (1) { xx = 0; while ((beg < end) && isdigit (*beg)) { xx = xx*10 + (*beg - '0'); beg++; } if ((xx >= 0) && (xx <= 8)) at = xx; else if ((xx >= 20) && (xx <= 28)) xx = 0; else if ((xx >= 30) && (xx <= 37)) fg = xx; else if ((xx >= 40) && (xx <= 47)) bg = xx; else return -1; if ((beg < end) && (*beg == ';')) { beg++; continue; } if ((beg < end) && ((*beg == 'm') || (*beg == ']'))) { *begp = beg + 1; if (colorp != NULL) { if ((fg != 38) || (bg != 48)) xx = ((fg-30) + 9*((bg-40) + 9*at)); if (xx != 0) xx += MOST_EMBEDDED_COLOR_OFFSET; *colorp = xx; } return 0; } return -1; } } typedef struct { unsigned char *bytes; unsigned char byte; /* used if bytes is NULL */ unsigned int len; int color; } Multibyte_Cell_Type; static int most_analyse_line (unsigned char *begg, unsigned char *endd, Multibyte_Cell_Type *cells, unsigned int num_cols) { unsigned char *beg, *end; unsigned int min_col, max_col; unsigned int col, max_col_reached; int default_attr; Multibyte_Cell_Type *cell, *max_cell; beg = begg; end = endd; col = max_col_reached = 0; cell = cells; max_cell = cell; min_col = Most_Column - 1; max_col = min_col + num_cols; default_attr = 0; while (beg < end) { int attr = default_attr; unsigned char ch; unsigned char *pch = beg++; char buf[16]; if ('\n' == (ch = *pch)) break; if ((ch == '\r') && (Most_V_Opt == 0)) { if (col > max_col_reached) max_col_reached = col; col = 0; continue; } if ((ch == '\b') && (Most_V_Opt == 0)) { if (col > max_col_reached) max_col_reached = col; /* FIXME: This does not account for double-width characters */ if (col > 0) col--; continue; } if (col < max_col_reached) /* overstrike */ { attr = MOST_BOLD_COLOR; if ((col >= min_col) && (col < max_col)) { cell = cells + (col-min_col); if (cell->bytes[0] == '_') attr = MOST_ULINE_COLOR; else if (ch == '_') { cell->color = MOST_ULINE_COLOR; col++; continue; } } /* drop */ } if (IS_BYTE_PRINTABLE(ch)) { if ((col >= min_col) && (col < max_col)) { cell = cells + (col-min_col); cell->bytes = pch; cell->len = 1; cell->color = attr; if (cell >= max_cell) max_cell = cell + 1; } col++; continue; } if ((ch == '\t') && (Most_T_Opt == 0) && (Most_Tab_Width)) { int nspaces = Most_Tab_Width * (col/Most_Tab_Width + 1) - col; while (nspaces > 0) { if ((col >= min_col) && (col < max_col)) { cell = cells + (col-min_col); cell->bytes = &cell->byte; cell->byte = ' '; cell->color = attr; cell->len = 1; if (cell >= max_cell) max_cell = cell + 1; } col++; nspaces--; } continue; } #if 1 if ((ch == 033) && (Most_V_Opt == 0)) { int color; if (0 == parse_escape (&beg, end, &color)) { default_attr = color; continue; } /* drop */ } #endif if (ch & 0x80) { SLwchar_Type wch; if ((Most_UTF8_Mode) && (NULL != SLutf8_decode (pch, end, &wch, NULL))) { int width = SLwchar_wcwidth (wch); beg = SLutf8_skip_chars (pch, end, 1, NULL, 1); if (width == 0) { col--; if ((col >= min_col) && (col < max_col)) { cell = cells + (col-min_col); cell->len += beg-pch; } col++; continue; } if ((col >= min_col) && (col < max_col)) { cell = cells + (col-min_col); cell->bytes = pch; cell->color = attr; cell->len = beg - pch; if (cell >= max_cell) max_cell = cell + 1; } col++; if (width > 1) { if ((col >= min_col) && (col < max_col)) { cell = cells + (col-min_col); cell->bytes = pch; cell->color = attr; cell->len = 0; if (cell >= max_cell) max_cell = cell + 1; } col++; } continue; } /* Otherwise, this displays as and takes up 4 character cells */ sprintf (buf, "<%02X>", (unsigned int) ch); /* drop */ } else { /* Otherwise we have a Ctrl-char displayed as ^X */ if (ch == 0x7F) ch = '?'; else ch += '@'; sprintf (buf, "^%c", ch); } pch = (unsigned char *)buf; while (*pch) { if ((col >= min_col) && (col < max_col)) { cell = cells + (col-min_col); cell->bytes = &cell->byte; cell->byte = *pch; cell->color = attr; cell->len = 1; if (cell >= max_cell) max_cell = cell + 1; } col++; pch++; } } if (col < max_col_reached) col = max_col_reached; else max_col_reached = col; /* Now add "..." if selective display. To do that, the next line needs to * be dealt with to determine whether or not it will be hidden. */ if (Most_Selective_Display && (Most_W_Opt == 0) && (beg < Most_Eob) && ((col >= min_col) && (col < max_col))) { if (*beg == '\n') beg++; while ((beg < Most_Eob) && ((*beg == ' ') || (*beg == '\t') || (*beg == '\r'))) beg++; if ((beg >= Most_Eob) || (*beg == '\n') || (most_apparant_distance(beg) >= Most_Selective_Display)) { max_col_reached = col + 3; while (col < max_col_reached) { if (col < max_col) { cell = cells + (col-min_col); cell->bytes = &cell->byte; cell->byte = '.'; cell->color = 0; cell->len = 1; if (cell >= max_cell) max_cell = cell + 1; } col++; } } } return max_cell - cells; } static void display_cells (Multibyte_Cell_Type *cell, unsigned int n, char dollar) { Multibyte_Cell_Type *cell_max; int last_color; last_color = -1; cell_max = cell + n; while (cell < cell_max) { if (last_color != cell->color) { last_color = cell->color; SLsmg_set_color (last_color); } SLsmg_write_chars (cell->bytes, cell->bytes + cell->len); cell++; } if (last_color != 0) SLsmg_set_color (0); SLsmg_erase_eol (); if (dollar) { SLsmg_gotorc (SLsmg_get_row (), SLtt_Screen_Cols-1); SLsmg_write_nchars (&dollar, 1); } } void most_display_line (void) { unsigned char *beg, *end; unsigned char dollar; static Multibyte_Cell_Type *cells; static unsigned int num_cells; unsigned int screen_cols; unsigned int num_cells_set; if (Most_B_Opt) { output_binary_formatted_line (); return; } screen_cols = SLtt_Screen_Cols; if (num_cells != screen_cols + 1) { num_cells = screen_cols + 1; SLfree ((char *) cells); if (NULL == (cells = (Multibyte_Cell_Type *)SLmalloc (num_cells * sizeof (Multibyte_Cell_Type)))) most_exit_error ("Out of memory"); } (void) most_extract_line (&beg, &end); num_cells_set = most_analyse_line (beg, end, cells, num_cells); dollar = 0; if (Most_W_Opt) { if (Most_Show_Wrap_Marker && (end < Most_Eob) && (*end != '\n')) dollar = '\\'; } else if (num_cells_set > screen_cols) dollar = '$'; display_cells (cells, num_cells_set, dollar); } /* given a position in a line, return apparant distance from bol expanding tabs, etc... up to pos */ int most_apparant_distance (unsigned char *pos) { int i; unsigned char *save_pos, ch; unsigned int save_offset; save_offset = Most_C_Offset; save_pos = pos; Most_C_Offset = (unsigned int) (pos - Most_Beg); pos = most_beg_of_line(); Most_C_Offset = save_offset; i = 0; while (pos < save_pos) { ch = *pos++; if (IS_BYTE_PRINTABLE(ch)) { i++; continue; } if ((ch == '\b') && (Most_V_Opt == 0)) { if (i > 0) i--; continue; } if ((ch == '\015') && (Most_V_Opt == 0)) { if (i != 1) i = 0; continue; } if ((ch == '\t') && (Most_T_Opt == 0)) { i = Most_Tab_Width * (i/Most_Tab_Width + 1); /* Most_Tab_Width column tabs */ continue; } if ((ch == 033) && (Most_V_Opt == 0) && (0 == parse_escape (&pos, save_pos, NULL))) continue; if (ch & 0x80) { SLwchar_Type wch; if ((Most_UTF8_Mode) && (NULL != SLutf8_decode (pos-1, save_pos, &wch, NULL))) { pos = SLutf8_skip_chars (pos-1, save_pos, 1, NULL, 1); i++; continue; } i += 4; /* */ continue; } i += 2; /* ^X */ } return i; } /* * Returns a pointer to the num_cols'th character after the one * pointed at b. Invisible character runs are not counted toward this * limit, i.e. strings that represent attributes, such as "_\b" for * underlines. * * If multi_column is non-zero, characters spanning more than one * column will add their extra width to the column count. * * If there the end of the buffer is reached, as delimited by argument * e, then e is returned. */ unsigned char *most_forward_columns (unsigned char *b, unsigned char *e, unsigned int num_cols) { unsigned int col = 0; unsigned int prev_width = 1; while ((b < e) && (col < num_cols)) { unsigned char ch = *b++; if (IS_BYTE_PRINTABLE(ch)) { col++; prev_width = 1; continue; } if ((ch == '\b') || (ch == '\t') || (ch == '\r')) { switch (ch) { case '\b': if (Most_V_Opt == 0) { if (col < prev_width) col = 0; else col -= prev_width; } else col += 2; /* ^H */ break; case '\r': if (Most_V_Opt == 0) { prev_width = 1; col = 0; } else col += 2; /* ^M */ break; case '\t': if (Most_T_Opt == 0) { prev_width = Most_Tab_Width * (col/Most_Tab_Width + 1) - col; col += prev_width; } else col += 2; /* ^I */ break; } continue; } if (ch & 0x80) { SLwchar_Type wch; if ((Most_UTF8_Mode) && (NULL != SLutf8_decode (b-1, e, &wch, NULL))) { b = SLutf8_skip_chars (b-1, e, 1, NULL, 1); prev_width = SLwchar_wcwidth (wch); col += prev_width; continue; } prev_width = 4; col += prev_width; /* */ continue; } if ((ch == 033) && (Most_V_Opt == 0) && (0 == parse_escape (&b, e, NULL))) continue; /* Ctrl-char ^X */ prev_width = 2; col += prev_width; } return b; } most-5.0.0a/src/keyparse.h0000644002657400265740000000152510605757777014476 0ustar davisdavis/* This file is part of MOST. Copyright (c) 1991, 1999, 2002, 2005, 2006, 2007 John E. Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ extern SLKeyMap_List_Type *Most_Keymap; extern int most_load_user_keymaps (void); most-5.0.0a/src/help.c0000644002657400265740000001204010605757777013570 0ustar davisdavis/* This file is part of MOST. Copyright (c) 1991, 1999, 2002, 2005, 2006, 2007 John E. Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "config.h" #include #include #ifdef VMS # include #else # include # include #endif #ifdef HAVE_STDLIB_H # include #endif #include #include "jdmacros.h" #include "most.h" #include "window.h" #include "file.h" #include "display.h" #include "line.h" #include "keym.h" #include "sysdep.h" /* This section provided by Mats Akerberg (mats@efd.lth.se) */ static char *help[] = { "Quitting:", " Q Quit MOST.", " :N,:n Quit this file and view next. ", " (Use UP/DOWN arrow keys to select next file.)", "Movement:", " SPACE, D *Scroll down one Screen.", " U, DELETE *Scroll Up one screen.", " RETURN, DOWN *Move Down one line.", " UP *Move Up one line.", " T Goto Top of File.", " B Goto Bottom of file.", " > , TAB Scroll Window right", " < Scroll Window left", " RIGHT Scroll Window left by 1 column", " LEFT Scroll Window right by 1 column", " J, G Goto line.", " % Goto percent.", "Window Commands:", " Ctrl-X 2, Ctrl-W 2 Split window.", " Ctrl-X 1, Ctrl-W 1 Make only one window.", " O, Ctrl-X O Move to other window.", " Ctrl-X 0 Delete Window.", "Searching:", " S, f, / *Search forward", " ? *Search Backward", " N *Find next in current search direction.", "Miscellaneous:", " W Toggle width between 80 and 132 char mode.", " Ctrl-X Ctrl-F Read a file from disk", " R, Ctrl-R Redraw Screen.", " F Simulate tail -f mode", " :o Toggle options: b-binary, w-wrap, t-tab", " E Edit file. Uses MOST_EDITOR and EDITOR", " environment variables.", "*Note: This command may be repeated `n' times By entering a number then", " the command key, e.g., '5 SPACE' moves 5 screens forward.", NULL }; static void most_do_help_text (void) { char **p = help, *sect = NULL; int r; while (*p != NULL) { SLsmg_cls (); r = 0; SLsmg_gotorc (0, 0); if ((sect != NULL) && (**p == ' ')) { most_tt_bold_video (); SLsmg_gotorc (r, 0); SLsmg_write_string (sect); most_tt_normal_video (); SLsmg_write_string (" (continued)"); r += 2; } else sect = NULL; while (r < SLtt_Screen_Rows - 1) { if (*p == NULL) break; if (**p != ' ') { if (((r + 5) > SLtt_Screen_Rows) && (**p != '*')) { sect = NULL; break; } if (sect != NULL) { r++; } if (**p != '*') { sect = *p; most_tt_bold_video (); } else sect = NULL; } SLsmg_gotorc (r, 0); SLsmg_write_string (*p); if ((**p != ' ') && (**p != '*')) { most_tt_normal_video (); r++; } p++; r++; } SLsmg_gotorc (r, 0); most_tt_reverse_video(); SLsmg_write_string("Press any key to continue."); most_tt_normal_video(); SLsmg_refresh (); most_getkey (); } most_redraw_display(); } static void most_do_help_file (char *helpfile) { char *buf_name; FILE *fp; buf_name = "*help*"; #ifdef MOST_HELPFILE if (helpfile == NULL) helpfile = MOST_HELPFILE; #endif if (helpfile != NULL) { if (most_file_visible(buf_name)) return; /* See if we can open it */ if (NULL != (fp = fopen (helpfile, "r"))) { fclose (fp); if (!most_split_window()) { most_message("Two many windows.",1); return; } most_update_status(); /* create status line of prev. window */ most_other_window(1); (void) most_find_file(helpfile); strcpy(Most_Buf->file, buf_name); Most_B_Opt = 0; most_window_buffer (); most_redraw_window (); most_update_status (); return; } } most_do_help_text (); } void most_do_help_command(void) { most_do_help_file (getenv ("MOST_HELP")); } most-5.0.0a/src/edit.h0000644002657400265740000000154710605757777013604 0ustar davisdavis/* This file is part of MOST. Copyright (c) 1991, 1999, 2002, 2005, 2006, 2007 John E. Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ extern void most_edit_cmd (void); extern char *most_escape_filename (char *file, char quote_char); most-5.0.0a/src/version.h0000644002657400265740000000154210670253221014310 0ustar davisdavis/* This file is part of MOST. Copyright (c) 2006, 2007 John E. Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef MOST_VERSION #define MOST_VERSION 50000 #define MOST_VERSION_STR "5.0.0" #endif /* MOST_VERSION */ most-5.0.0a/src/line.h0000644002657400265740000000232510630436657013566 0ustar davisdavis/* This file is part of MOST. Copyright (c) 1991, 1999, 2002, 2005, 2006, 2007 John E. Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef _DAVIS_LINE_H_ # define _DAVIS_LINE_H_ #if 0 extern int most_analyse_line(unsigned char *, unsigned char *, char *, char *); extern void most_output(unsigned char *, unsigned int, unsigned char *, unsigned char); #endif extern void most_display_line(void); extern int most_apparant_distance(unsigned char *); extern unsigned char *most_forward_columns (unsigned char *b, unsigned char *e, unsigned int num_cols); extern int Most_Show_Wrap_Marker; #endif most-5.0.0a/configure0000755002657400265740000112721210670010673013600 0ustar davisdavis#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="src/most.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='RPATH SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias CONFIG_DIR CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP GREP EGREP SET_MAKE INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA build build_cpu build_vendor build_os host host_cpu host_vendor host_os DYNAMIC_LINK_LIB ELF_CC ELF_CFLAGS ELF_LINK ELF_LINK_CMD ELF_DEP_LIBS DYNAMIC_LINK_FLAGS CC_SHARED ELFLIB ELFLIB_MAJOR ELFLIB_MAJOR_MINOR ELFLIB_MAJOR_MINOR_MICRO SLANG_LIB_FOR_MODULES DLL_IMPLIB_NAME INSTALL_MODULE INSTALL_ELFLIB_TARGET ELFLIB_BUILD_NAME SLANG_DLL_CFLAGS XMKMF X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS SRCDIR OBJDIR ELFDIR TERMCAP MISC_TERMINFO_DIRS SLANG_LIB SLANG_INC PROGRAM_OFILES PROGRAM_CFILES PROGRAM_HFILES PROGRAM_OBJECTS PROGRAM_ELFOBJECTS LIBOBJS LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP XMKMF' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= 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=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$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 ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) 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 | -n) 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 ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute directory names. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # 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 the parent directory. ac_confdir=`$as_dirname -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` 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 test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF X features: --x-includes=DIR X include files are in DIR --x-libraries=DIR X library files are in DIR System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-mmap disable the use of mmap --disable-largefile omit support for large files --enable-warnings turn on GCC compiler warnings Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-x use the X Window System --with-slang=DIR Use DIR/lib and DIR/include for slang --with-slanglib=DIR slang library in DIR --with-slanginc=DIR slang include files in DIR Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor XMKMF Path to xmkmf, Makefile generator for X Window System Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu #These variable are initialized by JD init function CONFIG_DIR=`pwd` cd $srcdir if test "`pwd`" != "$CONFIG_DIR" then { { echo "$as_me:$LINENO: error: \"This software does not support configuring from another directory. See the INSTALL file\"" >&5 echo "$as_me: error: \"This software does not support configuring from another directory. See the INSTALL file\"" >&2;} { (exit 1); exit 1; }; } fi # Note: these will differ if one is a symbolic link if test -f /usr/bin/dirname; then JD_Above_Dir=`dirname $CONFIG_DIR` else # system is a loser JD_Above_Dir=`cd ..;pwd` fi JD_Above_Dir2=`cd ..;pwd` { echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Extract the first word of "grep ggrep" to use in msg output if test -z "$GREP"; then set dummy grep ggrep; ac_prog_name=$2 if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS fi GREP="$ac_cv_path_GREP" if test -z "$GREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_GREP=$GREP fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 echo "${ECHO_T}$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else # Extract the first word of "egrep" to use in msg output if test -z "$EGREP"; then set dummy egrep; ac_prog_name=$2 if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS fi EGREP="$ac_cv_path_EGREP" if test -z "$EGREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_EGREP=$EGREP fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_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 $# != 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 ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # # List of possible output files, starting from the most likely. # The algorithm is not robust to junk in `.', hence go to wildcards (a.*) # only as a last resort. b.out is created by i960 compilers. ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' # # The IRIX 6 linker writes into existing files which may not be # executable, retaining their permissions. Remove them first so a # subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { (ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi { echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6; } { echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext { echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test $ac_cv_c_compiler_gnu = yes; then { echo "$as_me:$LINENO: checking whether $CC needs -traditional" >&5 echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6; } if test "${ac_cv_prog_gcc_traditional+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_pattern="Autoconf.*'x'" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include Autoconf TIOCGETP _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "$ac_pattern" >/dev/null 2>&1; then ac_cv_prog_gcc_traditional=yes else ac_cv_prog_gcc_traditional=no fi rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include Autoconf TCGETA _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "$ac_pattern" >/dev/null 2>&1; then ac_cv_prog_gcc_traditional=yes fi rm -f conftest* fi fi { echo "$as_me:$LINENO: result: $ac_cv_prog_gcc_traditional" >&5 echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6; } if test $ac_cv_prog_gcc_traditional = yes; then CC="$CC -traditional" fi fi { echo "$as_me:$LINENO: checking for library containing strerror" >&5 echo $ECHO_N "checking for library containing strerror... $ECHO_C" >&6; } if test "${ac_cv_search_strerror+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char strerror (); int main () { return strerror (); ; return 0; } _ACEOF for ac_lib in '' cposix; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_search_strerror=$ac_res else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_strerror+set}" = set; then break fi done if test "${ac_cv_search_strerror+set}" = set; then : else ac_cv_search_strerror=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_search_strerror" >&5 echo "${ECHO_T}$ac_cv_search_strerror" >&6; } ac_res=$ac_cv_search_strerror if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi { echo "$as_me:$LINENO: checking for AIX" >&5 echo $ECHO_N "checking for AIX... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef _AIX yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } cat >>confdefs.h <<\_ACEOF #define _ALL_SOURCE 1 _ACEOF else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi rm -f conftest* cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef hpux yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then cat >>confdefs.h <<\_ACEOF #define _HPUX_SOURCE 1 _ACEOF if test "$CC" = cc; then CC="cc -Ae"; fi fi rm -f conftest* { echo "$as_me:$LINENO: checking C compiler that understands ANSI prototypes" >&5 echo $ECHO_N "checking C compiler that understands ANSI prototypes... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { extern int silly (int); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then { echo "$as_me:$LINENO: result: $CC looks ok. Good." >&5 echo "${ECHO_T}$CC looks ok. Good." >&6; } else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { echo "$as_me:$LINENO: result: $CC is not a good enough compiler" >&5 echo "${ECHO_T}$CC is not a good enough compiler" >&6; } { { echo "$as_me:$LINENO: error: Set env variable CC to your ANSI compiler and rerun configure." >&5 echo "$as_me: error: Set env variable CC to your ANSI compiler and rerun configure." >&2;} { (exit 1); exit 1; }; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_aux_dir= for ac_dir in autoconf "$srcdir"/autoconf; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in autoconf \"$srcdir\"/autoconf" >&5 echo "$as_me: error: cannot find install-sh or install.sh in autoconf \"$srcdir\"/autoconf" >&2;} { (exit 1); exit 1; }; } fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. { echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } SET_MAKE= else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. { echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done IFS=$as_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. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} { (exit 1); exit 1; }; } { echo "$as_me:$LINENO: checking build system type" >&5 echo $ECHO_N "checking build system type... $ECHO_C" >&6; } if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: result: $ac_cv_build" >&5 echo "${ECHO_T}$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 echo "$as_me: error: invalid value of canonical build" >&2;} { (exit 1); exit 1; }; };; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { echo "$as_me:$LINENO: checking host system type" >&5 echo $ECHO_N "checking host system type... $ECHO_C" >&6; } if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} { (exit 1); exit 1; }; } fi fi { echo "$as_me:$LINENO: result: $ac_cv_host" >&5 echo "${ECHO_T}$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 echo "$as_me: error: invalid value of canonical host" >&2;} { (exit 1); exit 1; }; };; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac { echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done DYNAMIC_LINK_LIB="" if test "${ac_cv_header_dlfcn_h+set}" = set; then { echo "$as_me:$LINENO: checking for dlfcn.h" >&5 echo $ECHO_N "checking for dlfcn.h... $ECHO_C" >&6; } if test "${ac_cv_header_dlfcn_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5 echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking dlfcn.h usability" >&5 echo $ECHO_N "checking dlfcn.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking dlfcn.h presence" >&5 echo $ECHO_N "checking dlfcn.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: dlfcn.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: dlfcn.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: dlfcn.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: dlfcn.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: dlfcn.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: dlfcn.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for dlfcn.h" >&5 echo $ECHO_N "checking for dlfcn.h... $ECHO_C" >&6; } if test "${ac_cv_header_dlfcn_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_dlfcn_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5 echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6; } fi if test $ac_cv_header_dlfcn_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_DLFCN_H 1 _ACEOF { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } if test $ac_cv_lib_dl_dlopen = yes; then DYNAMIC_LINK_LIB="-ldl" cat >>confdefs.h <<\_ACEOF #define HAVE_DLOPEN 1 _ACEOF else { echo "$as_me:$LINENO: checking for dlopen" >&5 echo $ECHO_N "checking for dlopen... $ECHO_C" >&6; } if test "${ac_cv_func_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define dlopen to an innocuous variant, in case declares dlopen. For example, HP-UX 11i declares gettimeofday. */ #define dlopen innocuous_dlopen /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dlopen (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef dlopen /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_dlopen || defined __stub___dlopen choke me #endif int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_dlopen=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 echo "${ECHO_T}$ac_cv_func_dlopen" >&6; } if test $ac_cv_func_dlopen = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_DLOPEN 1 _ACEOF fi if test "$ac_cv_func_dlopen" != yes then { echo "$as_me:$LINENO: WARNING: cannot perform dynamic linking" >&5 echo "$as_me: WARNING: cannot perform dynamic linking" >&2;} fi fi fi if test "$GCC" = yes then if test X"$CFLAGS" = X then CFLAGS="-O2" fi fi ELFLIB="lib\$(THIS_LIB).so" ELFLIB_MAJOR="\$(ELFLIB).\$(ELF_MAJOR_VERSION)" ELFLIB_MAJOR_MINOR="\$(ELFLIB_MAJOR).\$(ELF_MINOR_VERSION)" ELFLIB_MAJOR_MINOR_MICRO="\$(ELFLIB_MAJOR_MINOR).\$(ELF_MICRO_VERSION)" INSTALL_ELFLIB_TARGET="install-elf-and-links" ELFLIB_BUILD_NAME="\$(ELFLIB_MAJOR_MINOR_MICRO)" INSTALL_MODULE="\$(INSTALL_DATA)" SLANG_DLL_CFLAGS="" case "$host_os" in *linux*|*gnu*|k*bsd*-gnu ) DYNAMIC_LINK_FLAGS="-Wl,-export-dynamic" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) -fPIC" ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-O1 -Wl,--version-script,\$(VERSION_SCRIPT) -Wl,-soname,\$(ELFLIB_MAJOR)" ELF_DEP_LIBS="\$(DL_LIB) -lm -lc" CC_SHARED="\$(CC) \$(CFLAGS) -shared -fPIC" ;; *solaris* ) if test "$GCC" = yes then DYNAMIC_LINK_FLAGS="" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) -fPIC" ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-ztext -Wl,-h,\$(ELFLIB_MAJOR)" ELF_DEP_LIBS="\$(DL_LIB) -lm -lc" CC_SHARED="\$(CC) \$(CFLAGS) -G -fPIC" else DYNAMIC_LINK_FLAGS="" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) -K PIC" ELF_LINK="\$(CC) \$(LDFLAGS) -G -h\$(ELFLIB_MAJOR)" ELF_DEP_LIBS="\$(DL_LIB) -lm -lc" CC_SHARED="\$(CC) \$(CFLAGS) -G -K PIC" fi ;; # osr5 or unixware7 with current or late autoconf *sco3.2v5* | *unixware-5* | *sco-sysv5uw7*) if test "$GCC" = yes then DYNAMIC_LINK_FLAGS="" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) -fPIC" ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-h,\$(ELFLIB_MAJOR)" ELF_DEP_LIBS= CC_SHARED="\$(CC) \$(CFLAGS) -G -fPIC" else DYNAMIC_LINK_FLAGS="" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) -K pic" # ELF_LINK="ld -G -z text -h#" ELF_LINK="\$(CC) \$(LDFLAGS) -G -z text -h\$(ELFLIB_MAJOR)" ELF_DEP_LIBS= CC_SHARED="\$(CC) \$(CFLAGS) -G -K pic" fi ;; *irix6.5* ) echo "Note: ELF compiler for host_os=$host_os may not be correct" echo "double-check: 'mode_t', 'pid_t' may be wrong!" if test "$GCC" = yes then # not tested DYNAMIC_LINK_FLAGS="" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) -fPIC" ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-h,\$(ELFLIB_MAJOR)" ELF_DEP_LIBS= CC_SHARED="\$(CC) \$(CFLAGS) -shared -fPIC" else DYNAMIC_LINK_FLAGS="" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS)" # default anyhow ELF_LINK="\$(CC) \$(LDFLAGS) -shared -o \$(ELFLIB_MAJOR)" ELF_DEP_LIBS= CC_SHARED="\$(CC) \$(CFLAGS) -shared" fi ;; *darwin* ) DYNAMIC_LINK_FLAGS="" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) -fno-common" ELF_LINK="\$(CC) \$(LDFLAGS) -dynamiclib -install_name \$(install_lib_dir)/\$(ELFLIB_MAJOR) -compatibility_version \$(ELF_MAJOR_VERSION) -current_version \$(ELF_MAJOR_VERSION).\$(ELF_MINOR_VERSION)" ELF_DEP_LIBS="\$(LDFLAGS) \$(DL_LIB)" CC_SHARED="\$(CC) -bundle -flat_namespace -undefined suppress \$(CFLAGS) -fno-common" ELFLIB="lib\$(THIS_LIB).dylib" ELFLIB_MAJOR="lib\$(THIS_LIB).\$(ELF_MAJOR_VERSION).dylib" ELFLIB_MAJOR_MINOR="lib\$(THIS_LIB).\$(ELF_MAJOR_VERSION).\$(ELF_MINOR_VERSION).dylib" ELFLIB_MAJOR_MINOR_MICRO="lib\$(THIS_LIB).\$(ELF_MAJOR_VERSION).\$(ELF_MINOR_VERSION).\$(ELF_MICRO_VERSION).dylib" ;; *freebsd* ) ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) -fPIC" #if test "X$PORTOBJFORMAT" = "Xelf" ; then # ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-soname,\$(ELFLIB_MAJOR)" #else # ELF_LINK="ld -Bshareable -x" #fi ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-soname,\$(ELFLIB_MAJOR)" ELF_DEP_LIBS="\$(DL_LIB) -lm" CC_SHARED="\$(CC) \$(CFLAGS) -shared -fPIC" ;; *cygwin* ) DYNAMIC_LINK_FLAGS="" ELF_CC="\$(CC)" SLANG_DLL_CFLAGS="-DSLANG_DLL=1" ELF_CFLAGS="\$(CFLAGS) -DBUILD_DLL=1" DLL_IMPLIB_NAME="lib\$(THIS_LIB)\$(ELFLIB_MAJOR_VERSION).dll.a" #ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-O1 -Wl,--version-script,\$(VERSION_SCRIPT) -Wl,-soname,\$(ELFLIB_MAJOR) -Wl,--out-implib=\$(DLL_IMPLIB_NAME) -Wl,-export-all-symbols -Wl,-enable-auto-import" ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-O1 -Wl,--version-script,\$(VERSION_SCRIPT) -Wl,-soname,\$(ELFLIB_MAJOR) -Wl,--out-implib=\$(DLL_IMPLIB_NAME)" ELF_DEP_LIBS="\$(DL_LIB) -lm" CC_SHARED="\$(CC) \$(CFLAGS) -shared -DSLANG_DLL=1" SLANG_LIB_FOR_MODULES="-L\$(ELFDIR) -lslang" INSTALL_MODULE="\$(INSTALL)" INSTALL_ELFLIB_TARGET="install-elf-cygwin" ELFLIB="lib\$(THIS_LIB).dll" ELFLIB_MAJOR="lib\$(THIS_LIB)\$(ELF_MAJOR_VERSION).dll" ELFLIB_MAJOR_MINOR="lib\$(THIS_LIB)\$(ELF_MAJOR_VERSION)_\$(ELF_MINOR_VERSION).dll" ELFLIB_MAJOR_MINOR_MICRO="lib\$(THIS_LIB)\$(ELF_MAJOR_VERSION)_\$(ELF_MINOR_VERSION)_\$(ELF_MICRO_VERSION).dll" ELFLIB_BUILD_NAME="\$(ELFLIB_MAJOR)" ;; * ) echo "Note: ELF compiler for host_os=$host_os may be wrong" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) -fPIC" ELF_LINK="\$(CC) \$(LDFLAGS) -shared" ELF_DEP_LIBS="\$(DL_LIB) -lm -lc" CC_SHARED="\$(CC) \$(CFLAGS) -shared -fPIC" esac # determine X include and needed libs { echo "$as_me:$LINENO: checking for X" >&5 echo $ECHO_N "checking for X... $ECHO_C" >&6; } # Check whether --with-x was given. if test "${with_x+set}" = set; then withval=$with_x; fi # $have_x is `yes', `no', `disabled', or empty when we do not yet know. if test "x$with_x" = xno; then # The user explicitly disabled X. have_x=disabled else case $x_includes,$x_libraries in #( *\'*) { { echo "$as_me:$LINENO: error: Cannot use X directory names containing '" >&5 echo "$as_me: error: Cannot use X directory names containing '" >&2;} { (exit 1); exit 1; }; };; #( *,NONE | NONE,*) if test "${ac_cv_have_x+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # One or both of the vars are not set, and there is no cached value. ac_x_includes=no ac_x_libraries=no rm -f -r conftest.dir if mkdir conftest.dir; then cd conftest.dir cat >Imakefile <<'_ACEOF' incroot: @echo incroot='${INCROOT}' usrlibdir: @echo usrlibdir='${USRLIBDIR}' libdir: @echo libdir='${LIBDIR}' _ACEOF if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then # GNU make sometimes prints "make[1]: Entering...", which would confuse us. for ac_var in incroot usrlibdir libdir; do eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`" done # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. for ac_extension in a so sl; do if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" && test -f "$ac_im_libdir/libX11.$ac_extension"; then ac_im_usrlibdir=$ac_im_libdir; break fi done # Screen out bogus values from the imake configuration. They are # bogus both because they are the default anyway, and because # using them would break gcc on systems where it needs fixed includes. case $ac_im_incroot in /usr/include) ac_x_includes= ;; *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;; esac case $ac_im_usrlibdir in /usr/lib | /lib) ;; *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;; esac fi cd .. rm -f -r conftest.dir fi # Standard set of common directories for X headers. # Check X11 before X11Rn because it is often a symlink to the current release. ac_x_header_dirs=' /usr/X11/include /usr/X11R6/include /usr/X11R5/include /usr/X11R4/include /usr/include/X11 /usr/include/X11R6 /usr/include/X11R5 /usr/include/X11R4 /usr/local/X11/include /usr/local/X11R6/include /usr/local/X11R5/include /usr/local/X11R4/include /usr/local/include/X11 /usr/local/include/X11R6 /usr/local/include/X11R5 /usr/local/include/X11R4 /usr/X386/include /usr/x386/include /usr/XFree86/include/X11 /usr/include /usr/local/include /usr/unsupported/include /usr/athena/include /usr/local/x11r5/include /usr/lpp/Xamples/include /usr/openwin/include /usr/openwin/share/include' if test "$ac_x_includes" = no; then # Guess where to find include files, by looking for Xlib.h. # First, try using that file with no special directory specified. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # We can compile using X headers with no special include directory. ac_x_includes= else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 for ac_dir in $ac_x_header_dirs; do if test -r "$ac_dir/X11/Xlib.h"; then ac_x_includes=$ac_dir break fi done fi rm -f conftest.err conftest.$ac_ext fi # $ac_x_includes = no if test "$ac_x_libraries" = no; then # Check for the libraries. # See if we find them without any special options. # Don't add to $LIBS permanently. ac_save_LIBS=$LIBS LIBS="-lX11 $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { XrmInitialize () ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then LIBS=$ac_save_LIBS # We can link X programs with no special library path. ac_x_libraries= else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 LIBS=$ac_save_LIBS for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` do # Don't even attempt the hair of trying to link an X program! for ac_extension in a so sl; do if test -r "$ac_dir/libX11.$ac_extension"; then ac_x_libraries=$ac_dir break 2 fi done done fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi # $ac_x_libraries = no case $ac_x_includes,$ac_x_libraries in #( no,* | *,no | *\'*) # Didn't find X, or a directory has "'" in its name. ac_cv_have_x="have_x=no";; #( *) # Record where we found X for the cache. ac_cv_have_x="have_x=yes\ ac_x_includes='$ac_x_includes'\ ac_x_libraries='$ac_x_libraries'" esac fi ;; #( *) have_x=yes;; esac eval "$ac_cv_have_x" fi # $with_x != no if test "$have_x" != yes; then { echo "$as_me:$LINENO: result: $have_x" >&5 echo "${ECHO_T}$have_x" >&6; } no_x=yes else # If each of the values was on the command line, it overrides each guess. test "x$x_includes" = xNONE && x_includes=$ac_x_includes test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries # Update the cache value to reflect the command line values. ac_cv_have_x="have_x=yes\ ac_x_includes='$x_includes'\ ac_x_libraries='$x_libraries'" { echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6; } fi if test "$no_x" = yes; then # Not all programs may use this symbol, but it does not hurt to define it. cat >>confdefs.h <<\_ACEOF #define X_DISPLAY_MISSING 1 _ACEOF X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS= else if test -n "$x_includes"; then X_CFLAGS="$X_CFLAGS -I$x_includes" fi # It would also be nice to do this for all -L options, not just this one. if test -n "$x_libraries"; then X_LIBS="$X_LIBS -L$x_libraries" # For Solaris; some versions of Sun CC require a space after -R and # others require no space. Words are not sufficient . . . . { echo "$as_me:$LINENO: checking whether -R must be followed by a space" >&5 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6; } ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries" ac_xsave_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } X_LIBS="$X_LIBS -R$x_libraries" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 LIBS="$ac_xsave_LIBS -R $x_libraries" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } X_LIBS="$X_LIBS -R $x_libraries" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { echo "$as_me:$LINENO: result: neither works" >&5 echo "${ECHO_T}neither works" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext ac_c_werror_flag=$ac_xsave_c_werror_flag LIBS=$ac_xsave_LIBS fi # Check for system-dependent libraries X programs must link with. # Do this before checking for the system-independent R6 libraries # (-lICE), since we may need -lsocket or whatever for X linking. if test "$ISC" = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet" else # Martyn Johnson says this is needed for Ultrix, if the X # libraries were built with DECnet support. And Karl Berry says # the Alpha needs dnet_stub (dnet does not exist). ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XOpenDisplay (); int main () { return XOpenDisplay (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet" >&5 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6; } if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dnet_ntoa (); int main () { return dnet_ntoa (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_dnet_dnet_ntoa=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dnet_dnet_ntoa=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_dnet_ntoa" >&5 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6; } if test $ac_cv_lib_dnet_dnet_ntoa = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" fi if test $ac_cv_lib_dnet_dnet_ntoa = no; then { echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet_stub" >&5 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6; } if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet_stub $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dnet_ntoa (); int main () { return dnet_ntoa (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_dnet_stub_dnet_ntoa=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dnet_stub_dnet_ntoa=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6; } if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" fi fi fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$ac_xsave_LIBS" # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT, # to get the SysV transport functions. # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4) # needs -lnsl. # The nsl library prevents programs from opening the X display # on Irix 5.2, according to T.E. Dickey. # The functions gethostbyname, getservbyname, and inet_addr are # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking. { echo "$as_me:$LINENO: checking for gethostbyname" >&5 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6; } if test "${ac_cv_func_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define gethostbyname to an innocuous variant, in case declares gethostbyname. For example, HP-UX 11i declares gettimeofday. */ #define gethostbyname innocuous_gethostbyname /* System header to define __stub macros and hopefully few prototypes, which can conflict with char gethostbyname (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef gethostbyname /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_gethostbyname || defined __stub___gethostbyname choke me #endif int main () { return gethostbyname (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_gethostbyname=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6; } if test $ac_cv_func_gethostbyname = no; then { echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6; } if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); int main () { return gethostbyname (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_nsl_gethostbyname=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_nsl_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6; } if test $ac_cv_lib_nsl_gethostbyname = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl" fi if test $ac_cv_lib_nsl_gethostbyname = no; then { echo "$as_me:$LINENO: checking for gethostbyname in -lbsd" >&5 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6; } if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); int main () { return gethostbyname (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_bsd_gethostbyname=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_bsd_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6; } if test $ac_cv_lib_bsd_gethostbyname = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd" fi fi fi # lieder@skyler.mavd.honeywell.com says without -lsocket, # socket/setsockopt and other routines are undefined under SCO ODT # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary # on later versions), says Simon Leinen: it contains gethostby* # variants that don't use the name server (or something). -lsocket # must be given before -lnsl if both are needed. We assume that # if connect needs -lnsl, so does gethostbyname. { echo "$as_me:$LINENO: checking for connect" >&5 echo $ECHO_N "checking for connect... $ECHO_C" >&6; } if test "${ac_cv_func_connect+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define connect to an innocuous variant, in case declares connect. For example, HP-UX 11i declares gettimeofday. */ #define connect innocuous_connect /* System header to define __stub macros and hopefully few prototypes, which can conflict with char connect (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef connect /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char connect (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_connect || defined __stub___connect choke me #endif int main () { return connect (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_connect=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_connect=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5 echo "${ECHO_T}$ac_cv_func_connect" >&6; } if test $ac_cv_func_connect = no; then { echo "$as_me:$LINENO: checking for connect in -lsocket" >&5 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6; } if test "${ac_cv_lib_socket_connect+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $X_EXTRA_LIBS $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char connect (); int main () { return connect (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_socket_connect=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_socket_connect=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_socket_connect" >&5 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6; } if test $ac_cv_lib_socket_connect = yes; then X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS" fi fi # Guillermo Gomez says -lposix is necessary on A/UX. { echo "$as_me:$LINENO: checking for remove" >&5 echo $ECHO_N "checking for remove... $ECHO_C" >&6; } if test "${ac_cv_func_remove+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define remove to an innocuous variant, in case declares remove. For example, HP-UX 11i declares gettimeofday. */ #define remove innocuous_remove /* System header to define __stub macros and hopefully few prototypes, which can conflict with char remove (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef remove /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char remove (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_remove || defined __stub___remove choke me #endif int main () { return remove (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_remove=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_remove=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_remove" >&5 echo "${ECHO_T}$ac_cv_func_remove" >&6; } if test $ac_cv_func_remove = no; then { echo "$as_me:$LINENO: checking for remove in -lposix" >&5 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6; } if test "${ac_cv_lib_posix_remove+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lposix $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char remove (); int main () { return remove (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_posix_remove=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_posix_remove=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_posix_remove" >&5 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6; } if test $ac_cv_lib_posix_remove = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix" fi fi # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. { echo "$as_me:$LINENO: checking for shmat" >&5 echo $ECHO_N "checking for shmat... $ECHO_C" >&6; } if test "${ac_cv_func_shmat+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define shmat to an innocuous variant, in case declares shmat. For example, HP-UX 11i declares gettimeofday. */ #define shmat innocuous_shmat /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shmat (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef shmat /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shmat (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_shmat || defined __stub___shmat choke me #endif int main () { return shmat (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_shmat=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_shmat=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_shmat" >&5 echo "${ECHO_T}$ac_cv_func_shmat" >&6; } if test $ac_cv_func_shmat = no; then { echo "$as_me:$LINENO: checking for shmat in -lipc" >&5 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6; } if test "${ac_cv_lib_ipc_shmat+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lipc $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shmat (); int main () { return shmat (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_ipc_shmat=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_ipc_shmat=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_ipc_shmat" >&5 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6; } if test $ac_cv_lib_ipc_shmat = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc" fi fi fi # Check for libraries that X11R6 Xt/Xaw programs need. ac_save_LDFLAGS=$LDFLAGS test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries" # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to # check for ICE first), but we must link in the order -lSM -lICE or # we get undefined symbols. So assume we have SM if we have ICE. # These have to be linked with before -lX11, unlike the other # libraries we check for below, so use a different variable. # John Interrante, Karl Berry { echo "$as_me:$LINENO: checking for IceConnectionNumber in -lICE" >&5 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6; } if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lICE $X_EXTRA_LIBS $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char IceConnectionNumber (); int main () { return IceConnectionNumber (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_ICE_IceConnectionNumber=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_ICE_IceConnectionNumber=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6; } if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE" fi LDFLAGS=$ac_save_LDFLAGS fi # Implementation of the --disable-dev-random switch. { echo "$as_me:$LINENO: checking if you want to use mmap if available" >&5 echo $ECHO_N "checking if you want to use mmap if available... $ECHO_C" >&6; } # Check whether --enable-mmap was given. if test "${enable_mmap+set}" = set; then enableval=$enable_mmap; jd_use_mmap=$enableval else jd_use_mmap=yes fi { echo "$as_me:$LINENO: result: $jd_use_mmap" >&5 echo "${ECHO_T}$jd_use_mmap" >&6; } case "x$jd_use_mmap" in xyes ) cat >>confdefs.h <<\_ACEOF #define USE_MMAP 1 _ACEOF ;; esac #Check these header since they cause trouble for ac_header in \ stdlib.h \ unistd.h \ memory.h \ malloc.h \ termios.h \ sys/mman.h \ do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include <$ac_hdr> int main () { if ((DIR *) 0) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 _ACEOF ac_header_dirent=$ac_hdr; break fi done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then { echo "$as_me:$LINENO: checking for library containing opendir" >&5 echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; } if test "${ac_cv_search_opendir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char opendir (); int main () { return opendir (); ; return 0; } _ACEOF for ac_lib in '' dir; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_search_opendir=$ac_res else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_opendir+set}" = set; then break fi done if test "${ac_cv_search_opendir+set}" = set; then : else ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 echo "${ECHO_T}$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi else { echo "$as_me:$LINENO: checking for library containing opendir" >&5 echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; } if test "${ac_cv_search_opendir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char opendir (); int main () { return opendir (); ; return 0; } _ACEOF for ac_lib in '' x; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_search_opendir=$ac_res else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_opendir+set}" = set; then break fi done if test "${ac_cv_search_opendir+set}" = set; then : else ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 echo "${ECHO_T}$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi fi { echo "$as_me:$LINENO: checking for mode_t" >&5 echo $ECHO_N "checking for mode_t... $ECHO_C" >&6; } if test "${ac_cv_type_mode_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef mode_t ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_mode_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_mode_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_mode_t" >&5 echo "${ECHO_T}$ac_cv_type_mode_t" >&6; } if test $ac_cv_type_mode_t = yes; then : else cat >>confdefs.h <<_ACEOF #define mode_t int _ACEOF fi { echo "$as_me:$LINENO: checking for pid_t" >&5 echo $ECHO_N "checking for pid_t... $ECHO_C" >&6; } if test "${ac_cv_type_pid_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef pid_t ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_pid_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_pid_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 echo "${ECHO_T}$ac_cv_type_pid_t" >&6; } if test $ac_cv_type_pid_t = yes; then : else cat >>confdefs.h <<_ACEOF #define pid_t int _ACEOF fi { echo "$as_me:$LINENO: checking for uid_t in sys/types.h" >&5 echo $ECHO_N "checking for uid_t in sys/types.h... $ECHO_C" >&6; } if test "${ac_cv_type_uid_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "uid_t" >/dev/null 2>&1; then ac_cv_type_uid_t=yes else ac_cv_type_uid_t=no fi rm -f conftest* fi { echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5 echo "${ECHO_T}$ac_cv_type_uid_t" >&6; } if test $ac_cv_type_uid_t = no; then cat >>confdefs.h <<\_ACEOF #define uid_t int _ACEOF cat >>confdefs.h <<\_ACEOF #define gid_t int _ACEOF fi { echo "$as_me:$LINENO: checking for size_t" >&5 echo $ECHO_N "checking for size_t... $ECHO_C" >&6; } if test "${ac_cv_type_size_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef size_t ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_size_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_size_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 echo "${ECHO_T}$ac_cv_type_size_t" >&6; } if test $ac_cv_type_size_t = yes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi { echo "$as_me:$LINENO: checking for short" >&5 echo $ECHO_N "checking for short... $ECHO_C" >&6; } if test "${ac_cv_type_short+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef short ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_short=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_short=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_short" >&5 echo "${ECHO_T}$ac_cv_type_short" >&6; } # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { echo "$as_me:$LINENO: checking size of short" >&5 echo $ECHO_N "checking size of short... $ECHO_C" >&6; } if test "${ac_cv_sizeof_short+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef short ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef short ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef short ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef short ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef short ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_short=$ac_lo;; '') if test "$ac_cv_type_short" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (short) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (short) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_short=0 fi ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef short ac__type_sizeof_; static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%lu\n", i); } return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_short=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_short" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (short) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (short) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_short=0 fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { echo "$as_me:$LINENO: result: $ac_cv_sizeof_short" >&5 echo "${ECHO_T}$ac_cv_sizeof_short" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_SHORT $ac_cv_sizeof_short _ACEOF { echo "$as_me:$LINENO: checking for int" >&5 echo $ECHO_N "checking for int... $ECHO_C" >&6; } if test "${ac_cv_type_int+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef int ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_int=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_int=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5 echo "${ECHO_T}$ac_cv_type_int" >&6; } # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { echo "$as_me:$LINENO: checking size of int" >&5 echo $ECHO_N "checking size of int... $ECHO_C" >&6; } if test "${ac_cv_sizeof_int+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef int ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef int ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef int ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef int ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef int ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_int=$ac_lo;; '') if test "$ac_cv_type_int" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (int) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (int) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_int=0 fi ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef int ac__type_sizeof_; static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%lu\n", i); } return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_int=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_int" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (int) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (int) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_int=0 fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5 echo "${ECHO_T}$ac_cv_sizeof_int" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_INT $ac_cv_sizeof_int _ACEOF { echo "$as_me:$LINENO: checking for long" >&5 echo $ECHO_N "checking for long... $ECHO_C" >&6; } if test "${ac_cv_type_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_long=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_long=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5 echo "${ECHO_T}$ac_cv_type_long" >&6; } # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { echo "$as_me:$LINENO: checking size of long" >&5 echo $ECHO_N "checking size of long... $ECHO_C" >&6; } if test "${ac_cv_sizeof_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_long=$ac_lo;; '') if test "$ac_cv_type_long" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (long) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (long) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_long=0 fi ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long ac__type_sizeof_; static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%lu\n", i); } return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_long=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_long" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (long) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (long) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_long=0 fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 echo "${ECHO_T}$ac_cv_sizeof_long" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG $ac_cv_sizeof_long _ACEOF { echo "$as_me:$LINENO: checking for float" >&5 echo $ECHO_N "checking for float... $ECHO_C" >&6; } if test "${ac_cv_type_float+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef float ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_float=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_float=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_float" >&5 echo "${ECHO_T}$ac_cv_type_float" >&6; } # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { echo "$as_me:$LINENO: checking size of float" >&5 echo $ECHO_N "checking size of float... $ECHO_C" >&6; } if test "${ac_cv_sizeof_float+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef float ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef float ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef float ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef float ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef float ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_float=$ac_lo;; '') if test "$ac_cv_type_float" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (float) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (float) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_float=0 fi ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef float ac__type_sizeof_; static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%lu\n", i); } return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_float=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_float" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (float) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (float) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_float=0 fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { echo "$as_me:$LINENO: result: $ac_cv_sizeof_float" >&5 echo "${ECHO_T}$ac_cv_sizeof_float" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_FLOAT $ac_cv_sizeof_float _ACEOF { echo "$as_me:$LINENO: checking for double" >&5 echo $ECHO_N "checking for double... $ECHO_C" >&6; } if test "${ac_cv_type_double+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef double ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_double=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_double=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_double" >&5 echo "${ECHO_T}$ac_cv_type_double" >&6; } # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { echo "$as_me:$LINENO: checking size of double" >&5 echo $ECHO_N "checking size of double... $ECHO_C" >&6; } if test "${ac_cv_sizeof_double+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef double ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef double ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef double ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef double ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef double ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_double=$ac_lo;; '') if test "$ac_cv_type_double" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (double) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (double) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_double=0 fi ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef double ac__type_sizeof_; static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%lu\n", i); } return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_double=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_double" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (double) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (double) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_double=0 fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { echo "$as_me:$LINENO: result: $ac_cv_sizeof_double" >&5 echo "${ECHO_T}$ac_cv_sizeof_double" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_DOUBLE $ac_cv_sizeof_double _ACEOF { echo "$as_me:$LINENO: checking for long long" >&5 echo $ECHO_N "checking for long long... $ECHO_C" >&6; } if test "${ac_cv_type_long_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long long ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_long_long=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_long_long=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5 echo "${ECHO_T}$ac_cv_type_long_long" >&6; } if test $ac_cv_type_long_long = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LONG_LONG 1 _ACEOF fi { echo "$as_me:$LINENO: checking for long long" >&5 echo $ECHO_N "checking for long long... $ECHO_C" >&6; } if test "${ac_cv_type_long_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long long ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_long_long=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_long_long=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5 echo "${ECHO_T}$ac_cv_type_long_long" >&6; } # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { echo "$as_me:$LINENO: checking size of long long" >&5 echo $ECHO_N "checking size of long long... $ECHO_C" >&6; } if test "${ac_cv_sizeof_long_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long long ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long long ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long long ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long long ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long long ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_long_long=$ac_lo;; '') if test "$ac_cv_type_long_long" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (long long) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_long_long=0 fi ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long long ac__type_sizeof_; static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%lu\n", i); } return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_long_long=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_long_long" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (long long) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_long_long=0 fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_long" >&5 echo "${ECHO_T}$ac_cv_sizeof_long_long" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long _ACEOF # Check whether --enable-largefile was given. if test "${enable_largefile+set}" = set; then enableval=$enable_largefile; fi if test "$enable_largefile" != no; then { echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6; } if test "${ac_cv_sys_largefile_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_sys_largefile_CC=no if test "$GCC" != yes; then ac_save_CC=$CC while :; do # IRIX 6.2 and later do not support large files by default, # so use the C compiler's -n32 option if that helps. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext CC="$CC -n32" rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_sys_largefile_CC=' -n32'; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext break done CC=$ac_save_CC rm -f conftest.$ac_ext fi fi { echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6; } if test "$ac_cv_sys_largefile_CC" != no; then CC=$CC$ac_cv_sys_largefile_CC fi { echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6; } if test "${ac_cv_sys_file_offset_bits+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_sys_file_offset_bits=no; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define _FILE_OFFSET_BITS 64 #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_sys_file_offset_bits=64; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_sys_file_offset_bits=unknown break done fi { echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6; } case $ac_cv_sys_file_offset_bits in #( no | unknown) ;; *) cat >>confdefs.h <<_ACEOF #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits _ACEOF ;; esac rm -f conftest* if test $ac_cv_sys_file_offset_bits = unknown; then { echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6; } if test "${ac_cv_sys_large_files+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_sys_large_files=no; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define _LARGE_FILES 1 #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_sys_large_files=1; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_sys_large_files=unknown break done fi { echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5 echo "${ECHO_T}$ac_cv_sys_large_files" >&6; } case $ac_cv_sys_large_files in #( no | unknown) ;; *) cat >>confdefs.h <<_ACEOF #define _LARGE_FILES $ac_cv_sys_large_files _ACEOF ;; esac rm -f conftest* fi fi { echo "$as_me:$LINENO: checking for _LARGEFILE_SOURCE value needed for large files" >&5 echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6; } if test "${ac_cv_sys_largefile_source+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include /* for off_t */ #include int main () { int (*fp) (FILE *, off_t, int) = fseeko; return fseeko (stdin, 0, 0) && fp (stdin, 0, 0); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_sys_largefile_source=no; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define _LARGEFILE_SOURCE 1 #include /* for off_t */ #include int main () { int (*fp) (FILE *, off_t, int) = fseeko; return fseeko (stdin, 0, 0) && fp (stdin, 0, 0); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_sys_largefile_source=1; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext ac_cv_sys_largefile_source=unknown break done fi { echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_source" >&5 echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6; } case $ac_cv_sys_largefile_source in #( no | unknown) ;; *) cat >>confdefs.h <<_ACEOF #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source _ACEOF ;; esac rm -f conftest* # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug # in glibc 2.1.3, but that breaks too many other things. # If you want fseeko and ftello with glibc, upgrade to a fixed glibc. if test $ac_cv_sys_largefile_source != unknown; then cat >>confdefs.h <<\_ACEOF #define HAVE_FSEEKO 1 _ACEOF fi { echo "$as_me:$LINENO: checking for off_t" >&5 echo $ECHO_N "checking for off_t... $ECHO_C" >&6; } if test "${ac_cv_type_off_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef off_t ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_off_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_off_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 echo "${ECHO_T}$ac_cv_type_off_t" >&6; } if test $ac_cv_type_off_t = yes; then : else cat >>confdefs.h <<_ACEOF #define off_t long int _ACEOF fi { echo "$as_me:$LINENO: checking for off_t" >&5 echo $ECHO_N "checking for off_t... $ECHO_C" >&6; } if test "${ac_cv_type_off_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef off_t ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_off_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_off_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 echo "${ECHO_T}$ac_cv_type_off_t" >&6; } # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { echo "$as_me:$LINENO: checking size of off_t" >&5 echo $ECHO_N "checking size of off_t... $ECHO_C" >&6; } if test "${ac_cv_sizeof_off_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef off_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef off_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef off_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef off_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef off_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_off_t=$ac_lo;; '') if test "$ac_cv_type_off_t" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (off_t) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (off_t) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_off_t=0 fi ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef off_t ac__type_sizeof_; static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%lu\n", i); } return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_off_t=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_off_t" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (off_t) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (off_t) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_off_t=0 fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { echo "$as_me:$LINENO: result: $ac_cv_sizeof_off_t" >&5 echo "${ECHO_T}$ac_cv_sizeof_off_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_OFF_T $ac_cv_sizeof_off_t _ACEOF for ac_func in \ memset \ memcpy \ putenv \ getcwd \ mmap \ snprintf \ getpgrp tcgetpgrp \ do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done #--------------------------------------------------------------------------- # Set the source directory and object directory. The makefile assumes an # absolute path name. This is because src/Makefile cds to OBJDIR and compiles # the src file which is in SRCDIR #--------------------------------------------------------------------------- SRCDIR=$CONFIG_DIR if test "" != "." then if test -z "" then SRCDIR=$SRCDIR/src else SRCDIR=$SRCDIR/ fi fi OBJDIR=$SRCDIR/"$ARCH"objs ELFDIR=$SRCDIR/elf"$ARCH"objs { echo "$as_me:$LINENO: checking for Terminfo" >&5 echo $ECHO_N "checking for Terminfo... $ECHO_C" >&6; } MISC_TERMINFO_DIRS="$FINKPREFIX/share/terminfo" if test ! -d $MISC_TERMINFO_DIRS then MISC_TERMINFO_DIRS="" fi JD_Terminfo_Dirs="/usr/lib/terminfo \ /usr/share/terminfo \ /usr/share/lib/terminfo \ /usr/local/lib/terminfo \ $MISC_TERMINFO_DIRS" TERMCAP=-ltermcap for terminfo_dir in $JD_Terminfo_Dirs do if test -d $terminfo_dir then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } TERMCAP="" break fi done if test "$TERMCAP"; then { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } cat >>confdefs.h <<\_ACEOF #define USE_TERMCAP 1 _ACEOF fi if test "X$jd_prefix" = "X" then jd_prefix=$ac_default_prefix if test "X$prefix" != "XNONE" then jd_prefix="$prefix" fi jd_exec_prefix="$jd_prefix" if test "X$exec_prefix" != "XNONE" then jd_exec_prefix="$exec_prefix" fi eval `sh <&5 echo $ECHO_N "checking for the slang library and header files ... $ECHO_C" >&6; } jd_slang_include_dir="" jd_slang_library_dir="" jd_with_slang_library="" # Check whether --with-slang was given. if test "${with_slang+set}" = set; then withval=$with_slang; jd_with_slang_arg=$withval else jd_with_slang_arg=unspecified fi case "x$jd_with_slang_arg" in xno) jd_with_slang_library="no" ;; x) { { echo "$as_me:$LINENO: error: --with-slang requires a value-- try yes or no" >&5 echo "$as_me: error: --with-slang requires a value-- try yes or no" >&2;} { (exit 1); exit 1; }; } ;; xunspecified) ;; xyes) ;; *) jd_slang_include_dir="$jd_with_slang_arg"/include jd_slang_library_dir="$jd_with_slang_arg"/lib ;; esac # Check whether --with-slanglib was given. if test "${with_slanglib+set}" = set; then withval=$with_slanglib; jd_with_slanglib_arg=$withval else jd_with_slanglib_arg=unspecified fi case "x$jd_with_slanglib_arg" in xunspecified) ;; xno) ;; x) { { echo "$as_me:$LINENO: error: --with-slanglib requres a value" >&5 echo "$as_me: error: --with-slanglib requres a value" >&2;} { (exit 1); exit 1; }; } ;; *) jd_slang_library_dir="$jd_with_slanglib_arg" ;; esac # Check whether --with-slanginc was given. if test "${with_slanginc+set}" = set; then withval=$with_slanginc; jd_with_slanginc_arg=$withval else jd_with_slanginc_arg=unspecified fi case "x$jd_with_slanginc_arg" in x) { { echo "$as_me:$LINENO: error: --with-slanginc requres a value" >&5 echo "$as_me: error: --with-slanginc requres a value" >&2;} { (exit 1); exit 1; }; } ;; xunspecified) ;; xno) ;; *) jd_slang_include_dir="$jd_with_slanginc_arg" ;; esac if test X"$jd_with_slang_library" = X then jd_slang_inc_file= jd_with_slang_library="yes" if test "X$jd_slang_inc_file" = "X" then jd_slang_inc_file=slang.h fi if test X"$jd_slang_include_dir" = X then lib_include_dirs="\ $jd_prefix_incdir \ /usr/local/slang/include \ /usr/local/include/slang \ /usr/local/include \ /usr/include/slang \ /usr/slang/include \ /usr/include \ /opt/include/slang \ /opt/slang/include \ /opt/include" for X in $lib_include_dirs do if test -r "$X/$jd_slang_inc_file" then jd_slang_include_dir="$X" break fi done if test X"$jd_slang_include_dir" = X then jd_with_slang_library="no" fi fi if test X"$jd_slang_library_dir" = X then lib_library_dirs="\ $jd_prefix_libdir \ /usr/local/lib \ /usr/local/lib/slang \ /usr/local/slang/lib \ /usr/lib \ /usr/lib/slang \ /usr/slang/lib \ /opt/lib \ /opt/lib/slang \ /opt/slang/lib" case "$host_os" in *darwin* ) exts="dylib so a" ;; *cygwin* ) exts="dll.a so a" ;; * ) exts="so a" esac found=0 for X in $lib_library_dirs do for E in $exts do if test -r "$X/libslang.$E" then jd_slang_library_dir="$X" found=1 break fi done if test $found -eq 1 then break fi done if test X"$jd_slang_library_dir" = X then jd_with_slang_library="no" fi fi fi if test "$jd_with_slang_library" = "yes" then { echo "$as_me:$LINENO: result: yes: $jd_slang_library_dir and $jd_slang_include_dir" >&5 echo "${ECHO_T}yes: $jd_slang_library_dir and $jd_slang_include_dir" >&6; } SLANG_LIB=-L$jd_slang_library_dir if test "X$jd_slang_library_dir" = "X/usr/lib" then SLANG_LIB="" else if test "X$jd_slang_library_dir" != "X" then if test "X$RPATH" = "X" then case "$host_os" in *linux*|*solaris* ) if test "X$GCC" = Xyes then if test "X$ac_R_nospace" = "Xno" then RPATH="-Wl,-R," else RPATH="-Wl,-R" fi else if test "X$ac_R_nospace" = "Xno" then RPATH="-R " else RPATH="-R" fi fi ;; *osf*|*openbsd*) if test "X$GCC" = Xyes then RPATH="-Wl,-rpath," else RPATH="-rpath " fi ;; *netbsd*) if test "X$GCC" = Xyes then RPATH="-Wl,-R" fi ;; esac if test "X$RPATH" != "X" then RPATH="$RPATH$jd_slang_library_dir" fi else RPATH="$RPATH:$jd_slang_library_dir" fi fi fi SLANG_INC=-I$jd_slang_include_dir if test "X$jd_slang_include_dir" = "X/usr/include" then SLANG_INC="" fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } SLANG_INC="" SLANG_LIB="" fi if test "$jd_with_slang_library" = "no" then { { echo "$as_me:$LINENO: error: unable to find the slang library and header file $jd_slang_inc_file" >&5 echo "$as_me: error: unable to find the slang library and header file $jd_slang_inc_file" >&2;} { (exit 1); exit 1; }; } fi # Check whether --enable-warnings was given. if test "${enable_warnings+set}" = set; then enableval=$enable_warnings; gcc_warnings=$enableval fi if test -n "$GCC" then #CFLAGS="$CFLAGS -fno-strength-reduce" if test -n "$gcc_warnings" then CFLAGS="$CFLAGS -Wall -W -pedantic -Winline -Wmissing-prototypes \ -Wnested-externs -Wpointer-arith -Wcast-align -Wshadow -Wstrict-prototypes" # Now trim excess whitespace CFLAGS=`echo $CFLAGS` fi fi PROGRAM_HFILES="" PROGRAM_OFILES="" PROGRAM_CFILES="" PROGRAM_OBJECTS="" PROGRAM_ELFOBJECTS="" PROGRAM_OBJECT_RULES="" PROGRAM_ELF_ORULES="" if test -z "src/modules.lis" then Program_Modules="" else comment_re="^#" Program_Modules=`grep -v '$comment_re' src/modules.lis | awk '{print $1}'` Program_H_Modules=`grep -v '$comment_re' src/modules.lis | awk '{print $2}'` for program_module in $Program_H_Modules; do PROGRAM_HFILES="$PROGRAM_HFILES $program_module" done fi for program_module in $Program_Modules; do PROGRAM_OFILES="$PROGRAM_OFILES $program_module.o" PROGRAM_CFILES="$PROGRAM_CFILES $program_module.c" PROGRAM_OBJECTS="$PROGRAM_OBJECTS \$(OBJDIR)/$program_module.o" PROGRAM_ELFOBJECTS="$PROGRAM_ELFOBJECTS \$(ELFDIR)/$program_module.o" done for program_module in $Program_Modules; do PROGRAM_OBJECT_RULES="$PROGRAM_OBJECT_RULES \$(OBJDIR)/$program_module.o : \$(SRCDIR)/$program_module.c \$(DOT_O_DEPS) \$("$program_module"_O_DEP) cd \$(OBJDIR); \$(COMPILE_CMD) \$("$program_module"_C_FLAGS) \$(SRCDIR)/$program_module.c " PROGRAM_ELF_ORULES="$PROGRAM_ELF_ORULES \$(ELFDIR)/$program_module.o : \$(SRCDIR)/$program_module.c \$(DOT_O_DEPS) \$("$program_module"_O_DEP) cd \$(ELFDIR); \$(ELFCOMPILE_CMD) \$("$program_module"_C_FLAGS) \$(SRCDIR)/$program_module.c " done ac_config_headers="$ac_config_headers src/sysconf.h:src/config.hin" ac_config_files="$ac_config_files Makefile:autoconf/Makefile.in src/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # 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. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { echo "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header { echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "src/sysconf.h") CONFIG_HEADERS="$CONFIG_HEADERS src/sysconf.h:src/config.hin" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile:autoconf/Makefile.in" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF RPATH!$RPATH$ac_delim SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim CONFIG_DIR!$CONFIG_DIR$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim CPPFLAGS!$CPPFLAGS$ac_delim ac_ct_CC!$ac_ct_CC$ac_delim EXEEXT!$EXEEXT$ac_delim OBJEXT!$OBJEXT$ac_delim CPP!$CPP$ac_delim GREP!$GREP$ac_delim EGREP!$EGREP$ac_delim SET_MAKE!$SET_MAKE$ac_delim INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim INSTALL_DATA!$INSTALL_DATA$ac_delim build!$build$ac_delim build_cpu!$build_cpu$ac_delim build_vendor!$build_vendor$ac_delim build_os!$build_os$ac_delim host!$host$ac_delim host_cpu!$host_cpu$ac_delim host_vendor!$host_vendor$ac_delim host_os!$host_os$ac_delim DYNAMIC_LINK_LIB!$DYNAMIC_LINK_LIB$ac_delim ELF_CC!$ELF_CC$ac_delim ELF_CFLAGS!$ELF_CFLAGS$ac_delim ELF_LINK!$ELF_LINK$ac_delim ELF_LINK_CMD!$ELF_LINK_CMD$ac_delim ELF_DEP_LIBS!$ELF_DEP_LIBS$ac_delim DYNAMIC_LINK_FLAGS!$DYNAMIC_LINK_FLAGS$ac_delim CC_SHARED!$CC_SHARED$ac_delim ELFLIB!$ELFLIB$ac_delim ELFLIB_MAJOR!$ELFLIB_MAJOR$ac_delim ELFLIB_MAJOR_MINOR!$ELFLIB_MAJOR_MINOR$ac_delim ELFLIB_MAJOR_MINOR_MICRO!$ELFLIB_MAJOR_MINOR_MICRO$ac_delim SLANG_LIB_FOR_MODULES!$SLANG_LIB_FOR_MODULES$ac_delim DLL_IMPLIB_NAME!$DLL_IMPLIB_NAME$ac_delim INSTALL_MODULE!$INSTALL_MODULE$ac_delim INSTALL_ELFLIB_TARGET!$INSTALL_ELFLIB_TARGET$ac_delim ELFLIB_BUILD_NAME!$ELFLIB_BUILD_NAME$ac_delim SLANG_DLL_CFLAGS!$SLANG_DLL_CFLAGS$ac_delim XMKMF!$XMKMF$ac_delim X_CFLAGS!$X_CFLAGS$ac_delim X_PRE_LIBS!$X_PRE_LIBS$ac_delim X_LIBS!$X_LIBS$ac_delim X_EXTRA_LIBS!$X_EXTRA_LIBS$ac_delim SRCDIR!$SRCDIR$ac_delim OBJDIR!$OBJDIR$ac_delim ELFDIR!$ELFDIR$ac_delim TERMCAP!$TERMCAP$ac_delim MISC_TERMINFO_DIRS!$MISC_TERMINFO_DIRS$ac_delim SLANG_LIB!$SLANG_LIB$ac_delim SLANG_INC!$SLANG_INC$ac_delim PROGRAM_OFILES!$PROGRAM_OFILES$ac_delim PROGRAM_CFILES!$PROGRAM_CFILES$ac_delim PROGRAM_HFILES!$PROGRAM_HFILES$ac_delim PROGRAM_OBJECTS!$PROGRAM_OBJECTS$ac_delim PROGRAM_ELFOBJECTS!$PROGRAM_ELFOBJECTS$ac_delim LIBOBJS!$LIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF CEOF$ac_eof _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 1; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$ac_file_inputs $ac_f" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input="Generated from "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` { as_dir="$ac_dir" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; :H) # # CONFIG_HEADER # _ACEOF # Transform confdefs.h into a sed script `conftest.defines', that # substitutes the proper values into config.h.in to produce config.h. rm -f conftest.defines conftest.tail # First, append a space to every undef/define line, to ease matching. echo 's/$/ /' >conftest.defines # Then, protect against being on the right side of a sed subst, or in # an unquoted here document, in config.status. If some macros were # called several times there might be several #defines for the same # symbol, which is useless. But do not sort them, since the last # AC_DEFINE must be honored. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* # These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where # NAME is the cpp macro being defined, VALUE is the value it is being given. # PARAMS is the parameter list in the macro definition--in most cases, it's # just an empty string. ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' ac_dB='\\)[ (].*,\\1define\\2' ac_dC=' ' ac_dD=' ,' uniq confdefs.h | sed -n ' t rset :rset s/^[ ]*#[ ]*define[ ][ ]*// t ok d :ok s/[\\&,]/\\&/g s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p ' >>conftest.defines # Remove the space that was appended to ease matching. # Then replace #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. # (The regexp can be short, since the line contains either #define or #undef.) echo 's/ $// s,^[ #]*u.*,/* & */,' >>conftest.defines # Break up conftest.defines: ac_max_sed_lines=50 # First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" # Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" # Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" # et cetera. ac_in='$ac_file_inputs' ac_out='"$tmp/out1"' ac_nxt='"$tmp/out2"' while : do # Write a here document: cat >>$CONFIG_STATUS <<_ACEOF # First, check the format of the line: cat >"\$tmp/defines.sed" <<\\CEOF /^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def /^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def b :def _ACEOF sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail grep . conftest.tail >/dev/null || break rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines conftest.tail echo "ac_result=$ac_in" >>$CONFIG_STATUS cat >>$CONFIG_STATUS <<\_ACEOF if test x"$ac_file" != x-; then echo "/* $configure_input */" >"$tmp/config.h" cat "$ac_result" >>"$tmp/config.h" if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else rm -f $ac_file mv "$tmp/config.h" $ac_file fi else echo "/* $configure_input */" cat "$ac_result" fi rm -f "$tmp/out12" ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi PROGRAM_OBJECT_RULES="$PROGRAM_OBJECT_RULES \$(OBJDIR)/chkslang.o : \$(SRCDIR)/chkslang.c \$(DOT_O_DEPS) \$("chkslang"_O_DEP) cd \$(OBJDIR); \$(COMPILE_CMD) \$("chkslang"_C_FLAGS) \$(SRCDIR)/chkslang.c " echo "$PROGRAM_OBJECT_RULES" >> src/Makefile most-5.0.0a/most.10000644002657400265740000003446510630436657012755 0ustar davisdavis.\"-------------------------------------------------------------------- .\" UX - UNIX macro, to append \(rg to the first usage .\"-------------------------------------------------------------------- .de UX .ie \\n(UX \s-1UNIX\s0\\$1 .el \{\s-1UNIX\s0\\$1\*(Rg . nr UX 1 .\} .. .\"-------------------------------------------------------------------- .\" Ds - start indented display .\" De - end indented display .\"-------------------------------------------------------------------- .de Ds .nf 'in +0.5i .. .de De 'in .fi .. .TH MOST 1 "May 1999" .SH NAME most \- browse or page through a text file .SH SYNOPSIS .B most .RB [ \-1bCcdMstuvwz ] .RB [ +\fIlineno\fB ] .RB [ +c ] .RB [ +d ] .RB [ +s ] .RB [ +u ] .RB [ +/\fIstring\fB ] .RI [ filename ...] .SH DESCRIPTION .I most is a paging program that displays, one windowful at a time, the contents of a file on a terminal. It pauses after each windowful and prints on the window status line the screen the file name, current line number, and the percentage of the file so far displayed. .PP Unlike other paging programs, .I most is capable of displaying an arbitrary number of windows as long as each window occupies at least two screen lines. Each window may contain the same file or a different file. In addition, each window has its own mode. For example, one window may display a file with its lines wrapped while another may be truncating the lines. Windows may be `locked' together in the sense that if one of the locked windows scrolls, all locked windows will scroll. .I most is also capable of ignoring lines that are indented beyond a user specified value. This is useful when viewing computer programs to pick out gross features of the code. See the .RB ` :o ' command for a description of this feature. .PP In addition to displaying ordinary text files, .I most can also display binary files as well as files with arbitrary ascii characters. When a file is read into a buffer, .I most examines the first 32 bytes of the file to determine if the file is a binary file and then switches to the appropriate mode. However, this feature may be disabled with the .B \-k option. See the description of the .BR \-b , .BR \-k , .BR \-v , and .B \-t options for further details. .PP Text files may contain combinations of underscore and backspace characters causing a printer to underline or overstrike. When .I most recognizes this, it inserts the appropriate escape sequences to achieve the desired effect. In addition, some files cause the printer to overstrike some characters by embedding carriage return characters in the middle of a line. When this occurs, .I most displays the overstruck character with a bold attribute. This feature facilitates the reading of .UX man pages or a document produced by .IR runoff . In particular, viewing this document with .I most should illustrate this behavior provided that the underline characters have not been stripped. This may be turned off with the .B \-v option. .PP By default, lines with more characters than the terminal width are not wrapped but are instead truncated. When truncation occurs, this is indicated by a `$' in the far right column of the terminal screen. The RIGHT and LEFT arrow keys may be used to view lines which extend past the margins of the screen. The .B \-w option may be used to override this feature. When a window is wrapped, the character `\e' will appear at the right edge of the window. .PP Commands are listed below. .SH OPTIONS .TP .B \-1 VT100 mode. This is meaningful only on VMS systems. This option should be used if the terminal is strictly a VT100. This implies that the terminal does not have the ability to delete and insert multiple lines. VT102s and above have this ability. .TP .B \-b Binary mode. Use this switch when you want to view files containing 8 bit characters. .I most will display the file 16 bytes per line in hexadecimal notation. A typical line looks like: .IP .Ds 01000000 40001575 9C23A020 4000168D ....@..u.#. @... .De .IP When used with the .B \-v option, the same line looks like: .IP .Ds ^A^@^@^@ @^@^U u 9C #A0 @^@^V8D ....@..u.#. @... .De .\".TP .\".B \-k .\"`Kanji' option. .\"Ordinarily, .\".I most .\"will go into binary mode if the file consists of non-ascii characters. .\"Sometimes this feature is not desirable since some .\"terminals have a special interpretation for eight bit .\"characters. .\"The .\".B \-k .\"option turns off the automatic sensing. .TP .B \-C Disable color support. .TP .B \-d Omit the backslash mark used to denote a wrapped line. .TP .B \-M Disable the use of mmap. .TP .B \-s Squeeze. Replace multiple blank lines with a single blank line. .TP .B \-z option turns off gunzip-on-the-fly. .TP .B \-v Display control characters as in `^A' for control A. Normally .I most does not interpret control characters. .TP .B \-t Display tabs as `^I'. This option is meaningful only when used with the .B \-v option. .TP .BI + lineno Start up at .IR lineno . .TP .B \-c Make searches case sensitive. By default, they are not. .TP .B \-u Disable UTF-8 mode even if the locale dictates it. .TP .B +u Force UTF-8 mode. By default most will use the current locale to determine if UTF-8 mode shoul be used. The .B +u and .B \-u switches allow the behavior to be overridden. .TP .B +d This switch should only be used if you want the option to delete a file while viewing it. This makes it easier to clean unwanted files out of a directory. The file is deleted with the interactive key sequence .RB ` :D ' and then confirming with .RB ` y '. .TP .BI +/ string Start up at the line containing the first occurrence of .IR string . .SH "COMMAND USAGE" The commands take effect immediately; it is not necessary to type a carriage return. .PP In the following commands, .I i is a numerical argument (1 by default). .TP .BR SPACE ", " CTRL-D ", " NEXT_SCREEN Display another windowful, or jump .I i windowfuls if .I i is specified. .TP \fBRETURN\fR, \fBDOWN_ARROW\fR, \fBV\fR, \fBCTRL-N\fR Display another line, or .I i more lines, if specified. .TP .BR UP_ARROW ", " ^ ", " CTRL-P Display previous line, or .I i previous lines, if specified. .TP .BR T ", " ESCAPE < Move to top of buffer. .TP .BR B ", " ESCAPE > Move to bottom of buffer. .TP .BR RIGHT_ARROW ", " TAB ", " > Scroll window left .RI 60 i columns to view lines that are beyond the right margin of the window. .TP .BR LEFT_ARROW ", " CTRL-B ", " < Scroll window right .RI 60 i columns to view lines that are beyond the left margin of the window. .TP \fBU\fR, \fBCTRL-U\fR, \fBDELETE\fR, \fBPREV_SCREEN\fR Skip back .I i windowfuls and then print a windowful. .TP .BR R ", " CTRL-R Redraw the window. .TP .BR J ", " G If .I i is not specified, then prompt for a line number then jump to that line otherwise just jump to line .IR i . .TP .B % If .I i is not specified, then prompt for a percent number then jump to that percent of the file otherwise just jump to .I i percent of the file. .TP .BR W ", " w If the current screen width is 80, make it 132 and vice-versa. For other values, this command is ignored. .TP \fBQ\fR, \fBCTRL-X CTRL-C\fR, \fBCTRL-K E\fR Exit from .IR most . On VMS, ^Z also exits. .TP .BR h ", " CTRL-H ", " HELP ", " PF2 Help. Give a description of all the .I most commands. The .I most environment variable .B MOST_HELP must be set for this to be meaningful. .TP \fBf\fR, \fB/\fR, \fBCTRL-F\fR, \fBFIND\fR, \fBGOLD PF3\fR Prompt for a string and search forward from the current line for .IR i th distinct line containing the string. .B CTRL-G aborts. .TP .B ? Prompt for a string and search backward for the .IR i th distinct line containing the string. .B CTRL-G aborts. .TP .B n Search for the next .I i lines containing an occurrence of the last search string in the direction of the previous search. .\"------- .\" The '@' causes problems when included in a paragraph tag .\" in my system's -man macro set, so jump though some hoops to .\" avoid doing this. .\"------- .PP \fBm\fR, \fBSELECT\fR, \fBCTRL-@\fR, \fBCTRL-K M\fR, \fBPERIOD\fR .PD 0 .IP .PD Set a mark on the current line for later reference. .TP .BR "INSERT_HERE, CTRL-X CTRL-X, COMMA, CTRL-K RETURN, GOLD PERIOD" Set a mark on the current line but return to previous mark. This allows the user to toggle back and forth between two positions in the file. .TP .BR l ", " L Toggle locking for this window. The window is locked if there is a `*' at the left edge of the status line. Windows locked together, scroll together. .TP .BR "CTRL-X 2" ", " "CTRL-W 2" ", " "GOLD X" Split this window in half. .TP .BR "CTRL-X o" ", " "CTRL-W o" ", " o ", " GOLD UP ", " GOLD DOWN Move to other window. .TP .BR "CTRL-X 0" ", " "CTRL-W 0" ", " "GOLD V" Delete this window. .TP .BR "CTRL-X 1" ", " "CTRL-W 1" ", " "GOLD O" Delete all other windows, leaving only one window. .TP .BR E ", " e Edit this file. .TP .BR $ ", " "ESC $" This is system dependent. On VMS, this causes .I most to spawn a subprocess. When the user exits the process, .I most is resumed. On .UX systems, .I most simply suspends itself. .TP .B :n Skip to the next filename given in the command line. Use the arrow keys to scroll forward or backward through the file list. .RB ` Q ' quits .I most and any other key selects the given file. .TP .B :c Toggle case sensitive search. .TP .B :D Delete current file. This command is only meaningful with the .B +d switch. .TP .BR :o ", " :O Toggle various options. With this key sequence, .I most displays a prompt asking the user to hit one of: .BR bdtvw . The .RB ` b ', .RB ` t ', .RB ` v ', and .RB ` w ' options have the same meaning as the command line switches. For example, the .RB ` w ' option will toggle wrapping on and off for the current window. .IP The .RB ` d ' option must be used with a prefix integer .IR i . All lines indented beyond .I i columns will not be displayed. For example, consider the fragment: .IP .Ds .ne 11 int main(int argc, char **argv) { int i; for (i = 0; i < argc, i++) { fprintf(stdout,"%i: %s\en",i,argv[i]); } return 0; } .De .IP The key sequence .RB ` 1:od ' will cause .I most to display the file ignoring all lines indented beyond the first column. So for the example above, .I most would display: .IP .Ds .ne 2 int main(int argc, char **argv)... } .De .IP where the `...' indicates lines follow are not displayed. .SH HINTS .B CTRL-G aborts the commands requiring the user to type something in at a prompt. The backquote key has a special meaning here. It is used to quote certain characters. This is useful when search for the occurrence of a string with a control character or a string at the beginning of a line. In the latter case, to find the occurrence of `The' at the beginning of a line, enter .B `^JThe where .B ` quotes the .BR CTRL-J . .SH ENVIRONMENT .I most uses the following environment variables: .TP .B MOST_SWITCHES This variable sets commonly used switches. For example, some people prefer to use .I most with the .B \-s option so that excess blank lines are not displayed. On VMS this is normally done done in the login.com through the line: .IP .Ds $ define MOST_SWITCHES "-s" .De .TP .BR MOST_EDITOR ", " SLANG_EDITOR Either of these environment variables specify an editor for .I most to invoke to edit a file. The value can contain %s and %d formatting descriptors that represent the file name and line number, respectively. For example, if JED is your editor, then set .B MOST_EDITOR to 'jed %s -g %d'. .TP .B MOST_HELP This variable may be used to specify an alternate help file. .TP .B MOST_INITFILE Set this variable to specify the initialization file to load during startup. The default action is to load the system configuration file and then a personal configuration file called .I .mostrc on Unix, and .I most.rc on other systems. .SH CONFIGURATION FILE SYNTAX When most starts up, it tries to read a system configuration file and then a personal configuration file. These files may be used to specify keybindings and colors. .PP To bind a key to a particular function use the syntax: .PP .B setkey function-name key-sequence .PP The .I setkey command requires two arguments. The .I function-name argument specifies the function that is to be executed as a response to the keys specified by the .I key-sequence argument are pressed. For example, .PP setkey "up" "^P" .PP indicates that when .I Ctrl-P is pressed then the function .I up is to be executed. .PP Sometimes, it is necessary to first unbind a key-sequence before rebinding it in order via the .I unsetkey function: .PP unsetkey "^F" .PP Colors may be defined through the use of the .I color keyword in the the configuration file using the syntax: .PP .B color OBJECT-NAME FOREGROUND-COLOR BACKGROUND-COLOR .PP Here, OBJECT-NAME can be any one of the following items: .nf status -- the status line underline -- underlined text overstrike -- overstriked text normal -- anything else .fi See the sample configuration files for more information. .SH BUGS Almost all of the known bugs or limitations of .I most are due to a desire to read and interpret control characters in files. One problem concerns the use of backspace characters to underscore or overstrike other characters. .I most makes an attempt to use terminal escape sequences to simulate this behavior. One side effect is the one does not always get what one expects when scrolling right and left through a file. When in doubt, use the .B \-v and .B \-b options of .IR most . .PP .SH AUTHOR John E. Davis .br davis@space.mit.edu .SH ACKNOWLEDGEMENTS I would like to thank the users of .I most for valuable comments and criticisms. I would especially like to thank those individuals who have contributed code to .IR most. .PP Mats Akerberg, Henk D. Davids, Rex O. Livingston, and Mark Pizzolato contributed to the early VMS versions of .IR most. In particular, Mark worked on it to get it ready for DECUS. .PP Foteos Macrides adapted .IR most for use in .IR cswing and .IR gopher. A few features of the present version of .IR most was inspired from his work. .PP I am grateful to Robert Mills for re-writing the search routines to use regular expressions. .PP Sven Oliver Moll came up with the idea of automatic detection of zipped files. .PP I would also like to thank Shinichi Hama for his valuable criticisms of .IR most. .PP Javier Kohen was instrumental in the support for UTF-8. .PP Thanks to David W. Sanderson (dws@cs.wisc.edu) for adapting the documentation to nroff man page source format. most-5.0.0a/most.hlp0000644002657400265740000003317710425445274013374 0ustar davisdavis1 MOST browse or page through a text file 2 Synopsis most [-Cbstvwz] [+lineno] [+c] [+d] [+/string] [filename...] 2 Description most is a paging program that displays, one windowful at a time, the contents of a file on a terminal. It pauses after each windowful and prints on the window status line the screen the file name, current line number, and the percentage of the file so far displayed. Unlike other paging programs, most is capable of displaying an arbitrary number of windows as long as each window occupies at least two screen lines. Each window may contain the same file or a different file. In addition, each window has its own mode. For example, one window may display a file with its lines wrapped while another may be truncating the lines. Windows may be `locked' together in the sense that if one of the locked windows scrolls, all locked windows will scroll. most is also capable of ignoring lines that are indented beyond a user specified value. This is useful when viewing computer programs to pick out gross features of the code. See the `:o' command for a description of this feature. In addition to displaying ordinary text files, most can also display binary files as well as files with arbitrary ascii characters. When a file is read into a buffer, most examines the first 32 bytes of the file to determine if the file is a binary file and then switches to the appropriate mode. However, this feature may be disabled with the -k option. See the description of the -b, -k, -v, and -t options for further details. Text files may contain combinations of underscore and backspace characters causing a printer to underline or overstrike. When most recognizes this, it inserts the appropriate escape sequences to achieve the desired effect. In addition, some files cause the printer to overstrike some characters by embedding carriage return characters in the middle of a line. When this occurs, most displays the overstruck character with a bold attribute. This feature facilitates the reading of UNIX man pages or a document produced by runoff. In particular, viewing this document with most should illustrate this behavior provided that the underline characters have not been stripped. This may be turned off with the -v option. By default, lines with more characters than the terminal width are not wrapped but are instead truncated. When truncation occurs, this is indicated by a `$' in the far right column of the terminal screen. The RIGHT and LEFT arrow keys may be used to view lines which extend past the margins of the screen. The -w option may be used to override this feature. When a window is wrapped, the character `\' will appear at the right edge of the window. Commands are listed below. 2 Options -1 VT100 mode. This is meaningful only on VMS systems. This option should be used if the terminal is strictly a VT100. This implies that the terminal does not have the ability to delete and insert multiple lines. VT102s and above have this ability. -b Binary mode. Use this switch when you want to view files containing 8 bit characters. most will display the file 16 bytes per line in hexidecimal notation. A typical line looks like: 01000000 40001575 9C23A020 4000168D ....@..u.#. @... When used with the -v option, the same line looks like: ^A^@^@^@ @^@^U u 9C #A0 @^@^V8D ....@..u.#. @... -k `Kanji' option. Ordinarily, most will go into binary mode if the file consists of non-ascii characters. Sometimes this feature is not desirable since some terminals have a special interpretation for eight bit characters. The -k option turns off the automatic sensing. -C Disable color support. -s Squeeze. Replace multiple blank lines with a single blank line. -z option turns off gunzip-on-the-fly. -v Display control characters as in `^A' for control A. Normally most does not interpret control characters. -t Display tabs as `^I'. This option is meaningful only when used with the -v option. +lineno Start up at lineno. +c Make search case sensitive. By default, they are not. +d This switch should only be used if you want the option to delete a file while viewing it. This makes it easier to clean unwanted files out of a directory. The file is deleted with the interactive key sequence `:D' and then confirming with `y'. +/string Start up at the line containing the first occurrence of string. 2 Command_usage The commands take effect immediately; it is not necessary to type a carriage return. In the following commands, i is a numerical argument (1 by default). SPACE, CTRL-D, NEXT_SCREEN Display another windowful, or jump i windowfuls if i is specified. RETURN, DOWN_ARROW, V, CTRL-N Display another line, or i more lines, if specified. UP_ARROW, ^, CTRL-P Display previous line, or i previous lines, if specified. T, ESCAPE< Move to top of buffer. B, ESCAPE> Move to bottom of buffer. RIGHT_ARROW, TAB, > Scroll window left 60i columns to view lines that are beyond the right margin of the window. LEFT_ARROW, CTRL-B, < Scroll window right 60i columns to view lines that are beyond the left margin of the window. U, CTRL-U, DELETE, PREV_SCREEN Skip back i windowfuls and then print a windowful. R, CTRL-R Redraw the window. J, G If i is not specified, then prompt for a line number then jump to that line otherwise just jump to line i. % If i is not specified, then prompt for a percent number then jump to that percent of the file otherwise just jump to i percent of the file. W, w If the current screen width is 80, make it 132 and vice-versa. For other values, this command is ignored. Q, CTRL-X CTRL-C, CTRL-K E Exit from most. On VMS, ^Z also exits. h, CTRL-H, HELP, Help. Give a description of all the most commands. The most environment variable MOST_HELP must be set for this to be meaningful. f, /, CTRL-F, FIND, GOLD PF3 Prompt for a string and search forward from the current line for ith distinct line containing the string. CTRL-G aborts. ? Prompt for a string and search backward for the ith distinct line containing the string. CTRL-G aborts. n Search for the next i lines containing an occurrence of the last search string in the direction of the previous search. m, SELECT, CTRL-@, CTRL-K M, PERIOD Set a mark on the current line for later reference. INSERT_HERE, CTRL-X CTRL-X, COMMA, CTRL-K RETURN, GOLD PERIOD Set a mark on the current line but return to previous mark. This allows the user to toggle back and forth between two positions in the file. l, L Toggle locking for this window. The window is locked if there is a `*' at the left edge of the status line. Windows locked together, scroll together. CTRL-X 2, CTRL-W 2, GOLD X Split this window in half. CTRL-X o, CTRL-W o, o, Move to other window. CTRL-X 0, CTRL-W 0, GOLD V Delete this window. CTRL-X 1, CTRL-W 1, GOLD O Delete all other windows, leaving only one window. E, e Edit this file. $, ESC $ This is system dependent. On VMS, this causes most to spawn a subprocess. When the user exits the process, most is resumed. On UNIX systems, most simply suspends itself. :n Skip to the next filename given in the command line. Use the arrow keys to scroll forward or backward through the file list. `Q' quits most and any other key selects the given file. :c Toggle case sensitive search. :D Delete current file. This command is only meaningful with the +d switch. :o, :O Toggle various options. With this key sequence, most displays a prompt asking the user to hit one of: bdtvw. The `b', `t', `v', and `w' options have the same meaning as the command line switches. For example, the `w' option will toggle wrapping on and off for the current window. The `d' option must be used with a prefix integer i. All lines indented beyond i columns will not be displayed. For example, consider the fragment: int main(int argc, char **argv) { int i; for (i = 0; i < argc, i++) { fprintf(stdout,"%i: %s\n",i,argv[i]); } return 0; } The key sequence `1:od' will cause most to display the file ignoring all lines indented beyond the first column. So for the example above, most would display: int main(int argc, char **argv)... } where the `...' indicates lines follow are not displayed. 2 Hints CTRL-G aborts the commands requiring the user to type something in at a prompt. The backquote key has a special meaning here. It is used to quote certain characters. This is useful when search for the occurrence of a string with a control character or a string at the beginning of a line. In the latter case, to find the occurrence of `The' at the beginning of a line, enter `^JThe where ` quotes the CTRL-J. 2 Environment most uses the following environment variables: MOST_SWITCHES This variable sets commonly used switches. For example, some people prefer to use most with the -s option so that excess blank lines are not displayed. On VMS this is normally done done in the login.com through the line: $ define MOST_SWITCHES "-s" MOST_EDITOR, SLANG_EDITOR Either of these environment variables specify an editor for most to invoke to edit a file. The value can contain %s and %d formatting descriptors that represent the file name and line number, respectively. For example, if JED is your editor, then set MOST_EDITOR to 'jed %s -g %d'. MOST_HELP This variable may be used to specify an alternate help file. MOST_INITFILE Set this variable to specify the initialization file to load during startup. The default action is to load the system configuration file and then a personal configuration file called .mostrc on Unix, and most.rc on other systems. 2 Configuration_file_syntax When most starts up, it tries to read a system confiuration file and then a personal configuration file. These files may be used to specify keybind ings and colors. To bind a key to a particular function use the syntax: setkey function-name key-sequence The setkey command requires two arguments. The function-name argument specifies the function that is to be executed as a response to the keys specified by the key-sequence argument are pressed. For example, setkey "up" "^P" indicates that when Ctrl-P is pressed then the function up is to be executed. Sometimes, it is necessary to first unbind a key-sequence before rebinding it in order via the unsetkey function: unsetkey "^F" Colors may be defined through the use of the color keyword in the the configuration file using the syntax: color OBJECT-NAME FOREGROUND-COLOR BACKGROUND-COLOR Here, OBJECT-NAME can be any one of the following items: status -- the status line underline -- underlined text overstrike -- overstriked text normal -- anything else See the sample configuration files for more information. 2 Bugs Almost all of the known bugs or limitations of most are due to a desire to read and interpret control characters in files. One problem concerns the use of backspace characters to underscore or overstrike other characters. most makes an attempt to use terminal escape sequences to simulate this behavior. One side effect is the one does not always get what one expects when scrolling right and left through a file. When in doubt, use the -v and -b options of most. 2 Author John E. Davis davis@space.mit.edu 2 Acknowledgements I would like to thank the users of most for valuable comments and criticisms. I would especially like to thank those individuals who have contributed code to most. Mats Akerberg, Henk D. Davids, Rex O. Livingston, and Mark Pizzolato contributed to the early VMS versions of most. In particular, Mark worked on it to get it ready for DECUS. Foteos Macrides adapted most for use in cswing and gopher. A few features of the present version of most was inspired from his work. I am grateful to Robert Mills for re-writing the search routines to use regular expressions. Sven Oliver Moll came up with the idea of automatic detection of zipped files. I would also like to thank Shinichi Hama for his valuable criticisms of most. Thanks to David W. Sanderson (dws@cs.wisc.edu) for adapting the documentation to nroff man page source format. most-5.0.0a/lesskeys.rc0000644002657400265740000000255210425445274014066 0ustar davisdavis% This is an example configuration file that provides a `less' emulation % for MOST. % % The format is simple: % setkey % unsetkey % color % % Here must be enclosed in double quotes. '^' represents Ctrl. % The function name is not in double quotes. % % % When MOST starts up, it looks for a keymap file given by the environment % variable MOST_INITFILE. If that environment variable does not exist, % MOST will look in the users HOME directory for .mostrc on Unix systems % and MOST.RC on VMS systems. % % The file `most.rc' contains a listing of the default MOST keybindings. % Color settings color normal lightgray black color status yellow blue color underline brightgreen black color overstrike brightred black % Keybindings unsetkey "^K" setkey up "^K" unsetkey ":" setkey next_file ":n" setkey find_file ":e" setkey next_file ":p" setkey toggle_options ":o" setkey toggle_case ":c" setkey delete_file ":d" setkey exit ":q" setkey down "e" setkey down "E" setkey down "j" setkey down "^N" setkey up "y" setkey up "^Y" setkey up "k" setkey up "^P" setkey page_down "f" setkey page_down "^F" setkey page_up "b" setkey page_up "^B" setkey other_window "z" setkey other_window "w" setkey search_backward "?" setkey bob "p" setkey goto_mark "'" setkey find_file "E" setkey edit "v" most-5.0.0a/most.rc0000644002657400265740000000601610425445274013205 0ustar davisdavis% Color settings color normal lightgray black color status yellow blue color underline brightgreen black color overstrike brightred black % Keybindings %setkey digit_arg dig %setkey digit_arg esc dig %setkey digit_arg gold dig %setkey column_left < Not Set > %setkey column_right < Not Set > setkey page_down " " setkey suspend "$" setkey goto_percent "%" setkey goto_mark "," setkey search_forward "/" setkey extended_key ":" setkey page_left "<" setkey page_right ">" setkey search_backward "?" setkey eob "B" setkey page_down "D" setkey edit "E" setkey search_forward "F" setkey goto_line "G" setkey help "H" setkey goto_line "J" setkey toggle_lock "L" setkey set_mark "M" setkey find_next "N" setkey other_window "O" setkey exit "Q" setkey redraw "R" setkey search_forward "S" setkey bob "T" setkey page_up "U" setkey down "V" setkey toggle_width "W" setkey exit "X" setkey suspend "\033$" setkey bob "\033<" setkey eob "\033>" setkey up "\033OA" setkey down "\033OB" setkey page_right "\033OC" setkey page_left "\033OD" setkey exit "\033OPE" setkey one_window "\033OPO" setkey exit "\033OPQ" setkey suspend "\033OPS" setkey delete_window "\033OPV" setkey two_windows "\033OPX" setkey edt_find "\033OP\033OR" setkey goto_mark "\033OP\033On" setkey eob "\033OP\033Ot" setkey bob "\033OP\033Ou" setkey other_window "\033OP\033[A" setkey other_window "\033OP\033[B" setkey page_right "\033OP\033[C" setkey page_left "\033OP\033[D" setkey help "\033OQ" setkey edt_find_next "\033OR" setkey set_mark "\033On" setkey edt_line "\033Op" setkey edt_forward "\033Ot" setkey edt_backward "\033Ou" setkey edt_page "\033Ox" setkey page_up "\033V" setkey search_forward "\033[1~" setkey goto_mark "\033[2~" setkey help "\033[28~" setkey set_mark "\033[4~" setkey page_up "\033[5~" setkey page_down "\033[6~" setkey up "\033[A" setkey down "\033[B" setkey page_right "\033[C" setkey page_left "\033[D" setkey page_right "\t" setkey up "^" setkey page_up "^?" setkey set_mark "^@" setkey page_down "^D" setkey search_forward "^F" setkey help "^H" setkey exit "^KE" setkey find_file "^KG" setkey set_mark "^K^B" setkey goto_mark "^K^J" setkey goto_mark "^K^M" setkey redraw "^L" setkey down "^M" setkey down "^N" setkey up "^P" setkey redraw "^R" setkey show_time "^T" setkey page_up "^U" setkey page_down "^V" setkey delete_window "^W0" setkey one_window "^W1" setkey two_windows "^W2" setkey other_window "^WO" setkey delete_window "^X0" setkey one_window "^X1" setkey two_windows "^X2" setkey other_window "^XO" setkey exit "^X^C" setkey find_file "^X^F" setkey suspend "^Z" setkey eob "b" setkey page_down "d" setkey edit "e" setkey search_forward "f" setkey goto_line "g" setkey goto_line "j" setkey toggle_lock "l" setkey set_mark "m" setkey find_next "n" setkey other_window "o" setkey exit "q" setkey redraw "r" setkey search_forward "s" setkey bob "t" setkey down "v" setkey toggle_width "w" setkey exit "x" most-5.0.0a/changes.txt0000644002657400265740000001420210671015731014034 0ustar davisdavisChanges since 5.0.0 1. src/Makefile.in: Install docs in $prefix/share/doc Changes since 4.10.2 0. src/most.c: version bumped to 5.0.0-x 1. src/line.c: Added support for embedded ANSI escape sequences that seem to be more common in man pages. 2. When switching searching directions, and no search string was entered at the search prompt, use the previous string. 3. Added patches for UTF-8 support kindly provided by Javier Kohen. 4. src/most.c: Removed references to Kanji from the usage message. Kanji is not supported by slang-2. Use Unicode. 5. src/file.c: Most will automatically start up in binary mode if the file contains a nul-byte in the first 512 characters. Previously, it would switch into binary mode when the file contained any characters with the most significant bit set. 6. autoconf/config.sub,config.guess: Updated to more recent versions. 7. src/most.c: Add +u/-u switches to force UTF-8 on/off. The default behavior depends upon the locale. 8. src/sysdep.c: In most_getkey, if SLang_getkey returns an error, then just exit. 9. src/search.c: Added `#undef SLANG_REGEXP' and `#undef HAVE_V8_REGCOMP' until the regexp searches are rewritten. 10. src/edit.c: Filenames are quoted before being passed to the shell for editing. 11. src/file.c: Filenames are quoted before being passed to the unzip program. 12. src/sysdep.c: Check the process group id of the terminal and if it does not match that of most, then exit. 13. src/keym.c: Added "find_next_other_dir" function and bound it to N. 14. src/most.c: New commandline switch: "-d". This switch disables the display of the \ character used to denote a wrapped line. 15. src/line.c: Added support for embedded ansi-color escape sequences, e.g., `ls --color | most` 16. src/window.c: Added an error hook to prevent slang from writing to stderr. 17. src/line.c: An ascii character+combining character was not being handled. Changes since 4.10.1 1. src/window.c:most_read_from_minibuffer: An variable was not being initialized. (Kevin Oberman, oberman at es, net). 2. configure: mmap is enabled by default. Use the --disable-mmap configure option of you do not want it. Changes since 4.10.0 1. src/most.h: Prototype for SLang_set_error inconsistent with the function in most.c. 2. src/most.h: If compiled against slang2 without an snprintf function, use _pSLsnprintf. Changes since 4.9.5 0. src/*.c: Various changes to support slang 2. Version bumped to 4.10.0. UTF-8 support not yet available. 1. src/keym.c: Ignore mouse events under DOS/Windows (Gisle Vanem, giva at bgnett, no). Changes since 4.9.4 1. src/line.c: A "length" variable was declared as unsigned char instead of unsigned int, causing a SEGV for columns larger than 255. 2. src/file.c: fixed a buffer overflow caused by a long file name on the command line. Changes since 4.9.3 1. src/buffer.c: SLtt_Screen_Rows and SLtt_Screen_Cols were swapped causing a file to be improperly displayed in wrap mode. Adrian P. van Bloois (adrian at accu.uu.nlhas) has my thanks for find this bug. 2. src/most.c: when run without arguments, S-Lang library version also printed. Changes since 4.9.2 1. src/keym.c: added support for \xE0 type arrow keys (Win9X). 2. src/file.c: When resyncing mmaped buffer, make sure to preserve the current line number. 3. src/sysdep.c: SLang_getkey_intr_hook is unix specific and should not be used on VMS. 4. src/file.c: Make arrow-keys for next_file_cmd work on win32 systems. 5. src/file.h: be sure to quote filename argument (Mako Hill ) 6. src/file.c: added support for bzip2 files 7. src/*.c: replace calls to sprintf with _SLsnprintf (Steve Kemp ). Changes since 4.9.1 0. Added support for using mmap to read files. Use configure --enable-mmap to enable this experimental feature. 1. Wrapping bug fixed. Also some optimizations were made to speed up the display of wrapped files. 2. File default.rc renamed to most.rc. 3. A^H_ interpreted as underline. Previously, _^HA was recognized. 4. Jerome Lauret provided most.hlp, as well as a few VMS patches. 5. src/Makefile.in: patch to make most's Makefile respect DESTDIR as well as removing the hardcoded use of $(prefix)/etc for the location of most's config file. 6. src/line.c: some simplifications and cleanups designed to avoid nasty problems with extremely long lines. Changes since 4.9.0 1. MOST_SWITCHES env variable can now contain extended switches. 2. If most is reading from stdin, it will reinit the terminal when it encounters an EOF on stdin. This is to work around a problem under linux where for some reason, some other process resets the terminal. Changes since 4.8.1 1. Apparantly, the binary flag +b is not valid with POSIX popen. 2. Screen resize code modified so that most works in a SunOS cmdtool. 3. Color support added. Use `most -C' to disable. 4. Ported to Mingw32 (GNU C) Changes since 4.7 1. Added tail -f type mode. Use F to activate. 2. OS/2 port provided by j.burnell@irl.cri.nz (John Burnell). 3. Left/Right arrow scroll 1 column. Use <, > to scroll in larger chunks. Changes since 4.6 0. Various cleanups and other improvements 1. Binary mode displays byte offset 2. Ported to DJGPP Changes since 4.5 1. Many changes to enable MOST use the S-Lang screen management routines. Features in 4.5 1. More cleanup/bug fixes 2. Regular expression searches 3. Automatic detection of compressed files. Features in 4.41: 1. Modified to read raw directry file in BINARY mode. New features in MOST 4.4: 1. User definable keymaps 2. ISO Latin1 8 bit clean 3. Edit and recall previous search strings 4. Much friendlier, lots of messages and help 5. VMS ``Gopher ready'' 6. Cleaned up alot and small bugs fixed 7. Most now re-reads the file after editing. New Features since MOST version 3.x (Sept 25, 1994) 1. Terminfo/termcap under Unix supported 2. -1 flag specifies terminal is a VT100 and not anything better, e.g., VT102. (VMS only) 3. MOST will only read in what it has to. This means it starts up alot faster on large files. 4. Cleaned up alot. John E. Davis davis@space.mit.edu most-5.0.0a/most-fun.txt0000644002657400265740000000075410425445274014211 0ustar davisdavisThe following functions may be used in custom keymaps: edit suspend toggle_lock next_file toggle_options extended_key toggle_case delete_file bob delete_window digit_arg down edt_backward edt_find edt_find_next edt_forward edt_line edt_page eob exit find_file find_next goto_line goto_mark goto_percent help one_window other_window page_down page_left page_right column_right column_left page_up redraw search_backward search_forward set_mark show_time tail_mode toggle_width two_windows up most-5.0.0a/most.doc0000644002657400265740000004156210426526130013343 0ustar davisdavisMOST(1) MOST(1) NAME most - browse or page through a text file SYNOPSIS most [-1bCcMstuvwz] [+lineno] [+c] [+d] [+s] [+u] [+/string] [file- name...] DESCRIPTION most is a paging program that displays, one windowful at a time, the contents of a file on a terminal. It pauses after each windowful and prints on the window status line the screen the file name, current line number, and the percentage of the file so far displayed. Unlike other paging programs, most is capable of displaying an arbi- trary number of windows as long as each window occupies at least two screen lines. Each window may contain the same file or a different file. In addition, each window has its own mode. For example, one window may display a file with its lines wrapped while another may be truncating the lines. Windows may be `locked' together in the sense that if one of the locked windows scrolls, all locked windows will scroll. most is also capable of ignoring lines that are indented beyond a user specified value. This is useful when viewing computer programs to pick out gross features of the code. See the `:o' command for a description of this feature. In addition to displaying ordinary text files, most can also display binary files as well as files with arbitrary ascii characters. When a file is read into a buffer, most examines the first 32 bytes of the file to determine if the file is a binary file and then switches to the appropriate mode. However, this feature may be disabled with the -k option. See the description of the -b, -k, -v, and -t options for fur- ther details. Text files may contain combinations of underscore and backspace charac- ters causing a printer to underline or overstrike. When most recog- nizes this, it inserts the appropriate escape sequences to achieve the desired effect. In addition, some files cause the printer to over- strike some characters by embedding carriage return characters in the middle of a line. When this occurs, most displays the overstruck char- acter with a bold attribute. This feature facilitates the reading of UNIX man pages or a document produced by runoff. In particular, view- ing this document with most should illustrate this behavior provided that the underline characters have not been stripped. This may be turned off with the -v option. By default, lines with more characters than the terminal width are not wrapped but are instead truncated. When truncation occurs, this is indicated by a `$' in the far right column of the terminal screen. The RIGHT and LEFT arrow keys may be used to view lines which extend past the margins of the screen. The -w option may be used to override this feature. When a window is wrapped, the character `\' will appear at the right edge of the window. Commands are listed below. OPTIONS -1 VT100 mode. This is meaningful only on VMS systems. This option should be used if the terminal is strictly a VT100. This implies that the terminal does not have the ability to delete and insert multiple lines. VT102s and above have this ability. -b Binary mode. Use this switch when you want to view files con- taining 8 bit characters. most will display the file 16 bytes per line in hexadecimal notation. A typical line looks like: 01000000 40001575 9C23A020 4000168D ....@..u.#. @... When used with the -v option, the same line looks like: ^A^@^@^@ @^@^U u 9C #A0 @^@^V8D ....@..u.#. @... -C Disable color support. -M Disable the use of mmap. -s Squeeze. Replace multiple blank lines with a single blank line. -z option turns off gunzip-on-the-fly. -v Display control characters as in `^A' for control A. Normally most does not interpret control characters. -t Display tabs as `^I'. This option is meaningful only when used with the -v option. +lineno Start up at lineno. -c Make searches case sensitive. By default, they are not. -u Disable UTF-8 mode even if the locale dictates it. +u Force UTF-8 mode. By default most will use the current locale to determine if UTF-8 mode shoul be used. The +u and -u switches allow the behavior to be overridden. +d This switch should only be used if you want the option to delete a file while viewing it. This makes it easier to clean unwanted files out of a directory. The file is deleted with the interac- tive key sequence `:D' and then confirming with `y'. +/string Start up at the line containing the first occurrence of string. COMMAND USAGE The commands take effect immediately; it is not necessary to type a carriage return. In the following commands, i is a numerical argument (1 by default). SPACE, CTRL-D, NEXT_SCREEN Display another windowful, or jump i windowfuls if i is speci- fied. RETURN, DOWN_ARROW, V, CTRL-N Display another line, or i more lines, if specified. UP_ARROW, ^, CTRL-P Display previous line, or i previous lines, if specified. T, ESCAPE< Move to top of buffer. B, ESCAPE> Move to bottom of buffer. RIGHT_ARROW, TAB, > Scroll window left 60i columns to view lines that are beyond the right margin of the window. LEFT_ARROW, CTRL-B, < Scroll window right 60i columns to view lines that are beyond the left margin of the window. U, CTRL-U, DELETE, PREV_SCREEN Skip back i windowfuls and then print a windowful. R, CTRL-R Redraw the window. J, G If i is not specified, then prompt for a line number then jump to that line otherwise just jump to line i. % If i is not specified, then prompt for a percent number then jump to that percent of the file otherwise just jump to i per- cent of the file. W, w If the current screen width is 80, make it 132 and vice-versa. For other values, this command is ignored. Q, CTRL-X CTRL-C, CTRL-K E Exit from most. On VMS, ^Z also exits. h, CTRL-H, HELP, PF2 Help. Give a description of all the most commands. The most environment variable MOST_HELP must be set for this to be mean- ingful. f, /, CTRL-F, FIND, GOLD PF3 Prompt for a string and search forward from the current line for ith distinct line containing the string. CTRL-G aborts. ? Prompt for a string and search backward for the ith distinct line containing the string. CTRL-G aborts. n Search for the next i lines containing an occurrence of the last search string in the direction of the previous search. m, SELECT, CTRL-@, CTRL-K M, PERIOD Set a mark on the current line for later reference. INSERT_HERE, CTRL-X CTRL-X, COMMA, CTRL-K RETURN, GOLD PERIOD Set a mark on the current line but return to previous mark. This allows the user to toggle back and forth between two posi- tions in the file. l, L Toggle locking for this window. The window is locked if there is a `*' at the left edge of the status line. Windows locked together, scroll together. CTRL-X 2, CTRL-W 2, GOLD X Split this window in half. CTRL-X o, CTRL-W o, o, GOLDUP, GOLDDOWN Move to other window. CTRL-X 0, CTRL-W 0, GOLD V Delete this window. CTRL-X 1, CTRL-W 1, GOLD O Delete all other windows, leaving only one window. E, e Edit this file. $, ESC $ This is system dependent. On VMS, this causes most to spawn a subprocess. When the user exits the process, most is resumed. On UNIX systems, most simply suspends itself. :n Skip to the next filename given in the command line. Use the arrow keys to scroll forward or backward through the file list. `Q' quits most and any other key selects the given file. :c Toggle case sensitive search. :D Delete current file. This command is only meaningful with the +d switch. :o, :O Toggle various options. With this key sequence, most displays a prompt asking the user to hit one of: bdtvw. The `b', `t', `v', and `w' options have the same meaning as the command line switches. For example, the `w' option will toggle wrapping on and off for the current window. The `d' option must be used with a prefix integer i. All lines indented beyond i columns will not be displayed. For example, consider the fragment: int main(int argc, char **argv) { int i; for (i = 0; i < argc, i++) { fprintf(stdout,"%i: %s\n",i,argv[i]); } return 0; } The key sequence `1:od' will cause most to display the file ignoring all lines indented beyond the first column. So for the example above, most would display: int main(int argc, char **argv)... } where the `...' indicates lines follow are not displayed. HINTS CTRL-G aborts the commands requiring the user to type something in at a prompt. The backquote key has a special meaning here. It is used to quote certain characters. This is useful when search for the occur- rence of a string with a control character or a string at the beginning of a line. In the latter case, to find the occurrence of `The' at the beginning of a line, enter `^JThe where ` quotes the CTRL-J. ENVIRONMENT most uses the following environment variables: MOST_SWITCHES This variable sets commonly used switches. For example, some people prefer to use most with the -s option so that excess blank lines are not displayed. On VMS this is normally done done in the login.com through the line: $ define MOST_SWITCHES "-s" MOST_EDITOR, SLANG_EDITOR Either of these environment variables specify an editor for most to invoke to edit a file. The value can contain %s and %d for- matting descriptors that represent the file name and line num- ber, respectively. For example, if JED is your editor, then set MOST_EDITOR to 'jed %s -g %d'. MOST_HELP This variable may be used to specify an alternate help file. MOST_INITFILE Set this variable to specify the initialization file to load during startup. The default action is to load the system con- figuration file and then a personal configuration file called .mostrc on Unix, and most.rc on other systems. CONFIGURATION FILE SYNTAX When most starts up, it tries to read a system configuration file and then a personal configuration file. These files may be used to specify keybindings and colors. To bind a key to a particular function use the syntax: setkey function-name key-sequence The setkey command requires two arguments. The function-name argument specifies the function that is to be executed as a response to the keys specified by the key-sequence argument are pressed. For example, setkey "up" "^P" indicates that when Ctrl-P is pressed then the function up is to be executed. Sometimes, it is necessary to first unbind a key-sequence before rebinding it in order via the unsetkey function: unsetkey "^F" Colors may be defined through the use of the color keyword in the the configuration file using the syntax: color OBJECT-NAME FOREGROUND-COLOR BACKGROUND-COLOR Here, OBJECT-NAME can be any one of the following items: status -- the status line underline -- underlined text overstrike -- overstriked text normal -- anything else See the sample configuration files for more information. BUGS Almost all of the known bugs or limitations of most are due to a desire to read and interpret control characters in files. One problem con- cerns the use of backspace characters to underscore or overstrike other characters. most makes an attempt to use terminal escape sequences to simulate this behavior. One side effect is the one does not always get what one expects when scrolling right and left through a file. When in doubt, use the -v and -b options of most. AUTHOR John E. Davis davis@space.mit.edu ACKNOWLEDGEMENTS I would like to thank the users of most for valuable comments and crit- icisms. I would especially like to thank those individuals who have contributed code to most. Mats Akerberg, Henk D. Davids, Rex O. Livingston, and Mark Pizzolato contributed to the early VMS versions of most. In particular, Mark worked on it to get it ready for DECUS. Foteos Macrides adapted most for use in cswing and gopher. A few features of the present version of most was inspired from his work. I am grateful to Robert Mills for re-writing the search routines to use regular expressions. Sven Oliver Moll came up with the idea of automatic detection of zipped files. I would also like to thank Shinichi Hama for his valuable criticisms of most. Javier Kohen was instrumental in the support for UTF-8. Thanks to David W. Sanderson (dws@cs.wisc.edu) for adapting the docu- mentation to nroff man page source format. May 1999 MOST(1) most-5.0.0a/COPYRIGHT0000644002657400265740000000137610606342424013166 0ustar davisdavis This file is part of MOST. Copyright (c) 1991, 1999, 2002, 2005, 2006, 2007 John E. Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. most-5.0.0a/COPYING0000644002657400265740000004307010425445274012731 0ustar davisdavis GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. most-5.0.0a/autoconf/0000755002657400265740000000000010671016030013473 5ustar davisdavismost-5.0.0a/autoconf/install.sh0000755002657400265740000001273610425445274015526 0ustar davisdavis#!/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. It can only install one file at a time, a restriction # shared with many OS's install programs. # 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=: chmodcmd="" 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 most-5.0.0a/autoconf/Makefile.in0000644002657400265740000000162110426040636015547 0ustar davisdavis# -*- sh -*- #This is a UNIX-only makefile. @SET_MAKE@ SHELL = /bin/sh all: cd src; $(MAKE) all clean: /bin/rm -f *~ cd src; $(MAKE) clean # distclean: /bin/rm -f *~ Makefile config.status config.log config.cache files.pck cd src; $(MAKE) distclean # install: cd src; $(MAKE) install # # The symlinks target is for my own private use. It simply creates the object # directory as a symbolic link to a local disk instead of an NFS mounted one. symlinks: cd src; $(MAKE) symlinks configure: autoconf/aclocal.m4 autoconf/configure.ac cd autoconf && autoconf && mv ./configure .. update: autoconf/config.sub autoconf/config.guess autoconf/config.guess: /usr/share/misc/config.guess /bin/cp -f /usr/share/misc/config.guess autoconf/config.guess autoconf/config.sub: /usr/share/misc/config.sub /bin/cp -f /usr/share/misc/config.sub autoconf/config.sub .PHONY: all clean distclean install symlinks update most-5.0.0a/autoconf/configure.ac0000644002657400265740000000242010670010673015765 0ustar davisdavisdnl -*- sh -*- AC_INIT(src/most.c) JD_INIT JD_ANSI_CC AC_CONFIG_AUX_DIR(autoconf) AC_PROG_MAKE_SET AC_PROG_INSTALL AC_CANONICAL_HOST JD_ELF_COMPILER # determine X include and needed libs AC_PATH_XTRA # Implementation of the --disable-dev-random switch. AC_MSG_CHECKING([if you want to use mmap if available]) AC_ARG_ENABLE(mmap, AC_HELP_STRING([--disable-mmap],[disable the use of mmap]), jd_use_mmap=$enableval, jd_use_mmap=yes) AC_MSG_RESULT($jd_use_mmap) case "x$jd_use_mmap" in xyes ) AC_DEFINE(USE_MMAP) ;; esac #Check these header since they cause trouble AC_CHECK_HEADERS( \ stdlib.h \ unistd.h \ memory.h \ malloc.h \ termios.h \ sys/mman.h \ ) AC_HEADER_DIRENT AC_TYPE_MODE_T AC_TYPE_PID_T AC_TYPE_UID_T AC_TYPE_SIZE_T AC_CHECK_SIZEOF(short, 2) AC_CHECK_SIZEOF(int, 4) AC_CHECK_SIZEOF(long, 4) AC_CHECK_SIZEOF(float, 4) AC_CHECK_SIZEOF(double, 8) JD_CHECK_LONG_LONG JD_LARGE_FILE_SUPPORT AC_CHECK_FUNCS(\ memset \ memcpy \ putenv \ getcwd \ mmap \ snprintf \ getpgrp tcgetpgrp \ ) JD_SET_OBJ_SRC_DIR JD_TERMCAP JD_WITH_LIBRARY(slang) JD_GCC_WARNINGS JD_GET_MODULES(src/modules.lis) JD_CREATE_MODULE_ORULES AC_CONFIG_HEADER(src/sysconf.h:src/config.hin) AC_OUTPUT(Makefile:autoconf/Makefile.in src/Makefile) JD_CREATE_ORULE(chkslang) JD_APPEND_RULES(src/Makefile) most-5.0.0a/autoconf/mkinsdir.sh0000755002657400265740000000113610425445274015670 0ustar davisdavis#! /bin/sh # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman # Created: 1993-05-16 # Public domain errstatus=0 for file do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= for d in ${1+"$@"} ; do pathcomp="$pathcomp$d" case "$pathcomp" in -* ) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" 1>&2 mkdir "$pathcomp" || errstatus=$? fi pathcomp="$pathcomp/" done done exit $errstatus # mkinstalldirs ends here most-5.0.0a/autoconf/config.guess0000755002657400265740000012546610426040636016040 0ustar davisdavis#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. timestamp='2005-04-22' # 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. # Originally written by Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # 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 build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/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 # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit 0 ;; amd64:OpenBSD:*:*) echo x86_64-unknown-openbsd${UNAME_RELEASE} exit 0 ;; amiga:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; cats:OpenBSD:*:*) echo arm-unknown-openbsd${UNAME_RELEASE} exit 0 ;; hp300:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; luna88k:OpenBSD:*:*) echo m88k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mac68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; macppc:OpenBSD:*:*) echo powerpc-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 ;; mvmeppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sgi:OpenBSD:*:*) echo mips64-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sun3:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; *:OpenBSD:*:*) echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} exit 0 ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit 0 ;; macppc:MirBSD:*:*) echo powerppc-unknown-mirbsd${UNAME_RELEASE} exit 0 ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit 0 ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit 0 ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit 0 ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit 0 ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit 0;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit 0 ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit 0 ;; *:OS/390:*:*) echo i370-ibm-openedition exit 0 ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit 0 ;; *:OS400:*:*) echo powerpc-ibm-os400 exit 0 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit 0;; SR2?01:HI-UX/MPP:*:* | SR8000: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 ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit 0 ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7 && exit 0 ;; esac ;; 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=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) 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 ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit 0 ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit 0 ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit 0 ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit 0 ;; powerpc:machten:*:*) echo powerpc-apple-machten${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:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit 0 ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c \ && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ && exit 0 echo mips-mips-riscos${UNAME_RELEASE} exit 0 ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit 0 ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit 0 ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax 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 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${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 ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit 0 ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 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:*:[45]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${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 BSD 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:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then # avoid double evaluation of $set_cc_for_build test -n "$CC_FOR_BUILD" || eval $set_cc_for_build if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit 0 ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit 0 ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 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 ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix 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*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 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/ \ -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit 0 ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit 0 ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit 0 ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:FreeBSD:*:*) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit 0 ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit 0 ;; i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit 0 ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit 0 ;; x86:Interix*:[34]*) echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' exit 0 ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit 0 ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit 0 ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit 0 ;; amd64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit 0 ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit 0 ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit 0 ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit 0 ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit 0 ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit 0 ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu exit 0 ;; frv:Linux:*:*) echo frv-unknown-linux-gnu exit 0 ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips #undef mipsel #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mipsel #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 ;; mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips64 #undef mips64el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mips64el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips64 #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit 0 ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit 0 ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit 0 ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit 0 ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit 0 ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit 0 ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit 0 ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. # Set LC_ALL=C to ensure ld outputs messages in English. ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit 0 ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit 0 ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit 0 ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 LIBC=gnu # else LIBC=gnulibc1 # endif # else LIBC=gnulibc1 # endif #else #ifdef __INTEL_COMPILER LIBC=gnu #else LIBC=gnuaout #endif #endif #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit 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:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit 0 ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit 0 ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit 0 ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit 0 ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit 0 ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit 0 ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit 0 ;; i*86:*:5:[78]*) case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} 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|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit 0 ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming 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 ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit 0 ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit 0 ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4.3${OS_REL} && exit 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.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit 0 ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit 0 ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit 0 ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit 0 ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 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:*: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 ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit 0 ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit 0 ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit 0 ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit 0 ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000: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 ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit 0 ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit 0 ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit 0 ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in *86) UNAME_PROCESSOR=i686 ;; unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit 0 ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit 0 ;; *:QNX:*:4*) echo i386-pc-qnx exit 0 ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit 0 ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit 0 ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit 0 ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit 0 ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit 0 ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit 0 ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit 0 ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit 0 ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit 0 ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit 0 ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit 0 ;; *:ITS:*:*) echo pdp10-unknown-its exit 0 ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit 0 ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit 0 ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms && exit 0 ;; I*) echo ia64-dec-vms && exit 0 ;; V*) echo vax-dec-vms && exit 0 ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix 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 eval $set_cc_for_build 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`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else 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_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0 # 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 cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: most-5.0.0a/autoconf/aclocal.m40000644002657400265740000006162210670007035015346 0ustar davisdavisdnl# -*- mode: sh; mode: fold -*- dnl# 0.2.1: Add .dll.a to list of extensions to when searching for libs (cygwin) dnl# 0.2.0: Added install target name and more fixes for cygwin dnl# 0.1.12: Improved support for cygwin dnl# 0.1.11: Fixed elf linking on freebsd (Renato Botelho (garga at freebsd, org) dnl# Version 0.1.10: rpath support for netbsd dnl# Version 0.1.9: When searching for libs, use dylib on darwin dnl# Version 0.1.8: Add rpath support for OpenBSD dnl# Version 0.1.7: removed "-K pic" from IRIX compiler lines dnl# Version 0.1.6: Added cygwin module support dnl# Version 0.1.5: Added gcc version-script support. dnl# AC_DEFUN(JD_INIT, dnl#{{{ [ #These variable are initialized by JD init function CONFIG_DIR=`pwd` cd $srcdir if test "`pwd`" != "$CONFIG_DIR" then AC_MSG_ERROR("This software does not support configuring from another directory. See the INSTALL file") fi dnl# if test "X$PWD" != "X" dnl# then dnl# CONFIG_DIR="$PWD" dnl# fi AC_SUBST(CONFIG_DIR)dnl # Note: these will differ if one is a symbolic link if test -f /usr/bin/dirname; then JD_Above_Dir=`dirname $CONFIG_DIR` else # system is a loser JD_Above_Dir=`cd ..;pwd` fi JD_Above_Dir2=`cd ..;pwd` ]) dnl#}}} dnl# This function expand the "prefix variables. For example, it will expand dnl# values such as ${exec_prefix}/foo when ${exec_prefix} itself has a dnl# of ${prefix}. This function produces the shell variables: dnl# jd_prefix_libdir, jd_prefix_incdir AC_DEFUN(JD_EXPAND_PREFIX, dnl#{{{ [ if test "X$jd_prefix" = "X" then jd_prefix=$ac_default_prefix if test "X$prefix" != "XNONE" then jd_prefix="$prefix" fi jd_exec_prefix="$jd_prefix" if test "X$exec_prefix" != "XNONE" then jd_exec_prefix="$exec_prefix" fi dnl#Unfortunately, exec_prefix may have a value like ${prefix}, etc. dnl#Let the shell expand those. Yuk. eval `sh <>)dnl define(<<$2>>, translit($1, [a-z], [A-Z]))dnl changequote([, ])dnl ]) #}}} AC_DEFUN(JD_SIMPLE_LIB_DIR, dnl#{{{ [ JD_UPPERCASE($1,JD_UP_NAME) JD_UP_NAME[]_LIB_DIR=$JD_Above_Dir/$1/libsrc/"$ARCH"objs JD_UP_NAME[]_INCLUDE=$JD_Above_Dir/$1/libsrc if test ! -d "[$]JD_UP_NAME[]_INCLUDE" then JD_UP_NAME[]_LIB_DIR=$JD_Above_Dir/$1/src/"$ARCH"objs JD_UP_NAME[]_INCLUDE=$JD_Above_Dir/$1/src if test ! -d "[$]JD_UP_NAME[]_INCLUDE" then echo "" echo WARNING------Unable to find the JD_UP_NAME directory echo You may have to edit $CONFIG_DIR/src/Makefile. echo "" fi fi AC_SUBST(JD_UP_NAME[]_LIB_DIR)dnl AC_SUBST(JD_UP_NAME[]_INCLUDE)dnl undefine([JD_UP_NAME])dnl ]) dnl#}}} AC_DEFUN(JD_FIND_GENERIC, dnl#{{{ [ AC_REQUIRE([JD_EXPAND_PREFIX])dnl changequote(<<, >>)dnl define(<>, translit($1, [a-z], [A-Z]))dnl changequote([, ])dnl # Look for the JD_UP_NAME package #JD_UP_NAME[]_INCLUDE="" #JD_UP_NAME[]_LIB_DIR="" # This list consists of "include,lib include,lib ..." JD_Search_Dirs="$JD_Above_Dir2/$1/libsrc,$JD_Above_Dir2/$1/libsrc/"$ARCH"objs \ $JD_Above_Dir/$1/libsrc,$JD_Above_Dir/$1/libsrc/"$ARCH"objs \ $JD_Above_Dir2/$1/src,$JD_Above_Dir2/$1/src/"$ARCH"objs \ $JD_Above_Dir/$1/src,$JD_Above_Dir/$1/src/"$ARCH"objs" JD_Search_Dirs="$JD_Search_Dirs \ $jd_prefix_incdir,$jd_prefix_libdir \ $HOME/include,$HOME/lib" if test -n "$ARCH" then JD_Search_Dirs="$JD_Search_Dirs $HOME/include,$HOME/$ARCH/lib" JD_Search_Dirs="$JD_Search_Dirs $HOME/include,$HOME/sys/$ARCH/lib" fi # Now add the standard system includes. The reason for doing this is that # the other directories may have a better chance of containing a more recent # version. JD_Search_Dirs="$JD_Search_Dirs \ /usr/local/include,/usr/local/lib \ /usr/include,/usr/lib \ /usr/include/$1,/usr/lib \ /usr/include/$1,/usr/lib/$1" echo looking for the JD_UP_NAME library for include_and_lib in $JD_Search_Dirs do # Yuk. Is there a better way to set these variables?? generic_include=`echo $include_and_lib | tr ',' ' ' | awk '{print [$]1}'` generic_lib=`echo $include_and_lib | tr ',' ' ' | awk '{print [$]2}'` echo Looking for $1.h in $generic_include echo and lib$1.a in $generic_lib if test -r $generic_include/$1.h && test -r $generic_lib/lib$1.a then echo Found it. JD_UP_NAME[]_LIB_DIR="$generic_lib" JD_UP_NAME[]_INCLUDE="$generic_include" break else if test -r $generic_include/$1.h && test -r $generic_lib/lib$1.so then echo Found it. JD_UP_NAME[]_LIB_DIR="$generic_lib" JD_UP_NAME[]_INCLUDE="$generic_include" break fi fi done if test -n "[$]JD_UP_NAME[]_LIB_DIR" then jd_have_$1="yes" else echo Unable to find the $JD_UP_NAME library. echo You may have to edit $CONFIG_DIR/src/Makefile. JD_UP_NAME[]_INCLUDE=$JD_Above_Dir/$1/src JD_UP_NAME[]_LIB_DIR=$JD_Above_Dir/$1/src/"$ARCH"objs jd_have_$1="no" fi JD_UP_NAME[]_INC="-I[$]JD_UP_NAME[]_INCLUDE" JD_UP_NAME[]_LIB="-L[$]JD_UP_NAME[]_LIB_DIR" JD_SET_RPATH([$]JD_UP_NAME[]_LIB_DIR) dnl if test "X$GCC" = Xyes dnl then dnl RPATH_[]JD_UP_NAME="-Wl,-R[$]JD_UP_NAME[]_LIB_DIR" dnl else dnl RPATH_[]JD_UP_NAME="-R[$]JD_UP_NAME[]_LIB_DIR" dnl fi # gcc under solaris is often not installed correctly. Avoid specifying # -I/usr/include. if test "[$]JD_UP_NAME[]_INC" = "-I/usr/include" then JD_UP_NAME[]_INC="" fi if test "[$]JD_UP_NAME[]_LIB" = "-L/usr/lib" then JD_UP_NAME[]_LIB="" RPATH_[]JD_UP_NAME="" fi AC_SUBST(JD_UP_NAME[]_LIB)dnl AC_SUBST(JD_UP_NAME[]_INC)dnl AC_SUBST(JD_UP_NAME[]_LIB_DIR)dnl AC_SUBST(JD_UP_NAME[]_INCLUDE)dnl dnl AC_SUBST(RPATH_[]JD_UP_NAME)dnl undefine([JD_UP_NAME])dnl ]) dnl#}}} AC_DEFUN(JD_FIND_SLANG, dnl#{{{ [ JD_FIND_GENERIC(slang) ]) dnl#}}} AC_DEFUN(JD_GCC_WARNINGS, dnl#{{{ [ AC_ARG_ENABLE(warnings, [ --enable-warnings turn on GCC compiler warnings], [gcc_warnings=$enableval]) if test -n "$GCC" then #CFLAGS="$CFLAGS -fno-strength-reduce" if test -n "$gcc_warnings" then CFLAGS="$CFLAGS -Wall -W -pedantic -Winline -Wmissing-prototypes \ -Wnested-externs -Wpointer-arith -Wcast-align -Wshadow -Wstrict-prototypes" # Now trim excess whitespace CFLAGS=`echo $CFLAGS` fi fi ]) dnl#}}} IEEE_CFLAGS="" AC_DEFUN(JD_IEEE_CFLAGS, dnl#{{{ [ case "$host_cpu" in *alpha* ) if test "$GCC" = yes then IEEE_CFLAGS="-mieee" else IEEE_CFLAGS="-ieee_with_no_inexact" fi ;; * ) IEEE_CFLAGS="" esac ]) dnl#}}} AC_DEFUN(JD_CREATE_ORULE, dnl#{{{ [ PROGRAM_OBJECT_RULES="$PROGRAM_OBJECT_RULES \$(OBJDIR)/$1.o : \$(SRCDIR)/$1.c \$(DOT_O_DEPS) \$("$1"_O_DEP) cd \$(OBJDIR); \$(COMPILE_CMD) \$("$1"_C_FLAGS) \$(SRCDIR)/$1.c " ]) dnl#}}} AC_DEFUN(JD_CREATE_ELFORULE, dnl#{{{ [ PROGRAM_ELF_ORULES="$PROGRAM_ELF_ORULES \$(ELFDIR)/$1.o : \$(SRCDIR)/$1.c \$(DOT_O_DEPS) \$("$1"_O_DEP) cd \$(ELFDIR); \$(ELFCOMPILE_CMD) \$("$1"_C_FLAGS) \$(SRCDIR)/$1.c " ]) dnl#}}} AC_DEFUN(JD_CREATE_EXEC_RULE, dnl#{{{ [ PROGRAM_OBJECT_RULES="$PROGRAM_OBJECT_RULES $1 : \$(OBJDIR)/$1 @echo $1 created in \$(OBJDIR) \$(OBJDIR)/$1 : \$(OBJDIR)/$1.o \$("$1"_DEPS) \$(EXECDEPS) \$(CC) -o \$(OBJDIR)/$1 \$(LDFLAGS) \$(OBJDIR)/$1.o \$("$1"_LIBS) \$(EXECLIBS) \$(OBJDIR)/$1.o : \$(SRCDIR)/$1.c \$(DOT_O_DEPS) \$("$1"_O_DEP) cd \$(OBJDIR); \$(COMPILE_CMD) \$("$1"_INC) \$(EXECINC) \$(SRCDIR)/$1.c " ]) dnl#}}} AC_DEFUN(JD_CREATE_MODULE_ORULES, dnl#{{{ [ for program_module in $Program_Modules; do JD_CREATE_ORULE($program_module) JD_CREATE_ELFORULE($program_module) done ]) dnl#}}} AC_DEFUN(JD_GET_MODULES, dnl#{{{ [ PROGRAM_HFILES="" PROGRAM_OFILES="" PROGRAM_CFILES="" PROGRAM_OBJECTS="" PROGRAM_ELFOBJECTS="" PROGRAM_OBJECT_RULES="" PROGRAM_ELF_ORULES="" if test -z "$1" then Program_Modules="" else comment_re="^#" Program_Modules=`grep -v '$comment_re' $1 | awk '{print [$]1}'` Program_H_Modules=`grep -v '$comment_re' $1 | awk '{print [$]2}'` for program_module in $Program_H_Modules; do PROGRAM_HFILES="$PROGRAM_HFILES $program_module" done fi for program_module in $Program_Modules; do PROGRAM_OFILES="$PROGRAM_OFILES $program_module.o" PROGRAM_CFILES="$PROGRAM_CFILES $program_module.c" PROGRAM_OBJECTS="$PROGRAM_OBJECTS \$(OBJDIR)/$program_module.o" PROGRAM_ELFOBJECTS="$PROGRAM_ELFOBJECTS \$(ELFDIR)/$program_module.o" done dnl echo $PROGRAM_OFILES dnl echo $PROGRAM_HFILES AC_SUBST(PROGRAM_OFILES)dnl AC_SUBST(PROGRAM_CFILES)dnl AC_SUBST(PROGRAM_HFILES)dnl AC_SUBST(PROGRAM_OBJECTS)dnl AC_SUBST(PROGRAM_ELFOBJECTS)dnl ]) dnl#}}} AC_DEFUN(JD_APPEND_RULES, dnl#{{{ [ echo "$PROGRAM_OBJECT_RULES" >> $1 ]) dnl#}}} AC_DEFUN(JD_APPEND_ELFRULES, dnl#{{{ [ echo "$PROGRAM_ELF_ORULES" >> $1 ]) dnl#}}} AC_DEFUN(JD_CREATE_MODULE_EXEC_RULES, dnl#{{{ [ for program_module in $Program_Modules; do JD_CREATE_EXEC_RULE($program_module) done ]) dnl#}}} AC_DEFUN(JD_TERMCAP, dnl#{{{ [ AC_MSG_CHECKING(for Terminfo) MISC_TERMINFO_DIRS="$FINKPREFIX/share/terminfo" if test ! -d $MISC_TERMINFO_DIRS then MISC_TERMINFO_DIRS="" fi JD_Terminfo_Dirs="/usr/lib/terminfo \ /usr/share/terminfo \ /usr/share/lib/terminfo \ /usr/local/lib/terminfo \ $MISC_TERMINFO_DIRS" TERMCAP=-ltermcap for terminfo_dir in $JD_Terminfo_Dirs do if test -d $terminfo_dir then AC_MSG_RESULT(yes) TERMCAP="" break fi done if test "$TERMCAP"; then AC_MSG_RESULT(no) AC_DEFINE(USE_TERMCAP) fi AC_SUBST(TERMCAP)dnl AC_SUBST(MISC_TERMINFO_DIRS)dnl ]) dnl#}}} AC_DEFUN(JD_ANSI_CC, dnl#{{{ [ AC_PROG_CC AC_PROG_CPP AC_PROG_GCC_TRADITIONAL AC_ISC_POSIX AC_AIX dnl #This stuff came from Yorick config script dnl dnl # HPUX needs special stuff dnl AC_EGREP_CPP(yes, [#ifdef hpux yes #endif ], [ AC_DEFINE(_HPUX_SOURCE) if test "$CC" = cc; then CC="cc -Ae"; fi ])dnl dnl dnl #Be sure we've found compiler that understands prototypes dnl AC_MSG_CHECKING(C compiler that understands ANSI prototypes) AC_TRY_COMPILE([ ],[ extern int silly (int);], [ AC_MSG_RESULT($CC looks ok. Good.)], [ AC_MSG_RESULT($CC is not a good enough compiler) AC_MSG_ERROR(Set env variable CC to your ANSI compiler and rerun configure.) ])dnl ])dnl dnl#}}} AC_DEFUN(JD_ELF_COMPILER, dnl#{{{ [ dnl #------------------------------------------------------------------------- dnl # Check for dynamic linker dnl #------------------------------------------------------------------------- DYNAMIC_LINK_LIB="" AC_CHECK_HEADER(dlfcn.h,[ AC_DEFINE(HAVE_DLFCN_H) AC_CHECK_LIB(dl,dlopen,[ DYNAMIC_LINK_LIB="-ldl" AC_DEFINE(HAVE_DLOPEN) ],[ AC_CHECK_FUNC(dlopen,AC_DEFINE(HAVE_DLOPEN)) if test "$ac_cv_func_dlopen" != yes then AC_MSG_WARN(cannot perform dynamic linking) fi ])]) AC_SUBST(DYNAMIC_LINK_LIB) if test "$GCC" = yes then if test X"$CFLAGS" = X then CFLAGS="-O2" fi fi dnl #Some defaults ELFLIB="lib\$(THIS_LIB).so" ELFLIB_MAJOR="\$(ELFLIB).\$(ELF_MAJOR_VERSION)" ELFLIB_MAJOR_MINOR="\$(ELFLIB_MAJOR).\$(ELF_MINOR_VERSION)" ELFLIB_MAJOR_MINOR_MICRO="\$(ELFLIB_MAJOR_MINOR).\$(ELF_MICRO_VERSION)" dnl# This specifies the target to use in the makefile to install the shared library INSTALL_ELFLIB_TARGET="install-elf-and-links" ELFLIB_BUILD_NAME="\$(ELFLIB_MAJOR_MINOR_MICRO)" INSTALL_MODULE="\$(INSTALL_DATA)" SLANG_DLL_CFLAGS="" case "$host_os" in *linux*|*gnu*|k*bsd*-gnu ) DYNAMIC_LINK_FLAGS="-Wl,-export-dynamic" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) -fPIC" ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-O1 -Wl,--version-script,\$(VERSION_SCRIPT) -Wl,-soname,\$(ELFLIB_MAJOR)" ELF_DEP_LIBS="\$(DL_LIB) -lm -lc" CC_SHARED="\$(CC) \$(CFLAGS) -shared -fPIC" ;; *solaris* ) if test "$GCC" = yes then DYNAMIC_LINK_FLAGS="" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) -fPIC" ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-ztext -Wl,-h,\$(ELFLIB_MAJOR)" ELF_DEP_LIBS="\$(DL_LIB) -lm -lc" CC_SHARED="\$(CC) \$(CFLAGS) -G -fPIC" else DYNAMIC_LINK_FLAGS="" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) -K PIC" ELF_LINK="\$(CC) \$(LDFLAGS) -G -h\$(ELFLIB_MAJOR)" ELF_DEP_LIBS="\$(DL_LIB) -lm -lc" CC_SHARED="\$(CC) \$(CFLAGS) -G -K PIC" fi ;; # osr5 or unixware7 with current or late autoconf *sco3.2v5* | *unixware-5* | *sco-sysv5uw7*) if test "$GCC" = yes then DYNAMIC_LINK_FLAGS="" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) -fPIC" ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-h,\$(ELFLIB_MAJOR)" ELF_DEP_LIBS= CC_SHARED="\$(CC) \$(CFLAGS) -G -fPIC" else DYNAMIC_LINK_FLAGS="" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) -K pic" # ELF_LINK="ld -G -z text -h#" ELF_LINK="\$(CC) \$(LDFLAGS) -G -z text -h\$(ELFLIB_MAJOR)" ELF_DEP_LIBS= CC_SHARED="\$(CC) \$(CFLAGS) -G -K pic" fi ;; *irix6.5* ) echo "Note: ELF compiler for host_os=$host_os may not be correct" echo "double-check: 'mode_t', 'pid_t' may be wrong!" if test "$GCC" = yes then # not tested DYNAMIC_LINK_FLAGS="" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) -fPIC" ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-h,\$(ELFLIB_MAJOR)" ELF_DEP_LIBS= CC_SHARED="\$(CC) \$(CFLAGS) -shared -fPIC" else DYNAMIC_LINK_FLAGS="" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS)" # default anyhow ELF_LINK="\$(CC) \$(LDFLAGS) -shared -o \$(ELFLIB_MAJOR)" ELF_DEP_LIBS= CC_SHARED="\$(CC) \$(CFLAGS) -shared" fi ;; *darwin* ) DYNAMIC_LINK_FLAGS="" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) -fno-common" ELF_LINK="\$(CC) \$(LDFLAGS) -dynamiclib -install_name \$(install_lib_dir)/\$(ELFLIB_MAJOR) -compatibility_version \$(ELF_MAJOR_VERSION) -current_version \$(ELF_MAJOR_VERSION).\$(ELF_MINOR_VERSION)" ELF_DEP_LIBS="\$(LDFLAGS) \$(DL_LIB)" CC_SHARED="\$(CC) -bundle -flat_namespace -undefined suppress \$(CFLAGS) -fno-common" ELFLIB="lib\$(THIS_LIB).dylib" ELFLIB_MAJOR="lib\$(THIS_LIB).\$(ELF_MAJOR_VERSION).dylib" ELFLIB_MAJOR_MINOR="lib\$(THIS_LIB).\$(ELF_MAJOR_VERSION).\$(ELF_MINOR_VERSION).dylib" ELFLIB_MAJOR_MINOR_MICRO="lib\$(THIS_LIB).\$(ELF_MAJOR_VERSION).\$(ELF_MINOR_VERSION).\$(ELF_MICRO_VERSION).dylib" ;; *freebsd* ) ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) -fPIC" #if test "X$PORTOBJFORMAT" = "Xelf" ; then # ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-soname,\$(ELFLIB_MAJOR)" #else # ELF_LINK="ld -Bshareable -x" #fi ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-soname,\$(ELFLIB_MAJOR)" ELF_DEP_LIBS="\$(DL_LIB) -lm" CC_SHARED="\$(CC) \$(CFLAGS) -shared -fPIC" ;; *cygwin* ) DYNAMIC_LINK_FLAGS="" ELF_CC="\$(CC)" SLANG_DLL_CFLAGS="-DSLANG_DLL=1" ELF_CFLAGS="\$(CFLAGS) -DBUILD_DLL=1" DLL_IMPLIB_NAME="lib\$(THIS_LIB)\$(ELFLIB_MAJOR_VERSION).dll.a" #ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-O1 -Wl,--version-script,\$(VERSION_SCRIPT) -Wl,-soname,\$(ELFLIB_MAJOR) -Wl,--out-implib=\$(DLL_IMPLIB_NAME) -Wl,-export-all-symbols -Wl,-enable-auto-import" ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-O1 -Wl,--version-script,\$(VERSION_SCRIPT) -Wl,-soname,\$(ELFLIB_MAJOR) -Wl,--out-implib=\$(DLL_IMPLIB_NAME)" ELF_DEP_LIBS="\$(DL_LIB) -lm" CC_SHARED="\$(CC) \$(CFLAGS) -shared -DSLANG_DLL=1" dnl# CYGWIN prohibits undefined symbols when linking shared libs SLANG_LIB_FOR_MODULES="-L\$(ELFDIR) -lslang" INSTALL_MODULE="\$(INSTALL)" INSTALL_ELFLIB_TARGET="install-elf-cygwin" ELFLIB="lib\$(THIS_LIB).dll" ELFLIB_MAJOR="lib\$(THIS_LIB)\$(ELF_MAJOR_VERSION).dll" ELFLIB_MAJOR_MINOR="lib\$(THIS_LIB)\$(ELF_MAJOR_VERSION)_\$(ELF_MINOR_VERSION).dll" ELFLIB_MAJOR_MINOR_MICRO="lib\$(THIS_LIB)\$(ELF_MAJOR_VERSION)_\$(ELF_MINOR_VERSION)_\$(ELF_MICRO_VERSION).dll" ELFLIB_BUILD_NAME="\$(ELFLIB_MAJOR)" ;; * ) echo "Note: ELF compiler for host_os=$host_os may be wrong" ELF_CC="\$(CC)" ELF_CFLAGS="\$(CFLAGS) -fPIC" ELF_LINK="\$(CC) \$(LDFLAGS) -shared" ELF_DEP_LIBS="\$(DL_LIB) -lm -lc" CC_SHARED="\$(CC) \$(CFLAGS) -shared -fPIC" esac AC_SUBST(ELF_CC) AC_SUBST(ELF_CFLAGS) AC_SUBST(ELF_LINK) AC_SUBST(ELF_LINK_CMD) AC_SUBST(ELF_DEP_LIBS) AC_SUBST(DYNAMIC_LINK_FLAGS) AC_SUBST(CC_SHARED) AC_SUBST(ELFLIB) AC_SUBST(ELFLIB_MAJOR) AC_SUBST(ELFLIB_MAJOR_MINOR) AC_SUBST(ELFLIB_MAJOR_MINOR_MICRO) AC_SUBST(SLANG_LIB_FOR_MODULES) AC_SUBST(DLL_IMPLIB_NAME) AC_SUBST(INSTALL_MODULE) AC_SUBST(INSTALL_ELFLIB_TARGET) AC_SUBST(ELFLIB_BUILD_NAME) AC_SUBST(SLANG_DLL_CFLAGS) ]) dnl#}}} AC_DEFUN(JD_F77_COMPILER, dnl#{{{ [ case "$host_os" in *linux* ) F77="g77" F77_LIBS="-lg2c" ;; *solaris*) F77=f77 #F77_LIBS="-lF77 -lM77 -L/opt/SUNWspro/SC4.0/lib -lsunmath" F77_LIBS="-lF77 -lM77 -lsunmath" ;; *) echo "" echo "WARNING: Assuming f77 as your FORTRAN compiler" echo "" F77=f77 F77_LIBS="" esac AC_SUBST(F77) AC_SUBST(F77_LIBS) ]) dnl#}}} dnl# This macro process the --with-xxx, --with-xxxinc, and --with-xxxlib dnl# command line arguments and returns the values as shell variables dnl# jd_xxx_include_dir and jd_xxx_library_dir. It does not perform any dnl# substitutions, nor check for the existence of the supplied values. AC_DEFUN(JD_WITH_LIBRARY_PATHS, dnl#{{{ [ JD_UPPERCASE($1,JD_ARG1) jd_$1_include_dir="" jd_$1_library_dir="" jd_with_$1_library="" AC_ARG_WITH($1, [ --with-$1=DIR Use DIR/lib and DIR/include for $1], [jd_with_$1_arg=$withval], [jd_with_$1_arg=unspecified]) case "x$jd_with_$1_arg" in xno) jd_with_$1_library="no" ;; x) AC_MSG_ERROR(--with-$1 requires a value-- try yes or no) ;; xunspecified) ;; xyes) ;; *) jd_$1_include_dir="$jd_with_$1_arg"/include jd_$1_library_dir="$jd_with_$1_arg"/lib ;; esac AC_ARG_WITH($1lib, [ --with-$1lib=DIR $1 library in DIR], [jd_with_$1lib_arg=$withval], [jd_with_$1lib_arg=unspecified]) case "x$jd_with_$1lib_arg" in xunspecified) ;; xno) ;; x) AC_MSG_ERROR(--with-$1lib requres a value) ;; *) jd_$1_library_dir="$jd_with_$1lib_arg" ;; esac AC_ARG_WITH($1inc, [ --with-$1inc=DIR $1 include files in DIR], [jd_with_$1inc_arg=$withval], [jd_with_$1inc_arg=unspecified]) case "x$jd_with_$1inc_arg" in x) AC_MSG_ERROR(--with-$1inc requres a value) ;; xunspecified) ;; xno) ;; *) jd_$1_include_dir="$jd_with_$1inc_arg" ;; esac ]) dnl#}}} dnl# This function checks for the existence of the specified library $1 with dnl# header file $2. If the library exists, then the shell variables will dnl# be created: dnl# jd_with_$1_library=yes/no, dnl# jd_$1_inc_file dnl# jd_$1_include_dir dnl# jd_$1_library_dir AC_DEFUN(JD_CHECK_FOR_LIBRARY, dnl#{{{ [ AC_REQUIRE([JD_EXPAND_PREFIX])dnl AC_MSG_CHECKING(for the $1 library and header files $2) dnl JD_UPPERCASE($1,JD_ARG1) JD_WITH_LIBRARY_PATHS($1) if test X"$jd_with_$1_library" = X then jd_$1_inc_file=$2 jd_with_$1_library="yes" if test "X$jd_$1_inc_file" = "X" then jd_$1_inc_file=$1.h fi if test X"$jd_$1_include_dir" = X then lib_include_dirs="\ $jd_prefix_incdir \ /usr/local/$1/include \ /usr/local/include/$1 \ /usr/local/include \ /usr/include/$1 \ /usr/$1/include \ /usr/include \ /opt/include/$1 \ /opt/$1/include \ /opt/include" for X in $lib_include_dirs do if test -r "$X/$jd_$1_inc_file" then jd_$1_include_dir="$X" break fi done if test X"$jd_$1_include_dir" = X then jd_with_$1_library="no" fi fi if test X"$jd_$1_library_dir" = X then lib_library_dirs="\ $jd_prefix_libdir \ /usr/local/lib \ /usr/local/lib/$1 \ /usr/local/$1/lib \ /usr/lib \ /usr/lib/$1 \ /usr/$1/lib \ /opt/lib \ /opt/lib/$1 \ /opt/$1/lib" case "$host_os" in *darwin* ) exts="dylib so a" ;; *cygwin* ) exts="dll.a so a" ;; * ) exts="so a" esac found=0 for X in $lib_library_dirs do for E in $exts do if test -r "$X/lib$1.$E" then jd_$1_library_dir="$X" found=1 break fi done if test $found -eq 1 then break fi done if test X"$jd_$1_library_dir" = X then jd_with_$1_library="no" fi fi fi if test "$jd_with_$1_library" = "yes" then AC_MSG_RESULT(yes: $jd_$1_library_dir and $jd_$1_include_dir) dnl# Avoid using /usr/lib and /usr/include because of problems with dnl# gcc on some solaris systems. JD_ARG1[]_LIB=-L$jd_$1_library_dir if test "X$jd_$1_library_dir" = "X/usr/lib" then JD_ARG1[]_LIB="" else JD_SET_RPATH($jd_$1_library_dir) fi JD_ARG1[]_INC=-I$jd_$1_include_dir if test "X$jd_$1_include_dir" = "X/usr/include" then JD_ARG1[]_INC="" fi else AC_MSG_RESULT(no) JD_ARG1[]_INC="" JD_ARG1[]_LIB="" fi AC_SUBST(JD_ARG1[]_LIB) AC_SUBST(JD_ARG1[]_INC) ]) dnl#}}} AC_DEFUN(JD_WITH_LIBRARY, dnl#{{{ [ JD_CHECK_FOR_LIBRARY($1, $2) if test "$jd_with_$1_library" = "no" then AC_MSG_ERROR(unable to find the $1 library and header file $jd_$1_inc_file) fi ]) dnl#}}} AC_DEFUN(JD_SLANG_VERSION, dnl#{{{ [ slang_h=$jd_slang_include_dir/slang.h AC_MSG_CHECKING(SLANG_VERSION in $slang_h) slang_version=`grep "^#define *SLANG_VERSION " $slang_h | awk '{ print [$]3 }'` slang_major_version=`echo $slang_version | awk '{ print int([$]1/10000) }'` slang_minor_version=`echo $slang_version $slang_major_version | awk '{ print int(([$]1 - [$]2*10000)/100) }'` slang_patchlevel_version=`echo $slang_version $slang_major_version $slang_minor_version | awk '{ print ([$]1 - [$]2*10000 - [$]3*100) }'` AC_MSG_RESULT($slang_major_version.$slang_minor_version.$slang_patchlevel_version) AC_SUBST(slang_version) AC_SUBST(slang_major_version) AC_SUBST(slang_minor_version) AC_SUBST(slang_patchlevel_version) ]) #}}} AC_DEFUN(JD_SLANG_MODULE_INSTALL_DIR, dnl#{{{ [ AC_REQUIRE([JD_SLANG_VERSION]) if test "X$slang_major_version" = "X1" then MODULE_INSTALL_DIR="$libdir/slang/modules" else MODULE_INSTALL_DIR="$libdir/slang/v$slang_major_version/modules" fi SL_FILES_INSTALL_DIR=$datadir/slsh/local-packages AC_SUBST(MODULE_INSTALL_DIR) AC_SUBST(SL_FILES_INSTALL_DIR) ]) #}}} AC_DEFUN(JD_CHECK_LONG_LONG, dnl#{{{ [ AC_CHECK_TYPES(long long) AC_CHECK_SIZEOF(long long) ]) dnl#}}} AC_DEFUN(JD_LARGE_FILE_SUPPORTXXX, dnl#{{{ [ AC_REQUIRE([JD_CHECK_LONG_LONG]) AC_MSG_CHECKING(whether to explicitly activate long file support) AC_DEFINE(_LARGEFILE_SOURCE, 1) AC_DEFINE(_FILE_OFFSET_BITS, 64) jd_large_file_support=no if test X$ac_cv_type_long_long = Xyes then if test $ac_cv_sizeof_long_long -ge 8 then jd_large_file_support=yes fi fi if test $jd_large_file_support = yes then AC_DEFINE(HAVE_LARGEFILE_SUPPORT, 1) AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi ]) dnl#}}} AC_DEFUN(JD_LARGE_FILE_SUPPORT, dnl#{{{ [ AC_SYS_LARGEFILE AC_FUNC_FSEEKO AC_TYPE_OFF_T AC_CHECK_SIZEOF(off_t) ]) #}}} AC_DEFUN(JD_HAVE_ISINF, dnl#{{{ [ AC_MSG_CHECKING([for isinf]) AC_LINK_IFELSE([AC_LANG_PROGRAM( [[#include ]], [[isinf (0.0);]])], [AC_MSG_RESULT([yes]) AC_DEFINE(HAVE_ISINF, 1)]) ]) #}}} most-5.0.0a/autoconf/config.sub0000755002657400265740000007547010426040636015502 0ustar davisdavis#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. timestamp='2005-04-22' # 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. # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # 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. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit 0;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # 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 nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \ kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) 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 | -axis | -knuth | -cray) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb 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/'` ;; -udk*) 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 ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; 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. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64vr | mips64vrel \ | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | msp430 \ | ns16k | ns32k \ | openrisc | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b \ | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; # 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*86 | x86_64) 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. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64vr-* | mips64vrel-* \ | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | msp430-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa-* \ | ymp-* \ | z8k-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; c90) basic_machine=c90-cray os=-unicos ;; 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 | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16c) basic_machine=cr16c-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; 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 ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-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 ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; 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 ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; 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 ;; necv70) basic_machine=v70-nec os=-sysv ;; 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 ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; or32 | or32-*) basic_machine=or32-unknown os=-coff ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; 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 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-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/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; 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 ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-unknown os=-coff ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; 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 ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; 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. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sh64) basic_machine=sh64-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) 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* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -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|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -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*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; 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 ;; m68*-cisco) os=-aout ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-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 ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-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 ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) 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 ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: most-5.0.0a/most.lis0000644002657400265740000000151310426040636013357 0ustar davisdavis@configure 0755 @most.lis @README @COPYRIGHT @COPYING @lesskeys.rc @most.rc @most-fun.txt @most.1 @most.doc @most.hlp @changes.txt @autoconf/Makefile.in @autoconf/aclocal.m4 @autoconf/configure.ac @autoconf/mkinsdir.sh 0755 @autoconf/install.sh 0755 @autoconf/config.guess 0755 @autoconf/config.sub 0755 @src/DESCRIP.MMS @src/VMSMAKE.COM @src/RTL.OPT @src/Makefile.in @src/Makefile.w32 @src/sysconf.h @src/config.hin @src/mostconf.h @src/modules.lis @src/w32conf.h @src/jdmacros.h @src/main.c @src/buffer.c @src/file.c @src/window.c @src/line.c @src/display.c @src/sysdep.c @src/keym.c @src/most.c @src/search.c @src/help.c @src/cmd.c @src/edit.c @src/edit.h @src/buffer.h @src/file.h @src/window.h @src/line.h @src/display.h @src/sysdep.h @src/keym.h @src/most.h @src/search.h @src/keyparse.c @src/keyparse.h @src/chkslang.c @src/version.h most-5.0.0a/README0000644002657400265740000000640710670005631012550 0ustar davisdavisCompiling MOST requires an ANSI C compiler. In addition you MUST have a copy of the S-Lang library version 2.X. Version 1 is nolonger supported. This library is available from . INSTALLATION INSTRUCTIONS On Unix, you should be able to simply type: ./configure; make at the Unix prompt. If you are using CYGWIN, you will need to ensure that libslang.dll is on your PATH; otherwise the chkslang program will not run. If using DJGPP or MINGW32, do: cd src make -f makefile.w32 For VMS, edit the file `vmsmake.com'. When finished, either type `@vmsmake' or `@vmsmake gcc' at the VMS prompt. Once MOST has been created, it must be installed as a foreign command. This means that you must first type: $ most :== $device:[dir.containing.most]most.exe I suggest that you first build MOST then view the doc file using MOST (`most most.doc'). If you need help, hit the `h' key from within MOST. MOST understands the following environment variables: MOST_SWITCHES MOST_EDITOR, SLANG_EDITOR, EDITOR MOST_INITFILE MOST_HELP 1. MOST_SWITCHES is a list of commonly used switches. 2. MOST_EDITOR and SLANG_EDITOR are formatted strings describing what editor to use. The string can contain %s and %d formatting descriptors that represent the file name and line number, respectively. For example, if JED is your editor, then set MOST_EDITOR to 'jed %s -g %d'. Since MOST is just one of several programs that use the S-Lang library, I suggest that you use SLANG_EDITOR instead of MOST_EDITOR. 3. MOST_INITFILE specifies a configuration file for MOST. One can specifiy keymaps, colors, etc. via this file. In the absence of MOST_INITFILE, the program will look for a file call .mostrc in the home directory (most.rc on non-Unix systems). See `lesskeys.rc' for an example of a key definition file that causes MOST to emulate the `less' pager. See also most-fun.txt for a list of functions that can be used for key definitions. The file `most.rc' list the bindings that are built-in to the viewer. 4. If MOST_HELP is defined to point to an existing file, MOST will load a file as a help file. This is useful for describing custom keymaps. Any problems with MOST should be reported to davis@space.mit.edu. [Note also that this is really the first non-trivial C program that I ever wrote. Because of this, much of the code appears very amateurish. For example, I tried very hard to avoid C constructs that some some authors considered very bad, e.g., goto, continue, break. Of course this made some of the code convoluted, e.g., contrast int test = 1; while (test) { function (); if (-1 == some_function ()) test = 0; if (test) some_other_function (); } with: while (1) { function (); if (-1 == some_function ()) break; some_other_function (); } I have since concluded that many text-book authors never actually wrote anything non-trivial. Whenever I work on MOST, I try to make some changes in an effort to clean it up. ] --John Davis