gnuserv-3.12.8/0000775000175000017500000000000010706776207013230 5ustar martinsmartinsgnuserv-3.12.8/Makefile.in0000444000175000017500000001651510706771374015301 0ustar martinsmartins# Makefile.in gnuserv # Copyright (C) 1994, 1995, 1997, 1999, 2000, 2001 Noah S. Friedman, Martin Schwenke # 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, 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. # $Id: Makefile.in,v 1.18 2007/10/22 00:46:52 martins Exp $ PACKAGENAME = gnuserv VERSION = 3.12.8 DISTNAME = $(PACKAGENAME)-$(VERSION) #### Start of system configuration section. #### srcdir = @srcdir@ VPATH = @srcdir@ CC = @CC@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_DATA = @INSTALL_DATA@ DEFS = @DEFS@ LIBS = @LIBS@ LIBXAUTH = @LIBXAUTH@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ prefix = @prefix@ exec_prefix = @exec_prefix@ # The directory for installing executable programs that users can run. bindir = $(exec_prefix)/bin # Prefix/suffix for each installed program name, normally empty. binprefix = binsuffix = # The directory for installing read-only architecture independent # data files. # As a special exception, see `infodir' and `includedir' below. datadir = $(prefix)/share elispdir = $(datadir)/emacs/site-lisp # Where to install the manual pages. man1dir = $(prefix)/man/man1 # Prefix/suffix for each installed man page, normally empty or `g'. man1prefix = $(binprefix) man1suffix = $(binsuffix) # Extension (not including `.') for the installed manual page filenames. man1ext = 1 AUTOCONF = autoconf AUTOHEADER = autoheader EMACS = emacs ETAGS = etags GZIP = gzip LN = ln -s MAKEINFO = makeinfo MAKEINFOFLAGS = --no-split -I. -I$(srcdir) MV = mv RM = rm -f TAR = tar TOUCH = touch TEXI2DVI = texi2dvi TEXI2DVIFLAGS = #-I. -I$(srcdir) #### End of system configuration section. #### SHELL = /bin/sh LOADLIBES = $(LIBS) $(LIBXAUTH) DIST_TXTS = INSTALL COPYING README README.orig ChangeLog DIST_MISC = DIST_CONF = Makefile.in acconfig.h aclocal.m4 config.h.in config.h.bot \ configure configure.in install-sh mkinstalldirs DIST_SCPS = gnuattach gnudoit DIST_SRCS = getopt.c gnuclient.c gnuserv.c gnuslib.c DIST_HDRS = getopt.h gnuserv.h sysfile.h syssignal.h compiler.h DIST_DOCS = gnuserv.1 DIST_LISP = gnuserv.el gnuserv-compat.el devices.el DISTFILES = $(DIST_TXTS) $(DIST_MISC) $(DIST_CONF) $(DIST_SCPS) \ $(DIST_SRCS) $(DIST_HDRS) $(DIST_DOCS) $(DIST_LISP) COMPILE_FLAGS = -I. -I$(srcdir) $(DEFS) $(CPPFLAGS) $(CFLAGS) .c.o: $(CC) -c $(COMPILE_FLAGS) $< .SUFFIXES: .texi .info .texi.info: $(MAKEINFO) $(MAKEINFOFLAGS) $< .SUFFIXES: .texi .dvi .texi.dvi: $(TEXI2DVI) $(TEXI2DVIFLAGS) $< .SUFFIXES: .el .elc .el.elc: $(EMACS) -batch -f batch-byte-compile $< all: all-gnuserv all-info: info ### targets required by GNU Coding standards ### Makefile: Makefile.in config.status $(SHELL) ./config.status config.status: configure $(SHELL) ./config.status --recheck configure: configure.in cd $(srcdir) && $(AUTOCONF) config.h.in: configure.in cd $(srcdir) && $(AUTOHEADER) config.h: config.h.in $(SHELL) ./config.status TAGS: cd $(srcdir) && $(ETAGS) .PHONY: clean mostlyclean distclean clean: $(RM) $(PROGS) *.o *.elc core a.out mostlyclean: clean distclean: clean $(RM) Makefile config.status config.log config.cache config.h .PHONY: maintainer-clean maintclean-warning maintainer-clean: maintclean-warning distclean $(RM) configure config.h.in getdate.c y.tab.c # Used by maintainer-clean to print a warning before any rm commands are run. maintclean-warning: @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." realclean: distclean $(RM) TAGS .PHONY: dist dist: $(DISTFILES) $(TOUCH) config.h.in $(RM) -r $(DISTNAME) mkdir $(DISTNAME) @dst=$(DISTNAME); for f in $(DISTFILES); do \ { cmd=ln; $$cmd $(srcdir)/$$f $$dst/$$f ; } \ || { cmd='cp -p'; cp -p $(srcdir)/$$f $$dst/$$f ; }; \ echo $$cmd $(srcdir)/$$f $$dst/$$f; \ done $(TAR) cf - $(DISTNAME) | $(GZIP) > $(DISTNAME).tar.gz $(RM) -r $(DISTNAME) .PHONY: installdirs uninstall install: all installdirs install-programs install-man installdirs: force -$(SHELL) $(srcdir)/mkinstalldirs $(bindir) $(datadir) $(libdir) $(infodir) $(man1dir) install-programs: all-gnuserv @for prog in gnuserv gnuclient ; do \ new=$(bindir)/$(binprefix)$$prog$(binsuffix); \ echo $(INSTALL_PROGRAM) $$prog $$new; \ $(INSTALL_PROGRAM) $$prog $$new;\ done @for prog in gnuattach gnudoit ; do \ new=$(bindir)/$(binprefix)$$prog$(binsuffix); \ echo $(INSTALL_SCRIPT) $$prog $$new; \ $(INSTALL_SCRIPT) $$prog $$new;\ done install-man: force @new=$(man1prefix)gnuserv$(man1suffix).$(man1ext); \ echo $(INSTALL_DATA) $(srcdir)/gnuserv.1 $(man1dir)/$$new; \ $(INSTALL_DATA) $(srcdir)/gnuserv.1 $(man1dir)/$$new; \ cd $(man1dir) || exit 1; \ for l in gnuclient gnuattach gnudoit ; do \ l=$(man1dir)/$(man1prefix)$$l$(man1suffix).$(man1ext); \ echo $(LN) $(man1dir)/$$new $$l; \ $(RM) $$l; $(LN) $$new $$l; \ done install-elisp: gnuserv.el gnuserv.elc $(INSTALL_DATA) $(srcdir)/gnuserv.el $(elispdir)/gnuserv.el $(INSTALL_DATA) gnuserv.elc $(elispdir)/gnuserv.elc uninstall: force -cd $(bindir) && $(RM) $(PROGS) -@cd $(man1dir);\ for l in $(PROGS); do \ f=$(man1dir)/$(man1prefix)$$l$(man1suffix).$(man1ext); \ echo $(RM) $$f && $(RM) $$f ; \ done .PHONY: check installcheck force check: @echo 'Nothing to be done for "check"' installcheck: @echo 'Nothing to be done for "installcheck"' force: ### program-specific building targets ### PROGS = gnuserv gnuclient ELC = gnuserv-compat.elc gnuserv.elc devices.elc all-gnuserv: $(PROGS) $(ELC) gnuserv: gnuserv.o gnuslib.o $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ gnuserv.o gnuslib.o $(LOADLIBES) gnuclient: gnuclient.o gnuslib.o getopt.o $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ gnuclient.o gnuslib.o getopt.o $(LOADLIBES) gnuserv.o: gnuserv.c gnuserv.h config.h compiler.h syssignal.h gnuclient.o: gnuclient.c gnuserv.h getopt.h config.h \ compiler.h sysfile.h syssignal.h gnuslib.o: gnuslib.c gnuserv.h getopt.o config.h syssignal.h getopt.o: getopt.c getopt.h config.h gnuserv-compat.elc: gnuserv-compat.el $(EMACS) --no-site-file -batch \ --eval "(add-to-list 'load-path \".\")" \ -f batch-byte-compile $< gnuserv.elc: gnuserv.el $(EMACS) --no-site-file -batch \ --eval "(add-to-list 'load-path \".\")" \ -l gnuserv-compat -f batch-byte-compile $< devices.elc: devices.el info: gnuserv.info gnuserv.info: gnuserv.texi dvi: gnuserv.dvi gnuserv.dvi: gnuserv.texi .PHONY: ChangeLog ChangeLog: rcs2log -R \ -u "martins Martin Schwenke martin@meltin.net" \ -u "martin Martin Schwenke martin@meltin.net" \ > $@ # Prevent GNU make v3 from overflowing arg limit on SysV. .NOEXPORT: # local variables: # mode: makefile # end: # Makefile.in ends here gnuserv-3.12.8/getopt.c0000444000175000017500000007203207125367573014701 0ustar martinsmartins/* Getopt for GNU. NOTE: getopt is now part of the C library, so if you don't know what "Keep this file name-space clean" means, talk to roland@gnu.ai.mit.edu before changing it! Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97 Free Software Foundation, Inc. NOTE: The canonical source of this file is maintained with the GNU C Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu. 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, 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. */ /* This tells Alpha OSF/1 not to define a getopt prototype in . Ditto for AIX 3.2 and . */ #ifndef _NO_PROTO #define _NO_PROTO #endif #ifdef HAVE_CONFIG_H #include #endif #include #include #include /* Comment out all this code if we are using the GNU C Library, and are not actually compiling the library itself. This code is part of the GNU C Library, but also included in many other GNU distributions. Compiling and linking in this code is a waste when using the GNU C library (especially if it is a shared library). Rather than having every GNU program understand `configure --with-gnu-libc' and omit the object files, it is simpler to just do this in the source for each such file. */ #define GETOPT_INTERFACE_VERSION 2 #if !defined (_LIBC) && defined (__GLIBC__) && __GLIBC__ >= 2 #include #if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION #define ELIDE_CODE #endif #endif #ifndef ELIDE_CODE /* This needs to come after some library #include to get __GNU_LIBRARY__ defined. */ #ifdef __GNU_LIBRARY__ /* Don't include stdlib.h for non-GNU C libraries because some of them contain conflicting prototypes for getopt. */ #include #include #endif /* GNU C library. */ #ifdef VMS #include #if HAVE_STRING_H - 0 #include #endif #endif #if defined (WIN32_NATIVE) && !defined (CYGWIN) /* It's not Unix, really. See? Capital letters. */ #include #undef getpid #define getpid() GetCurrentProcessId() #endif #ifndef _ /* This is for other GNU distributions with internationalized messages. When compiling libc, the _ macro is predefined. */ #ifdef HAVE_LIBINTL_H # include # define _(msgid) gettext (msgid) #else # define _(msgid) (msgid) #endif #endif /* This version of `getopt' appears to the caller like standard Unix `getopt' but it behaves differently for the user, since it allows the user to intersperse the options with the other arguments. As `getopt' works, it permutes the elements of ARGV so that, when it is done, all the options precede everything else. Thus all application programs are extended to handle flexible argument order. Setting the environment variable POSIXLY_CORRECT disables permutation. Then the behavior is completely standard. GNU application programs can use a third alternative mode in which they can distinguish the relative order of options and other arguments. */ #include "getopt.h" /* For communication from `getopt' to the caller. When `getopt' finds an option that takes an argument, the argument value is returned here. Also, when `ordering' is RETURN_IN_ORDER, each non-option ARGV-element is returned here. */ char *optarg = NULL; /* Index in ARGV of the next element to be scanned. This is used for communication to and from the caller and for communication between successive calls to `getopt'. On entry to `getopt', zero means this is the first call; initialize. When `getopt' returns -1, this is the index of the first of the non-option elements that the caller should itself scan. Otherwise, `optind' communicates from one call to the next how much of ARGV has been scanned so far. */ /* 1003.2 says this must be 1 before any call. */ int optind = 1; /* Formerly, initialization of getopt depended on optind==0, which causes problems with re-calling getopt as programs generally don't know that. */ int __getopt_initialized = 0; /* The next char to be scanned in the option-element in which the last option character we returned was found. This allows us to pick up the scan where we left off. If this is zero, or a null string, it means resume the scan by advancing to the next ARGV-element. */ static char *nextchar; /* Callers store zero here to inhibit the error message for unrecognized options. */ int opterr = 1; /* Set to an option character which was unrecognized. This must be initialized on some systems to avoid linking in the system's own getopt implementation. */ int optopt = '?'; /* Describe how to deal with options that follow non-option ARGV-elements. If the caller did not specify anything, the default is REQUIRE_ORDER if the environment variable POSIXLY_CORRECT is defined, PERMUTE otherwise. REQUIRE_ORDER means don't recognize them as options; stop option processing when the first non-option is seen. This is what Unix does. This mode of operation is selected by either setting the environment variable POSIXLY_CORRECT, or using `+' as the first character of the list of option characters. PERMUTE is the default. We permute the contents of ARGV as we scan, so that eventually all the non-options are at the end. This allows options to be given in any order, even with programs that were not written to expect this. RETURN_IN_ORDER is an option available to programs that were written to expect options and other ARGV-elements in any order and that care about the ordering of the two. We describe each non-option ARGV-element as if it were the argument of an option with character code 1. Using `-' as the first character of the list of option characters selects this mode of operation. The special argument `--' forces an end of option-scanning regardless of the value of `ordering'. In the case of RETURN_IN_ORDER, only `--' can cause `getopt' to return -1 with `optind' != ARGC. */ static enum { REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER } ordering; /* Value of POSIXLY_CORRECT environment variable. */ static char *posixly_correct; #ifdef __GNU_LIBRARY__ /* We want to avoid inclusion of string.h with non-GNU libraries because there are many ways it can cause trouble. On some systems, it contains special magic macros that don't work in GCC. */ #include #define my_index strchr #else static char * my_index (const char *str, int chr) { while (*str) { if (*str == chr) return (char *) str; str++; } return 0; } /* If using GCC, we can safely declare strlen this way. If not using GCC, it is ok not to declare it. */ #ifdef __GNUC__ /* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h. That was relevant to code that was here before. */ #if !defined (__STDC__) || !__STDC__ /* gcc with -traditional declares the built-in strlen to return int, and has done so at least since version 2.4.5. -- rms. */ extern int strlen (const char *); #endif /* not __STDC__ */ #endif /* __GNUC__ */ #endif /* not __GNU_LIBRARY__ */ /* Handle permutation of arguments. */ /* Describe the part of ARGV that contains non-options that have been skipped. `first_nonopt' is the index in ARGV of the first of them; `last_nonopt' is the index after the last of them. */ static int first_nonopt; static int last_nonopt; #ifdef _LIBC /* Bash 2.0 gives us an environment variable containing flags indicating ARGV elements that should not be considered arguments. */ /* Defined in getopt_init.c */ extern char *__getopt_nonoption_flags; static int nonoption_flags_max_len; static int nonoption_flags_len; static int original_argc; static char *const *original_argv; extern pid_t __libc_pid; /* Make sure the environment variable bash 2.0 puts in the environment is valid for the getopt call we must make sure that the ARGV passed to getopt is that one passed to the process. */ static void __attribute__ ((unused)) store_args_and_env (int argc, char *const *argv) { /* XXX This is no good solution. We should rather copy the args so that we can compare them later. But we must not use malloc(3). */ original_argc = argc; original_argv = argv; } text_set_element (__libc_subinit, store_args_and_env); # define SWAP_FLAGS(ch1, ch2) \ if (nonoption_flags_len > 0) \ { \ char __tmp = __getopt_nonoption_flags[ch1]; \ __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2]; \ __getopt_nonoption_flags[ch2] = __tmp; \ } #else /* !_LIBC */ # define SWAP_FLAGS(ch1, ch2) #endif /* _LIBC */ /* Exchange two adjacent subsequences of ARGV. One subsequence is elements [first_nonopt,last_nonopt) which contains all the non-options that have been skipped so far. The other is elements [last_nonopt,optind), which contains all the options processed since those non-options were skipped. `first_nonopt' and `last_nonopt' are relocated so that they describe the new indices of the non-options in ARGV after they are moved. */ #if defined (__STDC__) && __STDC__ static void exchange (char **); #endif static void exchange (char **argv) { int bottom = first_nonopt; int middle = last_nonopt; int top = optind; char *tem; /* Exchange the shorter segment with the far end of the longer segment. That puts the shorter segment into the right place. It leaves the longer segment in the right place overall, but it consists of two parts that need to be swapped next. */ #ifdef _LIBC /* First make sure the handling of the `__getopt_nonoption_flags' string can work normally. Our top argument must be in the range of the string. */ if (nonoption_flags_len > 0 && top >= nonoption_flags_max_len) { /* We must extend the array. The user plays games with us and presents new arguments. */ char *new_str = malloc (top + 1); if (new_str == NULL) nonoption_flags_len = nonoption_flags_max_len = 0; else { memcpy (new_str, __getopt_nonoption_flags, nonoption_flags_max_len); memset (&new_str[nonoption_flags_max_len], '\0', top + 1 - nonoption_flags_max_len); nonoption_flags_max_len = top + 1; __getopt_nonoption_flags = new_str; } } #endif while (top > middle && middle > bottom) { if (top - middle > middle - bottom) { /* Bottom segment is the short one. */ int len = middle - bottom; register int i; /* Swap it with the top part of the top segment. */ for (i = 0; i < len; i++) { tem = argv[bottom + i]; argv[bottom + i] = argv[top - (middle - bottom) + i]; argv[top - (middle - bottom) + i] = tem; SWAP_FLAGS (bottom + i, top - (middle - bottom) + i); } /* Exclude the moved bottom segment from further swapping. */ top -= len; } else { /* Top segment is the short one. */ int len = top - middle; register int i; /* Swap it with the bottom part of the bottom segment. */ for (i = 0; i < len; i++) { tem = argv[bottom + i]; argv[bottom + i] = argv[middle + i]; argv[middle + i] = tem; SWAP_FLAGS (bottom + i, middle + i); } /* Exclude the moved top segment from further swapping. */ bottom += len; } } /* Update records for the slots the non-options now occupy. */ first_nonopt += (optind - last_nonopt); last_nonopt = optind; } /* Initialize the internal data when the first call is made. */ #if defined (__STDC__) && __STDC__ static const char *_getopt_initialize (int, char *const *, const char *); #endif static const char * _getopt_initialize (int argc, char *const *argv, const char *optstring) { /* Start processing options with ARGV-element 1 (since ARGV-element 0 is the program name); the sequence of previously skipped non-option ARGV-elements is empty. */ first_nonopt = last_nonopt = optind; nextchar = NULL; posixly_correct = getenv ("POSIXLY_CORRECT"); /* Determine how to handle the ordering of options and nonoptions. */ if (optstring[0] == '-') { ordering = RETURN_IN_ORDER; ++optstring; } else if (optstring[0] == '+') { ordering = REQUIRE_ORDER; ++optstring; } else if (posixly_correct != NULL) ordering = REQUIRE_ORDER; else ordering = PERMUTE; #ifdef _LIBC if (posixly_correct == NULL && argc == original_argc && argv == original_argv) { if (nonoption_flags_max_len == 0) { if (__getopt_nonoption_flags == NULL || __getopt_nonoption_flags[0] == '\0') nonoption_flags_max_len = -1; else { const char *orig_str = __getopt_nonoption_flags; int len = nonoption_flags_max_len = strlen (orig_str); if (nonoption_flags_max_len < argc) nonoption_flags_max_len = argc; __getopt_nonoption_flags = (char *) malloc (nonoption_flags_max_len); if (__getopt_nonoption_flags == NULL) nonoption_flags_max_len = -1; else { memcpy (__getopt_nonoption_flags, orig_str, len); memset (&__getopt_nonoption_flags[len], '\0', nonoption_flags_max_len - len); } } } nonoption_flags_len = nonoption_flags_max_len; } else nonoption_flags_len = 0; #endif return optstring; } /* Scan elements of ARGV (whose length is ARGC) for option characters given in OPTSTRING. If an element of ARGV starts with '-', and is not exactly "-" or "--", then it is an option element. The characters of this element (aside from the initial '-') are option characters. If `getopt' is called repeatedly, it returns successively each of the option characters from each of the option elements. If `getopt' finds another option character, it returns that character, updating `optind' and `nextchar' so that the next call to `getopt' can resume the scan with the following option character or ARGV-element. If there are no more option characters, `getopt' returns -1. Then `optind' is the index in ARGV of the first ARGV-element that is not an option. (The ARGV-elements have been permuted so that those that are not options now come last.) OPTSTRING is a string containing the legitimate option characters. If an option character is seen that is not listed in OPTSTRING, return '?' after printing an error message. If you set `opterr' to zero, the error message is suppressed but we still return '?'. If a char in OPTSTRING is followed by a colon, that means it wants an arg, so the following text in the same ARGV-element, or the text of the following ARGV-element, is returned in `optarg'. Two colons mean an option that wants an optional arg; if there is text in the current ARGV-element, it is returned in `optarg', otherwise `optarg' is set to zero. If OPTSTRING starts with `-' or `+', it requests different methods of handling the non-option ARGV-elements. See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. Long-named options begin with `--' instead of `-'. Their names may be abbreviated as long as the abbreviation is unique or is an exact match for some defined option. If they have an argument, it follows the option name in the same ARGV-element, separated from the option name by a `=', or else the in next ARGV-element. When `getopt' finds a long-named option, it returns 0 if that option's `flag' field is nonzero, the value of the option's `val' field if the `flag' field is zero. The elements of ARGV aren't really const, because we permute them. But we pretend they're const in the prototype to be compatible with other systems. LONGOPTS is a vector of `struct option' terminated by an element containing a name which is zero. LONGIND returns the index in LONGOPT of the long-named option found. It is only valid when a long-named option has been found by the most recent call. If LONG_ONLY is nonzero, '-' as well as '--' can introduce long-named options. */ int _getopt_internal (int argc, char *const *argv, const char *optstring, const struct option *longopts, int *longind, int long_only) { optarg = NULL; if (optind == 0 || !__getopt_initialized) { if (optind == 0) optind = 1; /* Don't scan ARGV[0], the program name. */ optstring = _getopt_initialize (argc, argv, optstring); __getopt_initialized = 1; } /* Test whether ARGV[optind] points to a non-option argument. Either it does not have option syntax, or there is an environment flag from the shell indicating it is not an option. The later information is only used when the used in the GNU libc. */ #ifdef _LIBC #define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \ || (optind < nonoption_flags_len \ && __getopt_nonoption_flags[optind] == '1')) #else #define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0') #endif if (nextchar == NULL || *nextchar == '\0') { /* Advance to the next ARGV-element. */ /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been moved back by the user (who may also have changed the arguments). */ if (last_nonopt > optind) last_nonopt = optind; if (first_nonopt > optind) first_nonopt = optind; if (ordering == PERMUTE) { /* If we have just processed some options following some non-options, exchange them so that the options come first. */ if (first_nonopt != last_nonopt && last_nonopt != optind) exchange ((char **) argv); else if (last_nonopt != optind) first_nonopt = optind; /* Skip any additional non-options and extend the range of non-options previously skipped. */ while (optind < argc && NONOPTION_P) optind++; last_nonopt = optind; } /* The special ARGV-element `--' means premature end of options. Skip it like a null option, then exchange with previous non-options as if it were an option, then skip everything else like a non-option. */ if (optind != argc && !strcmp (argv[optind], "--")) { optind++; if (first_nonopt != last_nonopt && last_nonopt != optind) exchange ((char **) argv); else if (first_nonopt == last_nonopt) first_nonopt = optind; last_nonopt = argc; optind = argc; } /* If we have done all the ARGV-elements, stop the scan and back over any non-options that we skipped and permuted. */ if (optind == argc) { /* Set the next-arg-index to point at the non-options that we previously skipped, so the caller will digest them. */ if (first_nonopt != last_nonopt) optind = first_nonopt; return -1; } /* If we have come to a non-option and did not permute it, either stop the scan or describe it to the caller and pass it by. */ if (NONOPTION_P) { if (ordering == REQUIRE_ORDER) return -1; optarg = argv[optind++]; return 1; } /* We have found another option-ARGV-element. Skip the initial punctuation. */ nextchar = (argv[optind] + 1 + (longopts != NULL && argv[optind][1] == '-')); } /* Decode the current option-ARGV-element. */ /* Check whether the ARGV-element is a long option. If long_only and the ARGV-element has the form "-f", where f is a valid short option, don't consider it an abbreviated form of a long option that starts with f. Otherwise there would be no way to give the -f short option. On the other hand, if there's a long option "fubar" and the ARGV-element is "-fu", do consider that an abbreviation of the long option, just like "--fu", and not "-f" with arg "u". This distinction seems to be the most useful approach. */ if (longopts != NULL && (argv[optind][1] == '-' || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1]))))) { char *nameend; const struct option *p; const struct option *pfound = NULL; int exact = 0; int ambig = 0; int indfound = -1; int option_index; for (nameend = nextchar; *nameend && *nameend != '='; nameend++) /* Do nothing. */ ; /* Test all long options for either exact match or abbreviated matches. */ for (p = longopts, option_index = 0; p->name; p++, option_index++) if (!strncmp (p->name, nextchar, nameend - nextchar)) { if ((unsigned int) (nameend - nextchar) == (unsigned int) strlen (p->name)) { /* Exact match found. */ pfound = p; indfound = option_index; exact = 1; break; } else if (pfound == NULL) { /* First nonexact match found. */ pfound = p; indfound = option_index; } else /* Second or later nonexact match found. */ ambig = 1; } if (ambig && !exact) { if (opterr) fprintf (stderr, _("%s: option `%s' is ambiguous\n"), argv[0], argv[optind]); nextchar += strlen (nextchar); optind++; optopt = 0; return '?'; } if (pfound != NULL) { option_index = indfound; optind++; if (*nameend) { /* Don't test has_arg with >, because some C compilers don't allow it to be used on enums. */ if (pfound->has_arg) optarg = nameend + 1; else { if (opterr) { if (argv[optind - 1][1] == '-') /* --option */ fprintf (stderr, _("%s: option `--%s' doesn't allow an argument\n"), argv[0], pfound->name); else /* +option or -option */ fprintf (stderr, _("%s: option `%c%s' doesn't allow an argument\n"), argv[0], argv[optind - 1][0], pfound->name); } nextchar += strlen (nextchar); optopt = pfound->val; return '?'; } } else if (pfound->has_arg == 1) { if (optind < argc) optarg = argv[optind++]; else { if (opterr) fprintf (stderr, _("%s: option `%s' requires an argument\n"), argv[0], argv[optind - 1]); nextchar += strlen (nextchar); optopt = pfound->val; return optstring[0] == ':' ? ':' : '?'; } } nextchar += strlen (nextchar); if (longind != NULL) *longind = option_index; if (pfound->flag) { *(pfound->flag) = pfound->val; return 0; } return pfound->val; } /* Can't find it as a long option. If this is not getopt_long_only, or the option starts with '--' or is not a valid short option, then it's an error. Otherwise interpret it as a short option. */ if (!long_only || argv[optind][1] == '-' || my_index (optstring, *nextchar) == NULL) { if (opterr) { if (argv[optind][1] == '-') /* --option */ fprintf (stderr, _("%s: unrecognized option `--%s'\n"), argv[0], nextchar); else /* +option or -option */ fprintf (stderr, _("%s: unrecognized option `%c%s'\n"), argv[0], argv[optind][0], nextchar); } nextchar = (char *) ""; optind++; optopt = 0; return '?'; } } /* Look at and handle the next short option-character. */ { char c = *nextchar++; char *temp = my_index (optstring, c); /* Increment `optind' when we start to process its last character. */ if (*nextchar == '\0') ++optind; if (temp == NULL || c == ':') { if (opterr) { if (posixly_correct) /* 1003.2 specifies the format of this message. */ fprintf (stderr, _("%s: illegal option -- %c\n"), argv[0], c); else fprintf (stderr, _("%s: invalid option -- %c\n"), argv[0], c); } optopt = c; return '?'; } /* Convenience. Treat POSIX -W foo same as long option --foo */ if (temp[0] == 'W' && temp[1] == ';') { char *nameend; const struct option *p; const struct option *pfound = NULL; int exact = 0; int ambig = 0; int indfound = 0; int option_index; /* This is an option that requires an argument. */ if (*nextchar != '\0') { optarg = nextchar; /* If we end this ARGV-element by taking the rest as an arg, we must advance to the next element now. */ optind++; } else if (optind == argc) { if (opterr) { /* 1003.2 specifies the format of this message. */ fprintf (stderr, _("%s: option requires an argument -- %c\n"), argv[0], c); } optopt = c; if (optstring[0] == ':') c = ':'; else c = '?'; return c; } else /* We already incremented `optind' once; increment it again when taking next ARGV-elt as argument. */ optarg = argv[optind++]; /* optarg is now the argument, see if it's in the table of longopts. */ for (nextchar = nameend = optarg; *nameend && *nameend != '='; nameend++) /* Do nothing. */ ; /* Test all long options for either exact match or abbreviated matches. */ for (p = longopts, option_index = 0; p->name; p++, option_index++) if (!strncmp (p->name, nextchar, nameend - nextchar)) { if ((unsigned int) (nameend - nextchar) == strlen (p->name)) { /* Exact match found. */ pfound = p; indfound = option_index; exact = 1; break; } else if (pfound == NULL) { /* First nonexact match found. */ pfound = p; indfound = option_index; } else /* Second or later nonexact match found. */ ambig = 1; } if (ambig && !exact) { if (opterr) fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"), argv[0], argv[optind]); nextchar += strlen (nextchar); optind++; return '?'; } if (pfound != NULL) { option_index = indfound; if (*nameend) { /* Don't test has_arg with >, because some C compilers don't allow it to be used on enums. */ if (pfound->has_arg) optarg = nameend + 1; else { if (opterr) fprintf (stderr, _("\ %s: option `-W %s' doesn't allow an argument\n"), argv[0], pfound->name); nextchar += strlen (nextchar); return '?'; } } else if (pfound->has_arg == 1) { if (optind < argc) optarg = argv[optind++]; else { if (opterr) fprintf (stderr, _("%s: option `%s' requires an argument\n"), argv[0], argv[optind - 1]); nextchar += strlen (nextchar); return optstring[0] == ':' ? ':' : '?'; } } nextchar += strlen (nextchar); if (longind != NULL) *longind = option_index; if (pfound->flag) { *(pfound->flag) = pfound->val; return 0; } return pfound->val; } nextchar = NULL; return 'W'; /* Let the application handle it. */ } if (temp[1] == ':') { if (temp[2] == ':') { /* This is an option that accepts an argument optionally. */ if (*nextchar != '\0') { optarg = nextchar; optind++; } else optarg = NULL; nextchar = NULL; } else { /* This is an option that requires an argument. */ if (*nextchar != '\0') { optarg = nextchar; /* If we end this ARGV-element by taking the rest as an arg, we must advance to the next element now. */ optind++; } else if (optind == argc) { if (opterr) { /* 1003.2 specifies the format of this message. */ fprintf (stderr, _("%s: option requires an argument -- %c\n"), argv[0], c); } optopt = c; if (optstring[0] == ':') c = ':'; else c = '?'; } else /* We already incremented `optind' once; increment it again when taking next ARGV-elt as argument. */ optarg = argv[optind++]; nextchar = NULL; } } return c; } } int getopt (int argc, char *const *argv, const char *optstring) { return _getopt_internal (argc, argv, optstring, (const struct option *) 0, (int *) 0, 0); } #endif /* Not ELIDE_CODE. */ #ifdef TEST /* Compile with -DTEST to make an executable for use in testing the above definition of `getopt'. */ int main (int argc, char **argv) { int c; int digit_optind = 0; while (1) { int this_option_optind = optind ? optind : 1; c = getopt (argc, argv, "abc:d:0123456789"); if (c == -1) break; switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': if (digit_optind != 0 && digit_optind != this_option_optind) printf ("digits occur in two different argv-elements.\n"); digit_optind = this_option_optind; printf ("option %c\n", c); break; case 'a': printf ("option a\n"); break; case 'b': printf ("option b\n"); break; case 'c': printf ("option c with value `%s'\n", optarg); break; case '?': break; default: printf ("?? getopt returned character code 0%o ??\n", c); } } if (optind < argc) { printf ("non-option ARGV-elements: "); while (optind < argc) printf ("%s ", argv[optind++]); printf ("\n"); } exit (0); } #endif /* TEST */ gnuserv-3.12.8/gnuslib.c0000444000175000017500000002742510706503603015031 0ustar martinsmartins/* -*-C-*- Common library code for the XEmacs server and client. This file is part of XEmacs. Copying is permitted under those conditions described by the GNU General Public License. Copyright (C) 1989 Free Software Foundation, Inc. Author: Andy Norman (ange@hplb.hpl.hp.com), based on 'etc/server.c' and 'etc/emacsclient.c' from the 18.52 GNU Emacs distribution. Please mail bugs and suggestions to the author at the above address. */ /* HISTORY * 11-Nov-1990 bristor@simba * Added EOT stuff. */ /* * This file incorporates new features added by Bob Weiner , * Darrell Kindred and Arup Mukherjee . * Please see the note at the end of the README file for details. * * (If gnuserv came bundled with your emacs, the README file is probably * ../etc/gnuserv.README relative to the directory containing this file) */ #if 0 static char rcsid [] = "!Header: gnuslib.c,v 2.4 95/02/16 11:57:37 arup alpha !"; #endif #include "gnuserv.h" #include #ifdef SYSV_IPC static int connect_to_ipc_server (void); #endif #ifdef UNIX_DOMAIN_SOCKETS static int connect_to_unix_server (void); #endif #ifdef INTERNET_DOMAIN_SOCKETS static int connect_to_internet_server (char *serverhost, unsigned short port); #endif /* On some systems, e.g. DGUX, inet_addr returns a 'struct in_addr'. */ #ifdef HAVE_BROKEN_INET_ADDR # define IN_ADDR struct in_addr # define NUMERIC_ADDR_ERROR (numeric_addr.s_addr == -1) #else # if (LONGBITS > 32) # define IN_ADDR unsigned int # else # define IN_ADDR unsigned long # endif # define NUMERIC_ADDR_ERROR (numeric_addr == (IN_ADDR) -1) #endif #include #include #include #include #ifdef HAVE_UNISTD_H #include #endif /* HAVE_UNISTD_H */ #ifdef HAVE_STRING_H #include #endif /* HAVE_STRING_H */ #include char *tmpdir = NULL; char *progname = NULL; int make_connection (char *hostarg, int portarg, int *s) { #ifdef INTERNET_DOMAIN_SOCKETS char *ptr; if (hostarg == NULL) hostarg = getenv("GNU_HOST"); if (portarg == 0 && (ptr=getenv("GNU_PORT")) != NULL) portarg = atoi(ptr); #endif if (hostarg != NULL) { /* hostname was given explicitly, via cmd line arg or GNU_HOST, * so obey it. */ #ifdef UNIX_DOMAIN_SOCKETS if (!strcmp(hostarg, "unix")) { *s = connect_to_unix_server(); return (int) CONN_UNIX; } #endif /* UNIX_DOMAIN_SOCKETS */ #ifdef INTERNET_DOMAIN_SOCKETS *s = connect_to_internet_server(hostarg, portarg); return (int) CONN_INTERNET; #endif #ifdef SYSV_IPC return -1; /* hostarg should always be NULL for SYSV_IPC */ #endif } else { /* no hostname given. Use unix-domain/sysv-ipc, or * internet-domain connection to local host if they're not available. */ #if defined(UNIX_DOMAIN_SOCKETS) *s = connect_to_unix_server(); return (int) CONN_UNIX; #elif defined(SYSV_IPC) *s = connect_to_ipc_server(); return (int) CONN_IPC; #elif defined(INTERNET_DOMAIN_SOCKETS) { char localhost[HOSTNAMSZ]; gethostname(localhost,HOSTNAMSZ); /* use this host by default */ *s = connect_to_internet_server(localhost, portarg); return (int) CONN_INTERNET; } #endif /* IPC type */ } } #ifdef SYSV_IPC /* connect_to_ipc_server -- establish connection with server process via SYSV IPC Returns msqid for server if successful. */ static int connect_to_ipc_server (void) { int s; /* connected msqid */ key_t key; /* message key */ char buf[GSERV_BUFSZ+1]; /* buffer for filename */ sprintf(buf,"%s/gsrv%d",tmpdir,(int)geteuid()); creat(buf,0600); if ((key = ftok(buf,1)) == -1) { perror(progname); fprintf(stderr, "%s: unable to get ipc key from %s\n", progname, buf); exit(1); } if ((s = msgget(key,0600)) == -1) { perror(progname); fprintf(stderr,"%s: unable to access msg queue\n",progname); exit(1); }; /* if */ return(s); } /* connect_to_ipc_server */ /* disconnect_from_ipc_server -- inform the server that sending has finished, and wait for its reply. */ void disconnect_from_ipc_server (int s, struct msgbuf *msgp, int echo) { int len; /* length of received message */ send_string(s,EOT_STR); /* EOT terminates this message */ msgp->mtype = 1; if(msgsnd(s,msgp,strlen(msgp->mtext)+1,0) < 0) { perror(progname); fprintf(stderr,"%s: unable to send message to server\n",progname); exit(1); }; /* if */ if((len = msgrcv(s,msgp,GSERV_BUFSZ,getpid(),0)) < 0) { perror(progname); fprintf(stderr,"%s: unable to receive message from server\n",progname); exit(1); }; /* if */ if (echo) { msgp->mtext[len] = '\0'; /* string terminate message */ fputs(msgp->mtext, stdout); if (msgp->mtext[len-1] != '\n') putchar ('\n'); }; /* if */ } /* disconnect_from_ipc_server */ #endif /* SYSV_IPC */ #if defined(INTERNET_DOMAIN_SOCKETS) || defined(UNIX_DOMAIN_SOCKETS) /* send_string -- send string to socket. */ void send_string (int s, const char *msg) { #if 0 if (send(s,msg,strlen(msg),0) < 0) { perror(progname); fprintf(stderr,"%s: unable to send\n",progname); exit(1); }; /* if */ #else int len, left=strlen(msg); while (left > 0) { if ((len=write(s,msg,min2(left,GSERV_BUFSZ))) < 0) { /* XEmacs addition: robertl@arnet.com */ if (errno == EPIPE) { return ; } perror(progname); fprintf(stderr,"%s: unable to send\n",progname); exit(1); }; /* if */ left -= len; msg += len; }; /* while */ #endif } /* send_string */ #endif /* INTERNET_DOMAIN_SOCKETS || UNIX_DOMAIN_SOCKETS */ /* read_line -- read a \n terminated line from a socket */ int read_line (int s, char *dest) { int length; int offset=0; char buffer[GSERV_BUFSZ+1]; while ((length=read(s,buffer+offset,1)>0) && buffer[offset]!='\n' && buffer[offset] != EOT_CHR) { offset += length; if (offset >= GSERV_BUFSZ) break; } buffer[offset] = '\0'; strcpy(dest,buffer); return 1; } /* read_line */ #ifdef UNIX_DOMAIN_SOCKETS /* connect_to_unix_server -- establish connection with server process via a unix- domain socket. Returns socket descriptor for server if successful. */ static int connect_to_unix_server (void) { int s; /* connected socket descriptor */ struct sockaddr_un server; /* for unix connections */ if ((s = socket(AF_UNIX,SOCK_STREAM,0)) < 0) { perror(progname); fprintf(stderr,"%s: unable to create socket\n",progname); exit(1); }; /* if */ server.sun_family = AF_UNIX; #ifdef HIDE_UNIX_SOCKET sprintf(server.sun_path,"%s/gsrvdir%d/gsrv",tmpdir,(int)geteuid()); #else /* HIDE_UNIX_SOCKET */ sprintf(server.sun_path,"%s/gsrv%d",tmpdir,(int)geteuid()); #endif /* HIDE_UNIX_SOCKET */ if (connect(s,(struct sockaddr *)&server,strlen(server.sun_path)+2) < 0) { perror(progname); fprintf(stderr,"%s: unable to connect to local\n",progname); exit(1); }; /* if */ return(s); } /* connect_to_unix_server */ #endif /* UNIX_DOMAIN_SOCKETS */ #ifdef INTERNET_DOMAIN_SOCKETS /* internet_addr -- return the internet addr of the hostname or internet address passed. Return -1 on error. */ int internet_addr (char *host) { struct hostent *hp; /* pointer to host info for remote host */ IN_ADDR numeric_addr; /* host address */ numeric_addr = inet_addr(host); if (!NUMERIC_ADDR_ERROR) return numeric_addr; else if ((hp = gethostbyname(host)) != NULL) return ((struct in_addr *)(hp->h_addr))->s_addr; else return -1; } /* internet_addr */ #ifdef AUTH_MAGIC_COOKIE # include # include static Xauth *server_xauth = NULL; #endif /* connect_to_internet_server -- establish connection with server process via an internet domain socket. Returns socket descriptor for server if successful. */ static int connect_to_internet_server (char *serverhost, unsigned short port) { int s; /* connected socket descriptor */ struct servent *sp; /* pointer to service information */ struct sockaddr_in peeraddr_in; /* for peer socket address */ char buf[512]; /* temporary buffer */ /* clear out address structures */ memset((char *)&peeraddr_in,0,sizeof(struct sockaddr_in)); /* Set up the peer address to which we will connect. */ peeraddr_in.sin_family = AF_INET; /* look up the server host's internet address */ if ((peeraddr_in.sin_addr.s_addr = internet_addr (serverhost)) == (unsigned int) -1) { fprintf (stderr, "%s: unable to find %s in /etc/hosts or from YP\n", progname, serverhost); exit(1); } if (port == 0) { if ((sp = getservbyname ("gnuserv","tcp")) == NULL) peeraddr_in.sin_port = htons(DEFAULT_PORT+getuid()); else peeraddr_in.sin_port = sp->s_port; } /* if */ else peeraddr_in.sin_port = htons(port); /* Create the socket. */ if ((s = socket (AF_INET,SOCK_STREAM, 0))== -1) { perror(progname); fprintf(stderr,"%s: unable to create socket\n",progname); exit(1); }; /* if */ /* Try to connect to the remote server at the address * which was just built into peeraddr. */ if (connect(s, (struct sockaddr *)&peeraddr_in, sizeof(struct sockaddr_in)) == -1) { perror(progname); fprintf(stderr, "%s: unable to connect to remote\n",progname); exit(1); }; /* if */ #ifdef AUTH_MAGIC_COOKIE /* send credentials using MIT-MAGIC-COOKIE-1 protocol */ server_xauth = XauGetAuthByAddr(FamilyInternet, sizeof(peeraddr_in.sin_addr.s_addr), (char *) &peeraddr_in.sin_addr.s_addr, strlen(MCOOKIE_SCREEN), MCOOKIE_SCREEN, strlen(MCOOKIE_X_NAME), MCOOKIE_X_NAME); if (server_xauth && server_xauth->data) { sprintf(buf, "%s\n%d\n", MCOOKIE_NAME, server_xauth->data_length); write (s, buf, strlen(buf)); write (s, server_xauth->data, server_xauth->data_length); return (s); } #endif /* AUTH_MAGIC_COOKIE */ sprintf (buf, "%s\n", DEFAUTH_NAME); write (s, buf, strlen(buf)); return(s); } /* connect_to_internet_server */ #endif /* INTERNET_DOMAIN_SOCKETS */ #if defined(INTERNET_DOMAIN_SOCKETS) || defined(UNIX_DOMAIN_SOCKETS) /* disconnect_from_server -- inform the server that sending has finished, and wait for its reply. */ void disconnect_from_server (int s, int echo) { #if 0 char buffer[REPLYSIZ+1]; #else char buffer[GSERV_BUFSZ+1]; #endif int add_newline = 1; int length; send_string(s,EOT_STR); /* make sure server gets string */ #if !defined (linux) && !defined (_SCO_DS) /* * shutdown is completely hozed under linux. If s is a unix domain socket, * you'll get EOPNOTSUPP back from it. If s is an internet socket, you get * a broken pipe when you try to read a bit later. The latter * problem is fixed for linux versions >= 1.1.46, but the problem * with unix sockets persists. Sigh. */ if (shutdown(s,1) == -1) { perror(progname); fprintf(stderr, "%s: unable to shutdown socket\n",progname); exit(1); }; /* if */ #endif #if 0 while((length = recv(s,buffer,REPLYSIZ,0)) > 0) { buffer[length] = '\0'; if (echo) fputs(buffer,stdout); add_newline = (buffer[length-1] != '\n'); }; /* while */ #else while ((length = read(s,buffer,GSERV_BUFSZ)) > 0 || (length == -1 && errno == EINTR)) { if (length > 0) { buffer[length] = '\0'; if (echo) { fputs(buffer,stdout); add_newline = (buffer[length-1] != '\n'); }; /* if */ }; /* if */ }; /* while */ #endif if (echo && add_newline) putchar('\n'); if(length < 0) { perror(progname); fprintf(stderr,"%s: unable to read the reply from the server\n",progname); exit(1); }; /* if */ } /* disconnect_from_server */ #endif /* INTERNET_DOMAIN_SOCKETS || UNIX_DOMAIN_SOCKETS */ gnuserv-3.12.8/mkinstalldirs0000755000175000017500000000133707045413341016025 0ustar martinsmartins#! /bin/sh # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman # Created: 1993-05-16 # Public domain # $Id: mkinstalldirs,v 1.1.2.1 1997/02/18 08:15:40 friedman Exp $ errstatus=0 for file do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= for d do pathcomp="$pathcomp$d" case "$pathcomp" in -* ) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" 1>&2 mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr fi fi pathcomp="$pathcomp/" done done exit $errstatus # mkinstalldirs ends here gnuserv-3.12.8/sysfile.h0000444000175000017500000003612010706477744015061 0ustar martinsmartins/* Copyright (C) 1995 Free Software Foundation, Inc. Copyright (C) 2000, 2001, 2002, 2004 Ben Wing. This file is part of XEmacs. XEmacs 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, or (at your option) any later version. XEmacs 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 XEmacs; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Synched up with: Not really in FSF. */ #ifndef INCLUDED_sysfile_h_ #define INCLUDED_sysfile_h_ /* The anonymous voice of the past says: Must come before sysfile.h So instead we just put it here. --ben */ #ifdef HAVE_LIBGEN_H #include #endif #include #ifndef WIN32_NATIVE # include /* does not always imply this */ #endif #ifdef HAVE_UNISTD_H # include #endif #ifndef INCLUDED_FCNTL # define INCLUDED_FCNTL # include #endif /* INCLUDED_FCNTL */ /* The anonymous voice of the past says: In some systems loading it twice is suicidal. */ #ifndef INCLUDED_SYS_TYPES # define INCLUDED_SYS_TYPES # include /* some typedefs are used in sys/file.h */ #endif /* INCLUDED_SYS_TYPES */ #ifndef WIN32_NATIVE # include #endif /* Some systems (SCO 3.2v5) do #define stat ... in this header. So it _must_ be included before any use of struct stat. Most emacs files should include sysfile.h. The unex*.c include directly. */ #include #ifdef WIN32_ANY # include #endif #ifdef WIN32_NATIVE # include #else /* Some configuration files' definitions for the LOAD_AVE_CVT macro (like sparc.h's) use macros like FSCALE, defined here. */ # ifdef HAVE_GTK /* I hate GTK */ # undef MIN # undef MAX # endif /* HAVE_GTK */ # include /* As per Martin's recommendation, we do not include this. There was a comment stating that stuff from here was needed on NeXT, Cygwin, and sunplay.c. However, Cygwin includes this automatically from fcntl.h, and Martin says that a "conforming" system should never need this. We will put it back if necessary on systems requiring it. */ /* # include */ #endif /* WIN32_NATIVE */ #ifndef STDERR_FILENO #define STDIN_FILENO 0 #define STDOUT_FILENO 1 #define STDERR_FILENO 2 #endif #ifndef O_RDONLY #define O_RDONLY 0 #endif #ifndef O_WRONLY #define O_WRONLY 1 #endif #ifndef O_RDWR #define O_RDWR 2 #endif /* file opening defaults */ #ifndef OPEN_BINARY #ifdef O_BINARY #define OPEN_BINARY O_BINARY #else #define OPEN_BINARY (0) #endif #endif #ifndef OPEN_TEXT #ifdef O_TEXT #define OPEN_TEXT O_TEXT #else #define OPEN_TEXT (0) #endif #endif #ifndef CREAT_MODE #ifdef WIN32_NATIVE #define CREAT_MODE (S_IREAD | S_IWRITE) #else #define CREAT_MODE (0666) #endif #endif #ifndef READ_TEXT #ifdef O_TEXT #define READ_TEXT "rt" #else #define READ_TEXT "r" #endif #endif #ifndef READ_BINARY #ifdef O_BINARY #define READ_BINARY "rb" #else #define READ_BINARY "r" #endif #endif #ifndef READ_PLUS_TEXT #ifdef O_TEXT #define READ_PLUS_TEXT "r+t" #else #define READ_PLUS_TEXT "r+" #endif #endif #ifndef READ_PLUS_BINARY #ifdef O_BINARY #define READ_PLUS_BINARY "r+b" #else #define READ_PLUS_BINARY "r+" #endif #endif #ifndef WRITE_TEXT #ifdef O_TEXT #define WRITE_TEXT "wt" #else #define WRITE_TEXT "w" #endif #endif #ifndef WRITE_BINARY #ifdef O_BINARY #define WRITE_BINARY "wb" #else #define WRITE_BINARY "w" #endif #endif #ifndef APPEND_TEXT #ifdef O_TEXT #define APPEND_TEXT "at" #else #define APPEND_TEXT "a" #endif #endif #ifndef APPEND_BINARY #ifdef O_BINARY #define APPEND_BINARY "ab" #else #define APPEND_BINARY "a" #endif #endif #ifndef O_NONBLOCK #ifdef O_NDELAY #define O_NONBLOCK O_NDELAY #else #define O_NONBLOCK 04000 #endif #endif #if !S_IRUSR # if S_IREAD # define S_IRUSR S_IREAD # else # define S_IRUSR 00400 # endif #endif #if !S_IWUSR # if S_IWRITE # define S_IWUSR S_IWRITE # else # define S_IWUSR 00200 # endif #endif #if !S_IXUSR # if S_IEXEC # define S_IXUSR S_IEXEC # else # define S_IXUSR 00100 # endif #endif #ifdef STAT_MACROS_BROKEN #undef S_ISBLK #undef S_ISCHR #undef S_ISDIR #undef S_ISFIFO #undef S_ISLNK #undef S_ISMPB #undef S_ISMPC #undef S_ISNWK #undef S_ISREG #undef S_ISSOCK #endif /* STAT_MACROS_BROKEN. */ #ifdef WIN32_NATIVE /* This is the standard value for S_IFLNK. All of the S_... flags that exist in the MSVCRT have standard values, so their bit tests will magically work. */ #define S_IFLNK 0120000 #endif #if !defined(S_ISBLK) && defined(S_IFBLK) #define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK) #endif #if !defined(S_ISCHR) && defined(S_IFCHR) #define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR) #endif #if !defined(S_ISDIR) && defined(S_IFDIR) #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) #endif #if !defined(S_ISREG) && defined(S_IFREG) #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) #endif #if !defined(S_ISFIFO) && defined(S_IFIFO) #define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO) #endif #if !defined(S_ISLNK) && defined(S_IFLNK) #define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) #endif #if !defined(S_ISSOCK) && defined(S_IFSOCK) #define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK) #endif #if !defined(S_ISMPB) && defined(S_IFMPB) /* V7 */ #define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB) #define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC) #endif #if !defined(S_ISNWK) && defined(S_IFNWK) /* HP/UX */ #define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK) #endif /* Determining the maximum pathname length. NOTE: IN GENERAL, YOU SHOULD NOT USE THIS. If at all possible, avoid using fixed-length buffers of any sort. You cannot guarantee on many systems that pathnames won't exceed these limits for one reason or another. Unfortunately, there is no universal agreement over whether these values should include a final null-terminator or not. Even recent versions of Linux (circa 2002) are switching from the not-including- terminator kind to the including-terminator kind. So we assume that the including-terminator kind will be even (usually is), and round up as necessary. */ #define ROUND_UP_TO_EVEN_NUMBER(val) (((val + 1) >> 1) << 1) #ifdef PATH_MAX # define QXE_PATH_MAX ROUND_UP_TO_EVEN_NUMBER (PATH_MAX) #elif defined (_MAX_PATH) /* MS Win -- and preferable to _POSIX_PATH_MAX, which is also defined */ # define QXE_PATH_MAX ROUND_UP_TO_EVEN_NUMBER (_MAX_PATH) #elif defined (_POSIX_PATH_MAX) # define QXE_PATH_MAX ROUND_UP_TO_EVEN_NUMBER (_POSIX_PATH_MAX) #elif defined (MAXPATHLEN) # define QXE_PATH_MAX ROUND_UP_TO_EVEN_NUMBER (MAXPATHLEN) #else # define QXE_PATH_MAX 1024 #endif /* Client .c files should use PATH_MAX_INTERNAL or PATH_MAX_EXTERNAL if they must use either one at all. */ /* Use for internally formatted text, which can potentially have up to four bytes per character */ #define PATH_MAX_INTERNAL (QXE_PATH_MAX * MAX_ICHAR_LEN) /* Use for externally formatted text. */ #define PATH_MAX_EXTERNAL (QXE_PATH_MAX * MAX_XETCHAR_SIZE) /* The following definitions are needed under Windows, at least */ #ifndef X_OK # define X_OK 1 #endif #ifndef R_OK # define R_OK 4 #endif #ifndef D_OK # define D_OK 8 #endif #ifndef W_OK # define W_OK 2 #endif #ifndef F_OK # define F_OK 0 #endif #ifndef FD_CLOEXEC # define FD_CLOEXEC 1 #endif #ifdef emacs /* Emacs needs to use its own definitions of certain system calls on some systems (like SunOS 4.1 and USG systems, where the read system call is interruptible but Emacs expects it not to be; and under MULE, where all filenames need to be converted to external format). We used to play preprocessor games, but in the long run that just leads you to ruin. So we explicitly put in the new calls, even if the source gets marginally less pretty. Current files where we don't use retry_ or qxe_ versions: -- all sound files except ntplay.c (includes esd.c libsst.[ch] libst.h linuxplay.c sgiplay.c sunplay.c hpplay.c nas.c) -- all unex* files -- hftctl.c -- lib-src files */ ssize_t retry_read (int, void *, size_t); ssize_t retry_write (int, const void *, size_t); int retry_open (const Extbyte *path, int oflag, ...); int qxe_open (const Ibyte *path, int oflag, ...); int qxe_interruptible_open (const Ibyte *path, int oflag, int mode); int retry_close (int); Bytecount read_allowing_quit (int fildes, void *buf, Bytecount size); Bytecount write_allowing_quit (int fildes, const void *buf, Bytecount size); /* Now the stdio versions ... */ size_t retry_fread (void *, size_t, size_t, FILE *); size_t retry_fwrite (const void *, size_t, size_t, FILE *); FILE *retry_fopen (const Extbyte *path, const Ascbyte *mode); FILE *qxe_fopen (const Ibyte *path, const Ascbyte *mode); int retry_fclose (FILE *); /* encapsulations: file-information calls */ int qxe_access (const Ibyte *path, int mode); int qxe_eaccess (const Ibyte *path, int mode); int qxe_lstat (const Ibyte *path, struct stat *buf); int qxe_readlink (const Ibyte *path, Ibyte *buf, size_t bufsiz); int qxe_fstat (int fd, struct stat *buf); int qxe_stat (const Ibyte *path, struct stat *buf); Ibyte *qxe_realpath (const Ibyte *path, Ibyte resolved_path [], Boolint links_only); /* encapsulations: file-manipulation calls */ int qxe_chmod (const Ibyte *path, mode_t mode); #if defined (HAVE_LINK) int qxe_link (const Ibyte *existing, const Ibyte *new_); #endif /* defined (HAVE_LINK) */ int qxe_rename (const Ibyte *old, const Ibyte *new_); #if defined (HAVE_SYMLINK) int qxe_symlink (const Ibyte *name1, const Ibyte *name2); #endif /* defined (HAVE_SYMLINK) */ int qxe_unlink (const Ibyte *path); /* definition in filemode.c must be declared here to ensure that struct stat is properly formed on systems like SCO 3.2v5 */ void filemodestring (struct stat *, char *); #ifdef WIN32_ANY extern int mswindows_shortcuts_are_symlinks; #endif #endif /* emacs */ #ifndef HAVE_H_ERRNO extern int h_errno; #endif #ifndef HAVE_DUP2 int dup2 (int oldd, int newd); #endif #ifndef HAVE_STRERROR /* X11R6 defines strerror as a macro */ # ifdef strerror # undef strerror # endif const char *strerror (int); #endif /* DEFAULT_DIRECTORY_SEP is the default value of Vdirectory_sep_char. DIRECTORY_SEP is the currently preferred separator between elements of a path, when paths are canonicalized. DEVICE_SEP is the separator between devices and paths (might not be defined). SEPCHAR is the separator between paths in a path search string (e.g. the PATH environment variable). IS_DIRECTORY_SEP() returns true if the character is any directory separator (there might be more than one allowed on a system.). IS_DEVICE_SEP() returns true if the character is a device separator. IS_ANY_SEP() returns true if the character is a directory or device separator. */ /* We used to put some of this stuff in the s+m files for the various types of MS Windows, but that's disingenuous. The various definitions above were specifically created for MS Windows, and the "if not, then let's define the defaults" stuff (formerly in lisp.h) specifically knows about what is going to get redefined and how, and code all over the place that works with filenames has to conditionalize on WIN32_NATIVE anyway. It's much clearer if we put all related definitions in one place. (In fact, I discovered a number of bugs in the process.) S+M files should be used for simple on-off or multiple-choice settings, or possibly string settings. Anything that gets to the level of programming should be elsewhere, and anything that ends up having lots of complicated interactions scattered around in many files should be consolidated. */ #ifdef WIN32_NATIVE #define SEPCHAR ';' #define DEFAULT_DIRECTORY_SEP '\\' #ifdef emacs DECLARE_INLINE_HEADER (Ibyte sysfile_get_directory_sep (void)) { if (!CHARP (Vdirectory_sep_char) || (XCHAR (Vdirectory_sep_char) != '/' && XCHAR (Vdirectory_sep_char) != '\\')) { warn_when_safe (Qfile_name, Qerror, "`directory-sep-char' set to invalid %s: resetting to %c.", DEFAULT_DIRECTORY_SEP); Vdirectory_sep_char = make_char (DEFAULT_DIRECTORY_SEP); } return XCHAR (Vdirectory_sep_char); } #define DIRECTORY_SEP sysfile_get_directory_sep() #else /* emacs */ /* The above Lisp variables are not available to make-docfile, etc. */ #define DIRECTORY_SEP DEFAULT_DIRECTORY_SEP #endif /* emacs */ #else /* not WIN32_NATIVE */ #define SEPCHAR ':' #define DEFAULT_DIRECTORY_SEP '/' #define DIRECTORY_SEP '/' #endif /* WIN32_NATIVE */ #ifdef WIN32_ANY #define DEVICE_SEP ':' #define IS_DEVICE_SEP(c) ((c) == DEVICE_SEP) #ifdef emacs DECLARE_INLINE_HEADER (int IS_DIRECTORY_SEP (Ichar c)) { return (c == '/' || c == '\\'); } DECLARE_INLINE_HEADER (int IS_ANY_SEP (Ichar c)) { return (c == '/' || c == '\\' || c == ':'); } #else /* emacs */ /* The Ichar typedef is not available to make-docfile, etc. */ DECLARE_INLINE_HEADER (int IS_DIRECTORY_SEP (int c)) { return (c == '/' || c == '\\'); } DECLARE_INLINE_HEADER (int IS_ANY_SEP (int c)) { return (c == '/' || c == '\\' || c == ':'); } #endif #else /* not WIN32_ANY */ #define IS_DEVICE_SEP(c) 0 #define IS_DIRECTORY_SEP(c) ((c) == DIRECTORY_SEP) #define IS_ANY_SEP(c) IS_DIRECTORY_SEP (c) #endif /* WIN32_ANY */ /* How long can a source filename be in DOC (including "\037S" at the start and "\n" at the end) ? */ #define DOC_MAX_FILENAME_LENGTH 2048 #ifdef emacs #if defined (WIN32_NATIVE) #define PATHNAME_RESOLVE_LINKS(path, pathout) \ do \ { \ if (mswindows_shortcuts_are_symlinks) \ { \ Ibyte *_prl_path_ = (Ibyte *) (path); \ Ibyte _prl_path2_[PATH_MAX_INTERNAL]; \ \ if (!qxe_realpath (_prl_path_, _prl_path2_, 1)) \ (pathout) = _prl_path_; \ else \ IBYTE_STRING_TO_ALLOCA (_prl_path2_, pathout); \ } \ else (pathout) = (Ibyte *) (path); \ } while (0) #else #define PATHNAME_RESOLVE_LINKS(path, pathout) ((pathout) = (Ibyte *) (path)) #endif #define LISP_PATHNAME_RESOLVE_LINKS(path, pathout) \ PATHNAME_RESOLVE_LINKS (XSTRING_DATA (path), pathout) /* The documentation in VC++ claims that the pathname library functions accept strings in the current locale-specific encoding, but that's false, because they just call the native Win32 routines directly, which always use the system-default encoding (which is what Qmswindows_tstr will give us when not XEUNICODE_P). */ #ifdef WIN32_NATIVE # define PATHNAME_CONVERT_OUT(path, pathout) \ do \ { \ const Ibyte *_pco_path_; \ PATHNAME_RESOLVE_LINKS (path, _pco_path_); \ C_STRING_TO_TSTR (_pco_path_, pathout); \ } while (0) #else # define PATHNAME_CONVERT_OUT(path, pathout) \ C_STRING_TO_EXTERNAL (path, pathout, Qfile_name) #endif #define LISP_PATHNAME_CONVERT_OUT(path, pathout) \ PATHNAME_CONVERT_OUT (XSTRING_DATA (path), pathout) #endif /* emacs */ #endif /* INCLUDED_sysfile_h_ */ gnuserv-3.12.8/README0000444000175000017500000002235210135155043014071 0ustar martinsmartinsThis is gnuserv 3.12 for GNU Emacs, available via: http://meltin.net/hacks/emacs/ Introduction ------------ gnuserv allows you to attach to an already running Emacs. This allows external programs to make use of Emacs' editing capabilities. It is like GNU Emacs' emacsserver/server.el, but has many more features. This is a standalone release of gnuserv for GNU Emacs, requiring compatibility code (gnuserv-compat.el) to make it work. It has been tested under GNU Emacs 19.34, 20.7, 21.3. Note that this version of gnuserv requires the newer style of Emacs customisation stuff that comes with Emacs 20 or higher. It might work with the unbundled version of custom for Emacs 19 (http://www.dina.kvl.dk/~abraham/custom/). Also, a hack has been added to do a simple emulation of the customisation stuff under 19.34 if custom.el can't be loaded. Note that creating a frame on a tty (via "gnuclient -nw ...") does not work. GNU Emacs doesn't support this functionality. Note that if you run XEmacs then you do not need this package, because gnuserv comes bundled with XEmacs. Also, if you have XEmacs installed, but want to use gnuserv under GNU Emacs (for some strange reason) then all you need is gnuserv-compat.el (and probably devices.el). You can just make a link from your GNU Emacs site-lisp directory to gnuserv.el in your XEmacs installation. Origins ------- * gnuserv.el, supporting C programs and manual page, from XEmacs 21.5.17 (http://www.xemacs.org/). * devices.el is from the w3 4.0pre.39 distribution. * Most of the other stuff (configure/make stuff, installation utilities, README.orig) is from Noah Friedman's fgnuserv package. I removed a patch for Emacs 18 from the distribution because it'd be quite difficult to make this version of gnuserv.el work with Emacs 18. What did I do? * Added gnuserv-compat.el to make gnuserv.el work with GNU Emacs. * Tweaked the configure/make stuff to make it work for the this version of gnuserv. Added some configure options, borrowed some configure stuff from XEmacs. * Minor changes/bug fixes to gnuclient.c, gnuslib.c and gnuserv.h: - A tweak of the #include for config.h in gnuserv.h. - Checks added to gnuserv.h for Internet domain sockets, Unix domain sockets and SYSV IPC, as handled by configure. Removed choice of default, since people shouldn't get things that they've configured out. - Slight modifications to gnuclient.c and gnuslib.c so that they compile if only one of INTERNET_DOMAIN_SOCKETS, UNIX_DOMAIN_SOCKETS and SYSV_IPC is defined. Installation ------------ Simple instructions: ./configure make make install This configures the gnuserv compilation process for your system, compiles C programs, and installs binaries, scripts and manual pages (under /usr/local). Please see INSTALL for details of how to customise things like installation paths. The current installation process doesn't install the elisp files, although it does byte-compile them. You should copy them to your site-lisp directory. Then add an autoload, as described in gnuserv-compat.el, to your ~/.emacs file or your site-lisp/site-start.el file. Known problems -------------- * SYSV_IPC version seems to crash under Linux (Debian GNU/Linux with libc6 2.2.5-14.1, GNU Emacs 21.2.90, and Linux 2.4.19 kernel). That is, if I say: ./configure --disable-internet-domain-sockets --disable-unix-domain-sockets make everything compiles, but gnuclient SEGVs when I try to run it. I backtracked and tried the previous version of gnuserv I had packaged and found that it no longer compiles with just SYSV_IPC, due to changes in system header files (and that's where my search for an answer to this problem ends for now! ;-). If you have any clues on the cause of the SEGV, please let me know. This works OK again under Linux (Debian GNU/Linux with libc6 2.3.2.ds1-18, GNU Emacs 21.3, and Linux 2.6.9 kernel). * Linking problems: If you experience unresolved symbols at link time this may be because you have installed GCC but are using the native linker that was bundled with your operating system (instead of the one from GNU binutils). This means that GCC's C preprocessor is able to find header files in /usr/local/include, but the native linker is not able to find libraries in /usr/local/lib. A possible solution to this is to set LDFLAGS to "-L/usr/local/lib" before running "./configure". If you're using a Bourne-compatible shell, you can do: LDFLAGS="-L/usr/local/lib" ./configure [options] Alternatively, something like: env LDFLAGS="-L/usr/local/lib" ./configure [options] works with many systems/shells. Note that you will need to do a "make distclean" before doing this (to ensure that there is no stale config.{cache,status}). The alternative would be to make major modifications to configure.in. * Sometimes when you build and install gnuserv, and run gnuclient, you will see weird errors like: (invalid-function 1) with a backtrace like: Debugger entered--Lisp error: (invalid-function 1) signal(invalid-function (1)) [...] gnuserv-process-filter(# "4 (1 . \"/home/ulib/.bashrc\")))") or similar invalid lisp being passed to gnuserv. This is probably because the initial part of the lisp command is not being sent. This happens when configure can't find any window systems (or similar), so gnuclient doesn't include the required piece of code. gnuserv doesn't actually use any window system code, but does need to know which one is available so gnuclient knows what sort of editing session to request. A workaround is to do: rm config.cache ./configure --x-includes=/usr/local/include --x-libraries=/usr/local/lib Actually, /tmp is probably a bad choice, since someone could put something malicious there, but I'm sure you get the idea. Of course, you can use additional options to configure... Thanks to Uli Bubenheimer for helping me tracking this one down. * If you use SSH to connect to a machine that is already running Emacs/gnuserv, and then try to connect using gnuclient, Emacs may exit or behave weirdly. This is an Emacs/X problem, since Emacs can't find SSH's temporary cookie file. The whole situation can't be easily fixed in Emacs or gnuserv, but Emacs should not crash. A work-around that allows you to connect is to do this: xauth extract - $DISPLAY | xauth -f .Xauthority merge - in the SSH session. This puts the cookie for the SSH session's display into the standard .Xauthority file so Emacs/X can find it. Thanks to Martin Thornquist for providing this work-around. He got it from Frode Vatvedt Fjeld . * If you've done the above and used gnuserv via SSH, then you probably can't close the SSH session. This is because Emacs doesn't disconnect from a display when it has no more frames open on it. The following very, very gross hack seems to do the trick: (defun x-close-connection-if-no-frames (display) "Close an open connection to DISPLAY if DISPLAY has no frames." (if (and (member display (x-display-list)) (not (eval (cons 'or (mapcar '(lambda (f) (equal (frame-parameter f 'display) display)) (frame-list)))))) (x-close-connection display))) (defadvice delete-frame (around x-close-connection-delete-frame first nil activate) (let ((display (frame-parameter frame 'display))) ad-do-it (x-close-connection-if-no-frames display))) dtemacs ------- Also available is a script called dtemacs. This can be used to invoke an editing session within Emacs and has been used to integrate Emacs into desktop environments like CDE or KDE. If Emacs can not be contacted using gnuserv, Emacs is executed and left iconified. Either way, a new frame is opened to edit the specified files. Get it from: http://meltin.net/hacks/emacs/src/dtemacs I've told Gnome to use dtemacs as the default editor. Previously, I told KDE to use dtemacs for various types of text and program files. TODO ---- Not all of the configure options are defined or work properly: * I don't know how to define SOCKADDR_SUN_LEN and BROKEN_INET_ADDR. Maintenance ----------- Please report problems about the following to me: * gnuserv-compat.el (elisp errors from gnuserv.el in GNU Emacs) * the configuration & installation procedure * total failures to get this version of gnuserv to do anything! If you're sure you have found a bug in the C code (not likely to be caused by my changes) or gnuserv.el then, of course, feel free to contact the maintainers of those components. If you're not sure then please check with me. I'd hate to bother other people with problems that I've created! My plan it to grab each new version of gnuserv as it appears, package it and release it. Please feel free to make suggestions, but remember that I'm trying to change as little of the original gnuserv code as possible. My goal is to just to make new versions of gnuserv work with GNU Emacs. Martin Schwenke http://meltin.net/people/martin/ gnuserv-3.12.8/compiler.h0000644000175000017500000002415310706501036015200 0ustar martinsmartins/* Compiler-specific definitions for XEmacs. Copyright (C) 1998-1999, 2003 Free Software Foundation, Inc. Copyright (C) 1994 Richard Mlynarik. Copyright (C) 1995, 1996, 2000-2004 Ben Wing. This file is part of XEmacs. XEmacs 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, or (at your option) any later version. XEmacs 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 XEmacs; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Synched up with: not in FSF. */ /* Authorship: NOT_REACHED, DOESNT_RETURN, PRINTF_ARGS by Richard Mlynarik, c. 1994. RETURN_SANS_WARNING by Martin buchholz, 1998 or 1999. Many changes and improvements by Jerry James, 2003. Split out of lisp.h, reorganized, and modernized. {BEGIN,END}_C_DECLS, NEED_GCC, GCC_VERSION ATTRIBUTE_MALLOC, ATTRIBUTE_CONST, ATTRIBUTE_PURE, UNUSED */ #ifndef INCLUDED_compiler_h #define INCLUDED_compiler_h /* Define min() and max(). (Some compilers put them in strange places that won't be referenced by include files used by XEmacs, such as `macros.h' under Solaris.) */ #ifndef min # define min(a,b) (((a) <= (b)) ? (a) : (b)) #endif #ifndef max # define max(a,b) (((a) > (b)) ? (a) : (b)) #endif /* Regular C complains about possible clobbering of local vars NOT declared as volatile if there's a longjmp() in a function. C++ complains if such vars ARE volatile; or more correctly, sans volatile no problem even when you longjmp, avec volatile you get unfixable compile errors like /src/xemacs/lilfix/src/process-unix.c: In function `void unix_send_process(Lisp_Object, lstream*)': /src/xemacs/lilfix/src/process-unix.c:1577: no matching function for call to ` Lisp_Object::Lisp_Object(volatile Lisp_Object&)' /src/xemacs/lilfix/src/lisp-union.h:32: candidates are: Lisp_Object::Lisp_Object(const Lisp_Object&) */ #ifdef __cplusplus # define VOLATILE_IF_NOT_CPP #else # define VOLATILE_IF_NOT_CPP volatile #endif /* Avoid indentation problems when XEmacs sees the curly braces */ #ifndef BEGIN_C_DECLS # ifdef __cplusplus # define BEGIN_C_DECLS extern "C" { # define END_C_DECLS } # else # define BEGIN_C_DECLS # define END_C_DECLS # endif #endif /* Guard against older gccs that did not define all of these symbols */ #ifdef __GNUC__ # ifndef __GNUC_MINOR__ # define __GNUC_MINOR__ 0 # endif # ifndef __GNUC_PATCHLEVEL__ # define __GNUC_PATCHLEVEL__ 0 # endif #endif /* __GNUC__ */ /* Simplify testing for specific GCC versions. For non-GNU compilers, GCC_VERSION evaluates to zero. */ #ifndef NEED_GCC # define NEED_GCC(major,minor,patch) (major * 1000000 + minor * 1000 + patch) #endif /* NEED_GCC */ #ifndef GCC_VERSION # ifdef __GNUC__ # define GCC_VERSION NEED_GCC (__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__) # else # define GCC_VERSION 0 # endif /* __GNUC__ */ #endif /* GCC_VERSION */ #ifdef _MSC_VER #define MSC_VERSION _MSC_VER #else #define MSC_VERSION 0 #endif /* GCC < 2.6.0 could only declare one attribute per function. In that case, we define DOESNT_RETURN in preference to PRINTF_ARGS, which is only used for checking args against the string spec. */ #ifndef PRINTF_ARGS # if (GCC_VERSION >= NEED_GCC (2, 6, 0)) # define PRINTF_ARGS(string_index,first_to_check) \ __attribute__ ((format (printf, string_index, first_to_check))) # else # define PRINTF_ARGS(string_index,first_to_check) # endif /* GNUC */ #endif #ifndef DOESNT_RETURN_TYPE # if (GCC_VERSION > NEED_GCC (0, 0, 0)) # if (GCC_VERSION >= NEED_GCC (2, 5, 0)) # ifndef __INTEL_COMPILER # define RETURN_NOT_REACHED(value) DO_NOTHING # endif # define DOESNT_RETURN_TYPE(rettype) rettype # define DECLARE_DOESNT_RETURN_TYPE(rettype,decl) rettype decl \ __attribute__ ((noreturn)) # else /* GCC_VERSION < NEED_GCC (2, 5, 0) */ # define DOESNT_RETURN_TYPE(rettype) rettype volatile # define DECLARE_DOESNT_RETURN_TYPE(rettype,decl) rettype volatile decl # endif /* GCC_VERSION >= NEED_GCC (2, 5, 0) */ # elif (MSC_VERSION >= 1200) /* MSVC 6.0 has a mechanism to declare functions which never return */ # define DOESNT_RETURN_TYPE(rettype) __declspec(noreturn) rettype # define DECLARE_DOESNT_RETURN_TYPE(rettype,decl) \ __declspec(noreturn) rettype XCDECL decl # if (MSC_VERSION >= 1300) /* VC++ 7 issues warnings about return statements in __declspec(noreturn) functions; this problem didn't exist under VC++ 6 */ # define RETURN_NOT_REACHED(value) DO_NOTHING # endif # else /* not gcc, VC++ */ # define DOESNT_RETURN_TYPE(rettype) rettype # define DECLARE_DOESNT_RETURN_TYPE(rettype,decl) rettype decl # endif /* GCC_VERSION > NEED_GCC (0, 0, 0) */ #endif /* DOESNT_RETURN_TYPE */ #ifndef DOESNT_RETURN # define DOESNT_RETURN DOESNT_RETURN_TYPE (void) # define DECLARE_DOESNT_RETURN(decl) DECLARE_DOESNT_RETURN_TYPE (void, decl) #endif /* DOESNT_RETURN */ /* Another try to fix SunPro C compiler warnings */ /* "end-of-loop code not reached" */ /* "statement not reached */ #if defined __SUNPRO_C || defined __USLC__ # define RETURN_SANS_WARNINGS if (1) return # define RETURN_NOT_REACHED(value) DO_NOTHING #endif /* More ways to shut up compiler. This works in Fcommand_loop_1(), where there's an infinite loop in a function returning a Lisp object. */ #if (defined (_MSC_VER) && MSC_VERSION < 1300) || defined (__SUNPRO_C) || \ defined (__SUNPRO_CC) || (defined (DEC_ALPHA) && defined (OSF1)) # define DO_NOTHING_DISABLING_NO_RETURN_WARNINGS if (0) return Qnil #else # define DO_NOTHING_DISABLING_NO_RETURN_WARNINGS DO_NOTHING #endif #ifndef RETURN_NOT_REACHED # define RETURN_NOT_REACHED(value) return (value) #endif #ifndef RETURN_SANS_WARNINGS # define RETURN_SANS_WARNINGS return #endif #ifndef DO_NOTHING # define DO_NOTHING do {} while (0) #endif #ifndef DECLARE_NOTHING # define DECLARE_NOTHING struct nosuchstruct #endif #ifndef ATTRIBUTE_MALLOC # if (GCC_VERSION >= NEED_GCC (2, 96, 0)) # define ATTRIBUTE_MALLOC __attribute__ ((__malloc__)) # else # define ATTRIBUTE_MALLOC # endif /* GCC_VERSION >= NEED_GCC (2, 96, 0) */ #endif /* ATTRIBUTE_MALLOC */ #ifndef ATTRIBUTE_PURE # if (GCC_VERSION >= NEED_GCC (2, 96, 0)) # define ATTRIBUTE_PURE __attribute__ ((pure)) # else # define ATTRIBUTE_PURE # endif /* GCC_VERSION >= NEED_GCC (2, 96, 0) */ #endif /* ATTRIBUTE_PURE */ #ifndef ATTRIBUTE_CONST # if (GCC_VERSION >= NEED_GCC (2, 5, 0)) # define ATTRIBUTE_CONST __attribute__ ((const)) # define CONST_FUNC # else # define ATTRIBUTE_CONST # define CONST_FUNC const # endif /* GCC_VERSION >= NEED_GCC (2, 5, 0) */ #endif /* ATTRIBUTE_CONST */ /* Unused declarations; g++ and icc do not support this. */ /* NOTE: These macros MUST be named UNUSED (exactly) or something prefixed with USED_IF_, or DEFUN docstrings will be parsed incorrectly. See comments in make_docfile.c (write_c_args). You'd think that this wouldn't happen, but unfortunately we do indeed have some arguments of DEFUNs unused for GNU compatibility or because features are missing. */ #ifndef UNUSED_ARG # define UNUSED_ARG(decl) unused_##decl #endif #ifndef UNUSED # if defined(__GNUC__) && !defined(__cplusplus) && !defined(__INTEL_COMPILER) # define ATTRIBUTE_UNUSED __attribute__ ((unused)) # else # define ATTRIBUTE_UNUSED # endif # define UNUSED(decl) UNUSED_ARG (decl) ATTRIBUTE_UNUSED # ifdef MULE # define USED_IF_MULE(decl) decl # else # define USED_IF_MULE(decl) UNUSED (decl) # endif # if defined (MULE) || defined (ERROR_CHECK_TEXT) # define USED_IF_MULE_OR_CHECK_TEXT(decl) decl # else # define USED_IF_MULE_OR_CHECK_TEXT(decl) UNUSED (decl) # endif # ifdef USE_XFT # define USED_IF_XFT(decl) decl # else # define USED_IF_XFT(decl) UNUSED (decl) # endif #endif /* UNUSED */ #ifdef DEBUG_XEMACS # define REGISTER # define register #else # define REGISTER register #endif #if defined(HAVE_MS_WINDOWS) && defined(HAVE_SHLIB) # ifdef EMACS_MODULE # define MODULE_API __declspec(dllimport) # else # define MODULE_API __declspec(dllexport) # endif #else # define MODULE_API #endif /* Under "strict-aliasing" assumptions, you're not necessarily allowed to access the same memory address as two different types. The proper way around that is with a union. The macros below help out, e.g. the definition of XE_MAKEPOINTS(val) is ANSI_ALIASING_TYPEDEF (POINTS, POINTS); #define XE_MAKEPOINTS(l) ANSI_ALIASING_CAST (POINTS, l) replacing BAD!!! #define XE_MAKEPOINTS(l) (* (POINTS *) &(l)) On the other hand, if you are just casting from one pointer to the other in order to pass a pointer to another function, it's probably OK to just trick GCC by inserting an intermediate cast to (void *), to avoid warnings about "dereferencing type-punned pointer". #### I don't know how kosher this is, but do strict-aliasing rules really apply across functions? Note that the input to e.g. VOIDP_CAST must be an lvalue (i.e. not &(something)), but the value of the macro is also an lvalue, so in place of `(void **) &foo' you could write `& VOIDP_CAST (foo)' if you are subsequently dereferencing the value or don't feel comfortable doing a trick like `(void **) (void *) &foo'. Unfortunately, it does not work to just define the union type on the fly in the cast -- otherwise, we could avoid the need for a typedef. Or rather, it does work under gcc but not under Visual C++. --ben */ #define ANSI_ALIASING_TYPEDEF(name, type) typedef union { char c; type p; } *ANSI_ALIASING_##name #define ANSI_ALIASING_CAST(name, val) (((ANSI_ALIASING_##name) &(val))->p) ANSI_ALIASING_TYPEDEF (voidp, void *); /* VOIDP_CAST: Cast an lvalue to (void *) in a way that is ANSI-aliasing safe and will not result in GCC warnings. The result is still an lvalue, so you can assign to it or take its address. */ #define VOIDP_CAST(l) ANSI_ALIASING_CAST (voidp, l) #endif /* INCLUDED_compiler_h */ gnuserv-3.12.8/gnudoit0000555000175000017500000000201707045413340014607 0ustar martinsmartins#! /bin/sh # This file is part of XEmacs. # Copyright (C) 1997 Free Software Foundation, Inc. # XEmacs 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, or (at your option) any # later version. # XEmacs 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 XEmacs; see the file COPYING. If not, write to # the Free Software Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. if [ x"$1" = x-q ] then quick=-q shift fi if [ $# -eq 0 ] then exec gnuclient $quick -batch else # I use "$*" instead of "$@" intentionally -- I don't want to have the # arguments split. exec gnuclient $quick -batch -eval "$*" fi gnuserv-3.12.8/configure.in0000444000175000017500000000606210135336760015531 0ustar martinsmartinsdnl Process this file with autoconf 2.x to produce a configure script. AC_REVISION([$Id: configure.in,v 1.7 2004/10/20 01:22:56 martins Exp $]) AC_PREREQ(2.12)dnl Minimum Autoconf version required. AC_INIT(gnuserv.c) AC_CONFIG_HEADER(config.h) AC_PROG_CC AC_PROG_INSTALL AC_C_CONST AC_ARG_WITH_RESOLV AC_ARG_ENABLE_XAUTH AC_DECL_SYS_SIGLIST AC_HEADER_STDC AC_CHECK_HEADERS(string.h unistd.h) AC_CHECK_HEADERS(sys/types.h sys/select.h sys/socket.h sys/time.h) AC_CHECK_HEADERS(libintl.h sys/un.h) AC_CHECK_HEADERS(sgtty.h bsd/sgtty.h) dnl From xemacs-21.2.43/configure.in dnl check for Unix98 socklen_t AC_MSG_CHECKING(for socklen_t) AC_TRY_COMPILE([ #include socklen_t x; ],[],[AC_MSG_RESULT(yes)],[ AC_TRY_COMPILE([ #include int accept (int, struct sockaddr *, size_t *); ],[],[ AC_MSG_RESULT(size_t) AC_DEFINE(socklen_t,size_t)], [ AC_MSG_RESULT(int) AC_DEFINE(socklen_t,int)])]) AC_CHECK_SIZEOF(long, 32) AC_HAVE_XAUTH if test "$have_x" = "yes"; then AC_DEFINE(HAVE_X_WINDOWS) else AC_ERROR([X development files not found - install them or force with: ./configure \ --x-includes=/usr/local/include \ --x-libraries=/usr/local/lib \ ... It does not matter if the headers and libraries aren't actually there! Sorry: no options currently exist for GTK+ or MS Windows.]) fi AC_CHECK_LIB(socket, socket) AC_CHECK_LIB(nsl, inet_ntoa) AC_CHECK_LIB(intl, gettext) AC_USE_RESOLV AC_CHECK_FUNCS(getcwd memcmp strerror) AC_ARG_ENABLE(internet-domain-sockets, [ --disable-internet-domain-sockets Do not use Internet domain sockets]) if test "$enable_internet_domain_sockets" != "no" ; then AC_MSG_CHECKING([for internet-domain sockets]) AC_EGREP_CPP([yes],[ #include #ifdef AF_INET yes #endif ], [AC_DEFINE(HAVE_INTERNET_DOMAIN_SOCKETS) AC_MSG_RESULT(yes) AC_MSG_CHECKING("for sun_len member in struct sockaddr_un") AC_TRY_LINK([ #include #include #include ], [static struct sockaddr_un x; x.sun_len = 1;], [AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SOCKADDR_SUN_LEN)], [AC_MSG_RESULT(no)])], [AC_MSG_RESULT(no)]) fi AC_ARG_ENABLE(internet-unix-sockets, [ --disable-unix-domain-sockets Do not use Unix domain sockets]) if test "$enable_unix_domain_sockets" != "no" ; then AC_MSG_CHECKING([for unix-domain sockets]) AC_EGREP_CPP(yes,[ #include #ifdef AF_UNIX yes #endif ], [AC_DEFINE(HAVE_UNIX_DOMAIN_SOCKETS) AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)]) fi AC_ARG_ENABLE(sysv-ipc, [ --disable-sysv-ipc Do not use SYSV IPC]) if test "$enable_sysv_ipc" != "no" ; then AC_CHECK_FUNCS(msgget,[AC_DEFINE(HAVE_SYSVIPC)]) fi AC_MSG_CHECKING(for GNU libc) AC_TRY_COMPILE([#include ],[ #if ! (defined __GLIBC__ || defined __GNU_LIBRARY__) #error Not a GNU libc system :-( ******* ======= ******** &&&&&&&& #endif ], have_glibc=yes, have_glibc=no) AC_MSG_RESULT($have_glibc) test "$have_glibc" = "yes" && AC_DEFINE(_GNU_SOURCE) AC_OUTPUT(Makefile) gnuserv-3.12.8/syssignal.h0000444000175000017500000002377610706477671015433 0ustar martinsmartins/* syssignal.h - System-dependent definitions for signals. Copyright (C) 1992, 1993 Free Software Foundation, Inc. Copyright (C) 1996 Ben Wing. This file is part of XEmacs. XEmacs 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, or (at your option) any later version. XEmacs 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 XEmacs; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Synched up with: FSF 19.30. */ #ifndef INCLUDED_syssignal_h_ #define INCLUDED_syssignal_h_ /* In the old world, one could not #include here. The party line was that that header should always be #included before , because some configuration files (like s/hpux.h) indicate that SIGIO doesn't work by #undef-ing SIGIO, and if this file #includes , then that will re-#define SIGIO and confuse things. This was, however, a completely fucked up state of affairs, because on some systems it's necessary for the s/m files to #define things in order to get to provide the right typedefs, etc. And it's generally a broken concept for to not be the very very first file included. So instead of #undef'ing SIGIO in the various s/m files, I've changed them to define BROKEN_SIGIO instead, then we (syssignal.h) do an #undef SIGIO at the end, after including signal.h. Therefore, it's important that not be included after "syssignal.h", but that's the normal state: nothing should be directly including these days. -- jwz, 29-nov-93 */ #include #include /* SIGPOLL is the SVR4 signal. Those systems generally define SIGIO as an alias for SIGPOLL, but just in case ... */ #if defined (BROKEN_SIGIO) # if defined (SIGIO) && defined (SIGPOLL) # if SIGIO == SIGPOLL # undef SIGIO # undef SIGPOLL # else # undef SIGIO # endif # endif #else /* Not BROKEN_SIGIO */ # if !defined (SIGIO) && defined (SIGPOLL) # define SIGIO SIGPOLL # endif #endif /* Define SIGCHLD as an alias for SIGCLD. There are many conditionals testing SIGCHLD. */ #if defined (SIGCLD) && !defined (SIGCHLD) # define SIGCHLD SIGCLD #endif /* SIGCHLD */ #ifdef BROKEN_SIGCHLD #undef SIGCHLD #endif #ifdef SIGCHLD #define EMACS_BLOCK_SIGCHLD EMACS_BLOCK_SIGNAL (SIGCHLD) #define EMACS_UNBLOCK_SIGCHLD EMACS_UNBLOCK_SIGNAL (SIGCHLD) #else #define EMACS_BLOCK_SIGCHLD #define EMACS_UNBLOCK_SIGCHLD #endif /* According to W.R. Stevens __Advanced Programming in the Unix Environment__, there are four different paradigms for handling signals. We use autoconf to tell us which one applies. Note that on some systems, more than one paradigm is implemented (typically, the POSIX sigaction/sigprocmask and either the older SYSV or BSD way). In such a case, we prefer the POSIX way. We used to say this: [[ NOTE: We use EMACS_* macros for most signal operations, but just signal() for the standard signal-setting operation. Perhaps we should change this to EMACS_SIGNAL(), but that runs the risk of someone forgetting this convention and calling signal() directly. ]] But current policy is to avoid playing with macros as much as possible, since in the long run it really just ends up creating unmaintainable code -- someone newly reading the code is never going to realize exactly which calls are redirected, and on which systems, and where the redirection occurs. Possibly we should use the new "qxe" convention. */ #ifndef NeXT typedef RETSIGTYPE (XCDECL * signal_handler_t) (int); #endif #if defined (HAVE_SIGPROCMASK) /* The POSIX way (sigaction, sigprocmask, sigpending, sigsuspend) */ signal_handler_t qxe_reliable_signal (int signal_number, signal_handler_t action); #define EMACS_SIGNAL qxe_reliable_signal #define EMACS_BLOCK_SIGNAL(sig) do \ { \ sigset_t ES_mask; \ sigemptyset (&ES_mask); \ sigaddset (&ES_mask, sig); \ sigprocmask (SIG_BLOCK, &ES_mask, NULL); \ } while (0) #define EMACS_UNBLOCK_SIGNAL(sig) do \ { \ sigset_t ES_mask; \ sigemptyset (&ES_mask); \ sigaddset (&ES_mask, sig); \ sigprocmask (SIG_UNBLOCK, &ES_mask, NULL); \ } while (0) #define EMACS_UNBLOCK_ALL_SIGNALS() do \ { \ sigset_t ES_mask; \ sigemptyset (&ES_mask); \ sigprocmask (SIG_SETMASK, &ES_mask, NULL); \ } while (0) #define EMACS_WAIT_FOR_SIGNAL(sig) do \ { \ sigset_t ES_mask; \ sigprocmask (0, NULL, &ES_mask); \ sigdelset (&ES_mask, sig); \ sigsuspend (&ES_mask); \ } while (0) #define EMACS_REESTABLISH_SIGNAL(sig, handler) #define SIG_ARG_MAYBE_UNUSED(decl) UNUSED (decl) #elif defined (HAVE_SIGBLOCK) /* The older BSD way (signal/sigvec, sigblock, sigsetmask, sigpause) */ /* It's OK to use signal() here directly. No unreliable signal problems. However, we use sigvec() because it allows us to request interruptible I/O. */ #define EMACS_SIGNAL qxe_reliable_signal /* Is it necessary to define sigmask like this? */ #ifndef sigmask # define sigmask(no) (1L << ((no) - 1)) #endif #define EMACS_BLOCK_SIGNAL(sig) sigblock (sigmask (sig)) #define EMACS_UNBLOCK_SIGNAL(sig) sigsetmask (sigblock (0) & ~sigmask (sig)) #define EMACS_UNBLOCK_ALL_SIGNALS() sigsetmask (0) #define EMACS_WAIT_FOR_SIGNAL(sig) do \ { \ int ES_mask = sigblock (0); \ sigpause (ES_mask & ~sigmask (sig)); \ } while (0) #define EMACS_REESTABLISH_SIGNAL(sig, handler) #define SIG_ARG_MAYBE_UNUSED(decl) UNUSED (decl) #elif defined (HAVE_SIGHOLD) /* The older SYSV way (signal/sigset, sighold, sigrelse, sigignore, sigpause) */ #define EMACS_SIGNAL sigset #define EMACS_BLOCK_SIGNAL(sig) sighold (sig) #define EMACS_UNBLOCK_SIGNAL(sig) sigrelse (sig) /* #### There's not really any simple way to implement this. Since EMACS_UNBLOCK_ALL_SIGNALS() is only called once (at startup), it's probably OK to just ignore it. */ #define EMACS_UNBLOCK_ALL_SIGNALS() 0 #define EMACS_WAIT_FOR_SIGNAL(sig) sigpause (sig) #define EMACS_REESTABLISH_SIGNAL(sig, handler) #define SIG_ARG_MAYBE_UNUSED(decl) UNUSED (decl) #elif defined (WIN32_NATIVE) /* MS Windows signal emulation (in turns emulates the sigset/sighold paradigm) */ #define EMACS_SIGNAL mswindows_sigset #define EMACS_BLOCK_SIGNAL(sig) mswindows_sighold (sig) #define EMACS_UNBLOCK_SIGNAL(sig) mswindows_sigrelse (sig) /* #### There's not really any simple way to implement this. Since EMACS_UNBLOCK_ALL_SIGNALS() is only called once (at startup), it's probably OK to just ignore it. */ #define EMACS_UNBLOCK_ALL_SIGNALS() 0 #define EMACS_WAIT_FOR_SIGNAL(sig) mswindows_sigpause (sig) #define EMACS_REESTABLISH_SIGNAL(sig, handler) #define SIG_ARG_MAYBE_UNUSED(decl) UNUSED (decl) /* Defines that we need that aren't in the standard signal.h */ #define SIGHUP 1 /* Hang up */ #define SIGQUIT 3 /* Quit process */ #define SIGKILL 9 /* Die, die die */ #define SIGALRM 14 /* Alarm */ #define SIGPROF 29 /* Profiling timer exp */ #else /* The oldest SYSV way (signal only; unreliable signals) */ /* Old USG systems don't really have signal blocking. We indicate this by not defining EMACS_BLOCK_SIGNAL or EMACS_WAIT_FOR_SIGNAL. */ #define EMACS_SIGNAL signal #define EMACS_UNBLOCK_SIGNAL(sig) 0 #define EMACS_UNBLOCK_ALL_SIGNALS() 0 #define EMACS_REESTABLISH_SIGNAL(sig, handler) do \ { \ int old_errno = errno; \ signal (sig, handler); \ errno = old_errno; \ } while (0) #define SIG_ARG_MAYBE_UNUSED(decl) decl /* Under SYSV, setting a signal handler for SIGCLD causes SIGCLD to immediately be sent if there any unwaited processes out there. This means that the SIGCLD handler *must* call wait() to reap the status of all processes -- it cannot simply set a flag and then reestablish the handler, because it will get called again, infinitely. We only need to worry about this on systems where signals need to be reestablished (SYSV Release 2 and earlier). */ #define OBNOXIOUS_SYSV_SIGCLD_BEHAVIOR #endif /* different signalling methods */ /* On bsd, [man says] kill does not accept a negative number to kill a pgrp. Must do that using the killpg call. */ #ifdef HAVE_KILLPG #define EMACS_KILLPG(pid, signo) killpg (pid, signo) #elif defined (WIN32_NATIVE) #define EMACS_KILLPG(pid, signo) should never be called #else #define EMACS_KILLPG(pid, signo) kill (-(pid), signo) #endif #ifndef NSIG # ifdef USG5_4 /* Some SVr4s don't define NSIG in sys/signal.h for ANSI environments; * instead, there's a system variable _sys_nsig. Unfortunately, we need the * constant to dimension an array. So wire in the appropriate value here. */ # define NSIG 32 # else # define NSIG (SIGUSR2+1) /* guess how many elements are in sys_siglist... */ # endif #endif /* HAVE_DECL_SYS_SIGLIST is determined by configure. On Linux, it seems, configure incorrectly fails to find it, so s/linux.h defines HAVE_SYS_SIGLIST. */ #if (!defined(HAVE_DECL_SYS_SIGLIST) || !HAVE_DECL_SYS_SIGLIST ) && !defined (HAVE_SYS_SIGLIST) extern const char *sys_siglist[]; #endif #ifdef SIGDANGER SIGTYPE memory_warning_signal (int sig); #endif #if defined (WIN32_NATIVE) || defined (CYGWIN_BROKEN_SIGNALS) typedef void (__cdecl *mswindows_sighandler) (int); /* Prototypes for signal functions, see win32.c */ int mswindows_sighold (int nsig); int mswindows_sigrelse (int nsig); int mswindows_sigpause (int nsig); int mswindows_raise (int nsig); mswindows_sighandler mswindows_sigset (int sig, mswindows_sighandler handler); #endif /* defined (WIN32_NATIVE) || defined (CYGWIN_BROKEN_SIGNALS) */ signal_handler_t set_timeout_signal (int signal_number, signal_handler_t action); #endif /* INCLUDED_syssignal_h_ */ gnuserv-3.12.8/install-sh0000755000175000017500000001272107045413341015222 0ustar martinsmartins#! /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=: 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 gnuserv-3.12.8/gnuattach0000755000175000017500000000152107045413340015115 0ustar martinsmartins#! /bin/sh # This file is part of XEmacs. # Copyright (C) 1997 Free Software Foundation, Inc. # XEmacs 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, or (at your option) any # later version. # XEmacs 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 XEmacs; see the file COPYING. If not, write to # the Free Software Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. echo "$0: Please use \`gnuclient -nw' instead." >&2 exit 1 gnuserv-3.12.8/gnuclient.c0000444000175000017500000004413610706504236015357 0ustar martinsmartins/* -*-C-*- Client code to allow local and remote editing of files by XEmacs. Copyright (C) 1989 Free Software Foundation, Inc. Copyright (C) 1995 Sun Microsystems, Inc. Copyright (C) 1997 Free Software Foundation, Inc. This file is part of XEmacs. XEmacs 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, or (at your option) any later version. XEmacs 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 XEmacs; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Author: Andy Norman (ange@hplb.hpl.hp.com), based on 'etc/emacsclient.c' from the GNU Emacs 18.52 distribution. Please mail bugs and suggestions to the XEmacs maintainer. */ /* #### This file should be a windows-mode, not console-mode program under Windows. (i.e. its entry point should be WinMain.) gnuattach functionality, to the extent it's used at all, should be retrieved using a script that calls the i.exe wrapper program, to obtain stdio handles. #### For that matter, both the functionality of gnuclient and gnuserv should be merged into XEmacs itself using a -remote arg, just like Netscape and other modern programs. --ben */ /* * This file incorporates new features added by Bob Weiner , * Darrell Kindred and Arup Mukherjee . * GNUATTACH support added by Ben Wing . * Please see the note at the end of the README file for details. * * (If gnuserv came bundled with your emacs, the README file is probably * ../etc/gnuserv.README relative to the directory containing this file) */ #ifdef CYGWIN extern void cygwin_conv_to_posix_path(const char *path, char *posix_path); #endif #include "gnuserv.h" #include "compiler.h" char gnuserv_version[] = "gnuclient version " GNUSERV_VERSION; #include "getopt.h" #include #if !defined(SYSV_IPC) && !defined(UNIX_DOMAIN_SOCKETS) && \ !defined(INTERNET_DOMAIN_SOCKETS) int main (int argc, char *argv[]) { fprintf (stderr, "Sorry, the Emacs server is only " "supported on systems that have\n"); fprintf (stderr, "Unix Domain sockets, Internet Domain " "sockets or System V IPC.\n"); exit (1); } /* main */ #else /* SYSV_IPC || UNIX_DOMAIN_SOCKETS || INTERNET_DOMAIN_SOCKETS */ static char cwd[QXE_PATH_MAX+2];/* current working directory when calculated */ static char *cp = NULL; /* ptr into valid bit of cwd above */ static pid_t emacs_pid; /* Process id for emacs process */ #ifdef SYSV_IPC struct msgbuf *msgp; /* message */ #endif /* SYSV_IPC */ void initialize_signals (void); static void tell_emacs_to_resume (int UNUSED (sig)) { char buffer[GSERV_BUFSZ+1]; int s; /* socket / msqid to server */ int connect_type; /* CONN_UNIX, CONN_INTERNET, or ONN_IPC */ /* Why is SYSV so retarded? */ /* We want emacs to realize that we are resuming */ #ifdef SIGCONT signal(SIGCONT, tell_emacs_to_resume); #endif connect_type = make_connection (NULL, 0, &s); sprintf(buffer,"(gnuserv-eval '(resume-pid-console %d))", (int)getpid()); send_string(s, buffer); #ifdef SYSV_IPC if (connect_type == (int) CONN_IPC) disconnect_from_ipc_server (s, msgp, FALSE); #else /* !SYSV_IPC */ if (connect_type != (int) CONN_IPC) disconnect_from_server (s, FALSE); #endif /* !SYSV_IPC */ } static void pass_signal_to_emacs (int sig) { if (kill (emacs_pid, sig) == -1) { fprintf (stderr, "gnuattach: Could not pass signal to emacs process\n"); exit (1); } initialize_signals (); } void initialize_signals (void) { /* Set up signal handler to pass relevant signals to emacs process. We used to send SIGSEGV, SIGBUS, SIGPIPE, SIGILL and others to Emacs, but I think it's better not to. I can see no reason why Emacs should SIGSEGV whenever gnuclient SIGSEGV-s, etc. */ signal (SIGQUIT, pass_signal_to_emacs); signal (SIGINT, pass_signal_to_emacs); #ifdef SIGWINCH signal (SIGWINCH, pass_signal_to_emacs); #endif #ifdef SIGCONT /* We want emacs to realize that we are resuming */ signal (SIGCONT, tell_emacs_to_resume); #endif } /* get_current_working_directory -- return the cwd. */ static char * get_current_working_directory (void) { if (cp == NULL) { /* haven't calculated it yet */ #ifdef HAVE_GETCWD if (getcwd (cwd,QXE_PATH_MAX) == NULL) #else if (getwd (cwd) == 0) #endif /* HAVE_GETCWD */ { perror (progname); fprintf (stderr, "%s: unable to get current working directory\n", progname); exit (1); } /* if */ /* on some systems, cwd can look like '@machine/' ... */ /* ignore everything before the first '/' */ for (cp = cwd; *cp && *cp != '/'; ++cp) ; } /* if */ return cp; } /* get_current_working_directory */ /* filename_expand -- try to convert the given filename into a fully-qualified pathname. */ static void filename_expand (char *fullpath, char *filename) /* fullpath - returned full pathname */ /* filename - filename to expand */ { #ifdef CYGWIN char cygwinFilename[QXE_PATH_MAX+1]; extern void cygwin_conv_to_posix_path(const char *, char *); #endif int len; fullpath[0] = fullpath[QXE_PATH_MAX] = '\0'; #ifdef CYGWIN /* If we're in cygwin, just convert it and let the unix stuff handle it. */ cygwin_conv_to_posix_path(filename, cygwinFilename); filename = cygwinFilename; #endif if (filename[0] && filename[0] == '/') { /* Absolute (unix-style) pathname. Do nothing */ strncat (fullpath, filename, QXE_PATH_MAX); } else { /* Assume relative Unix style path. Get the current directory and prepend it. FIXME: need to fix the case of DOS paths like "\foo", where we need to get the current drive. */ strncat (fullpath, get_current_working_directory (), QXE_PATH_MAX); len = strlen (fullpath); /* If no trailing slash, add one */ if (len <= 0 || (fullpath[len - 1] != '/' && len < QXE_PATH_MAX)) { strcat (fullpath, "/"); len++; } /* Don't forget to add the filename! */ strncat (fullpath, filename, QXE_PATH_MAX - len); } } /* filename_expand */ /* Encase the string in quotes, escape all the backslashes and quotes in string. */ static char * clean_string (const char *s) { int i = 0; char *p, *res; { const char *const_p; for (const_p = s; *const_p; const_p++, i++) { if (*const_p == '\\' || *const_p == '\"') ++i; else if (*const_p == '\004') i += 3; } } p = res = (char *) malloc (i + 2 + 1); *p++ = '\"'; for (; *s; p++, s++) { switch (*s) { case '\\': *p++ = '\\'; *p = '\\'; break; case '\"': *p++ = '\\'; *p = '\"'; break; case '\004': *p++ = '\\'; *p++ = 'C'; *p++ = '-'; *p = 'd'; break; default: *p = *s; } } *p++ = '\"'; *p = '\0'; return res; } #define GET_ARGUMENT(var, desc) do { \ if (*(p + 1)) (var) = p + 1; \ else \ { \ if (!argv[++i]) \ { \ fprintf (stderr, "%s: `%s' must be followed by an argument\n", \ progname, desc); \ exit (1); \ } \ (var) = argv[i]; \ } \ over = 1; \ } while (0) /* A strdup imitation. */ static char * my_strdup (const char *s) { char *new_s = (char *) malloc (strlen (s) + 1); if (new_s) strcpy (new_s, s); return new_s; } int main (int argc, char *argv[]) { int starting_line = 1; /* line to start editing at */ char command[QXE_PATH_MAX+50];/* emacs command buffer */ char fullpath[QXE_PATH_MAX+1];/* full pathname to file */ char *eval_form = NULL; /* form to evaluate with `-eval' */ char *eval_function = NULL; /* function to evaluate with `-f' */ char *load_library = NULL; /* library to load */ int quick = 0; /* quick edit, don't wait for user to finish */ int batch = 0; /* batch mode */ int view = 0; /* view only. */ int nofiles = 0; int errflg = 0; /* option error */ int s; /* socket / msqid to server */ int connect_type; /* CONN_UNIX, CONN_INTERNET, or * CONN_IPC */ int suppress_windows_system = 0; char *display = NULL; char *path; #ifdef INTERNET_DOMAIN_SOCKETS char *hostarg = NULL; /* remote hostname */ char *remotearg; char thishost[HOSTNAMSZ]; /* this hostname */ char remotepath[QXE_PATH_MAX+1]; /* remote pathname */ int rflg = 0; /* pathname given on cmdline */ char *portarg; unsigned short port = 0; /* port to server */ #endif /* INTERNET_DOMAIN_SOCKETS */ char *tty = NULL; char buffer[GSERV_BUFSZ + 1]; /* buffer to read pid */ char result[GSERV_BUFSZ + 1]; int i; #ifdef INTERNET_DOMAIN_SOCKETS memset (remotepath, 0, sizeof (remotepath)); #endif /* INTERNET_DOMAIN_SOCKETS */ progname = strrchr (argv[0], '/'); if (progname) ++progname; else progname = argv[0]; #ifdef WIN32_NATIVE tmpdir = getenv ("TEMP"); if (!tmpdir) tmpdir = getenv ("TMP"); if (!tmpdir) tmpdir = "c:\\"; #else #ifdef USE_TMPDIR tmpdir = getenv ("TMPDIR"); #endif if (!tmpdir) tmpdir = "/tmp"; #endif /* WIN32_NATIVE */ display = getenv ("DISPLAY"); if (display) display = my_strdup (display); #ifndef HAVE_MS_WINDOWS else suppress_windows_system = 1; #endif for (i = 1; argv[i] && !errflg; i++) { if (*argv[i] != '-') break; else if (*argv[i] == '-' && (*(argv[i] + 1) == '\0' || (*(argv[i] + 1) == '-' && *(argv[i] + 2) == '\0'))) { /* `-' or `--' */ ++i; break; } if (!strcmp (argv[i], "-batch") || !strcmp (argv[i], "--batch")) batch = 1; else if (!strcmp (argv[i], "-eval") || !strcmp (argv[i], "--eval")) { if (!argv[++i]) { fprintf (stderr, "%s: `-eval' must be followed by an argument\n", progname); exit (1); } eval_form = argv[i]; } else if (!strcmp (argv[i], "-display") || !strcmp (argv[i], "--display")) { suppress_windows_system = 0; if (!argv[++i]) { fprintf (stderr, "%s: `-display' must be followed by an argument\n", progname); exit (1); } if (display) free (display); /* no need to strdup. */ display = argv[i]; } else if (!strcmp (argv[i], "-nw")) suppress_windows_system = 1; else { /* Iterate over one-letter options. */ char *p; int over = 0; for (p = argv[i] + 1; *p && !over; p++) { switch (*p) { case 'q': quick = 1; break; case 'v': view = 1; break; case 'f': GET_ARGUMENT (eval_function, "-f"); break; case 'l': GET_ARGUMENT (load_library, "-l"); break; #ifdef INTERNET_DOMAIN_SOCKETS case 'h': GET_ARGUMENT (hostarg, "-h"); break; case 'p': GET_ARGUMENT (portarg, "-p"); port = atoi (portarg); break; case 'r': GET_ARGUMENT (remotearg, "-r"); strncpy (remotepath, remotearg, QXE_PATH_MAX); rflg = 1; break; #endif /* INTERNET_DOMAIN_SOCKETS */ default: errflg = 1; } } /* for */ } /* else */ } /* for */ if (errflg) { fprintf (stderr, #ifdef INTERNET_DOMAIN_SOCKETS "Usage: %s [-nw] [-display display] [-q] [-v] [-l library]\n" " [-batch] [-f function] [-eval form]\n" " [-h host] [-p port] [-r remote-path] [[+line] file] ...\n", #else /* !INTERNET_DOMAIN_SOCKETS */ "Usage: %s [-nw] [-q] [-v] [-l library] [-f function] [-eval form] " "[[+line] path] ...\n", #endif /* !INTERNET_DOMAIN_SOCKETS */ progname); exit (1); } if (batch && argv[i]) { fprintf (stderr, "%s: Cannot specify `-batch' with file names\n", progname); exit (1); } #if defined(INTERNET_DOMAIN_SOCKETS) if (suppress_windows_system && hostarg) { fprintf (stderr, "%s: Remote editing is available only on X\n", progname); exit (1); } #endif *result = '\0'; if (eval_function || eval_form || load_library) { #if defined(INTERNET_DOMAIN_SOCKETS) connect_type = make_connection (hostarg, port, &s); #else connect_type = make_connection (NULL, 0, &s); #endif sprintf (command, "(gnuserv-eval%s '(progn ", quick ? "-quickly" : ""); send_string (s, command); if (load_library) { send_string (s , "(load-library "); send_string (s, clean_string(load_library)); send_string (s, ") "); } if (eval_form) { send_string (s, eval_form); } if (eval_function) { send_string (s, "("); send_string (s, eval_function); send_string (s, ")"); } send_string (s, "))"); /* disconnect already sends EOT_STR */ #ifdef SYSV_IPC if (connect_type == (int) CONN_IPC) disconnect_from_ipc_server (s, msgp, batch && !quick); #else /* !SYSV_IPC */ if (connect_type != (int) CONN_IPC) disconnect_from_server (s, batch && !quick); #endif /* !SYSV_IPC */ } /* eval_function || eval_form || load_library */ else if (batch) { /* no sexp on the command line, so read it from stdin */ int nb; #if defined(INTERNET_DOMAIN_SOCKETS) connect_type = make_connection (hostarg, port, &s); #else connect_type = make_connection (NULL, 0, &s); #endif sprintf (command, "(gnuserv-eval%s '(progn ", quick ? "-quickly" : ""); send_string (s, command); while ((nb = read(fileno(stdin), buffer, GSERV_BUFSZ-1)) > 0) { buffer[nb] = '\0'; send_string(s, buffer); } send_string(s,"))"); /* disconnect already sends EOT_STR */ #ifdef SYSV_IPC if (connect_type == (int) CONN_IPC) disconnect_from_ipc_server (s, msgp, batch && !quick); #else /* !SYSV_IPC */ if (connect_type != (int) CONN_IPC) disconnect_from_server (s, batch && !quick); #endif /* !SYSV_IPC */ } if (!batch) { if (suppress_windows_system) { tty = ttyname (0); if (!tty) { fprintf (stderr, "%s: Not connected to a tty", progname); exit (1); } #if defined(INTERNET_DOMAIN_SOCKETS) connect_type = make_connection (hostarg, port, &s); #else connect_type = make_connection (NULL, 0, &s); #endif send_string (s, "(gnuserv-eval '(emacs-pid))"); send_string (s, EOT_STR); if (read_line (s, buffer) == 0) { fprintf (stderr, "%s: Could not establish Emacs process id\n", progname); exit (1); } /* Don't do disconnect_from_server because we have already read data, and disconnect doesn't do anything else. */ #ifdef SYSV_IPC if (connect_type == (int) CONN_IPC) disconnect_from_ipc_server (s, msgp, FALSE); #endif /* !SYSV_IPC */ emacs_pid = (pid_t)atol(buffer); initialize_signals(); } /* suppress_windows_system */ #if defined(INTERNET_DOMAIN_SOCKETS) connect_type = make_connection (hostarg, port, &s); #else connect_type = make_connection (NULL, 0, &s); #endif #ifdef INTERNET_DOMAIN_SOCKETS if (connect_type == (int) CONN_INTERNET) { char *ptr; gethostname (thishost, HOSTNAMSZ); if (!rflg) { /* attempt to generate a path * to this machine */ if ((ptr = getenv ("GNU_NODE")) != NULL) /* user specified a path */ strncpy (remotepath, ptr, QXE_PATH_MAX); } #if 0 /* This is really bogus... re-enable it if you must have it! */ #if defined (hp9000s300) || defined (hp9000s800) else if (strcmp (thishost,hostarg)) { /* try /net/thishost */ strcpy (remotepath, "/net/"); /* (this fails using internet addresses) */ strcat (remotepath, thishost); } #endif #endif } else { /* same machines, no need for path */ remotepath[0] = '\0'; /* default is the empty path */ } #endif /* INTERNET_DOMAIN_SOCKETS */ #ifdef SYSV_IPC if ((msgp = (struct msgbuf *) malloc (sizeof *msgp + GSERV_BUFSZ)) == NULL) { fprintf (stderr, "%s: not enough memory for message buffer\n", progname); exit (1); } /* if */ msgp->mtext[0] = '\0'; /* ready for later strcats */ #endif /* SYSV_IPC */ if (suppress_windows_system) { char *term = getenv ("TERM"); if (!term) { fprintf (stderr, "%s: unknown terminal type\n", progname); exit (1); } sprintf (command, "(gnuserv-edit-files '(tty %s %s %d) '(", clean_string (tty), clean_string (term), (int)getpid ()); } else /* !suppress_windows_system */ { if (0) ; #ifdef HAVE_X_WINDOWS else if (display) sprintf (command, "(gnuserv-edit-files '(x %s) '(", clean_string (display)); #endif #ifdef HAVE_GTK else if (display) strcpy (command, "(gnuserv-edit-files '(gtk nil) '("); #endif #ifdef HAVE_MS_WINDOWS else sprintf (command, "(gnuserv-edit-files '(mswindows nil) '("); #endif } /* !suppress_windows_system */ send_string (s, command); if (!argv[i]) nofiles = 1; for (; argv[i]; i++) { if (i < argc - 1 && *argv[i] == '+') starting_line = atoi (argv[i++]); else starting_line = 1; /* If the last argument is +something, treat it as a file. */ if (i == argc) { starting_line = 1; --i; } filename_expand (fullpath, argv[i]); #ifdef INTERNET_DOMAIN_SOCKETS path = (char *) malloc (strlen (remotepath) + strlen (fullpath) + 1); sprintf (path, "%s%s", remotepath, fullpath); #else path = my_strdup (fullpath); #endif sprintf (command, "(%d . %s)", starting_line, clean_string (path)); send_string (s, command); free (path); } /* for */ sprintf (command, ")%s%s", (quick || (nofiles && !suppress_windows_system)) ? " 'quick" : "", view ? " 'view" : ""); send_string (s, command); send_string (s, ")"); #ifdef SYSV_IPC if (connect_type == (int) CONN_IPC) disconnect_from_ipc_server (s, msgp, FALSE); #else /* !SYSV_IPC */ if (connect_type != (int) CONN_IPC) disconnect_from_server (s, FALSE); #endif /* !SYSV_IPC */ } /* not batch */ return 0; } /* main */ #endif /* SYSV_IPC || UNIX_DOMAIN_SOCKETS || INTERNET_DOMAIN_SOCKETS */ gnuserv-3.12.8/getopt.h0000444000175000017500000001051407125367573014703 0ustar martinsmartins/* Declarations for getopt. Copyright (C) 1989,90,91,92,93,94,96,97 Free Software Foundation, Inc. NOTE: The canonical source of this file is maintained with the GNU C Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu. 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, 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. */ #ifndef _GETOPT_H #define _GETOPT_H 1 #ifdef __cplusplus extern "C" { #endif /* For communication from `getopt' to the caller. When `getopt' finds an option that takes an argument, the argument value is returned here. Also, when `ordering' is RETURN_IN_ORDER, each non-option ARGV-element is returned here. */ extern char *optarg; /* Index in ARGV of the next element to be scanned. This is used for communication to and from the caller and for communication between successive calls to `getopt'. On entry to `getopt', zero means this is the first call; initialize. When `getopt' returns -1, this is the index of the first of the non-option elements that the caller should itself scan. Otherwise, `optind' communicates from one call to the next how much of ARGV has been scanned so far. */ extern int optind; /* Callers store zero here to inhibit the error message `getopt' prints for unrecognized options. */ extern int opterr; /* Set to an option character which was unrecognized. */ extern int optopt; /* Describe the long-named options requested by the application. The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector of `struct option' terminated by an element containing a name which is zero. The field `has_arg' is: no_argument (or 0) if the option does not take an argument, required_argument (or 1) if the option requires an argument, optional_argument (or 2) if the option takes an optional argument. If the field `flag' is not NULL, it points to a variable that is set to the value given in the field `val' when the option is found, but left unchanged if the option is not found. To have a long-named option do something other than set an `int' to a compiled-in constant, such as set a value from `optarg', set the option's `flag' field to zero and its `val' field to a nonzero value (the equivalent single-letter option character, if there is one). For long options that have a zero `flag' field, `getopt' returns the contents of the `val' field. */ struct option { #if defined (__STDC__) && __STDC__ const char *name; #else char *name; #endif /* has_arg can't be an enum because some compilers complain about type mismatches in all the code that assumes it is an int. */ int has_arg; int *flag; int val; }; /* Names for the values of the `has_arg' field of `struct option'. */ #define no_argument 0 #define required_argument 1 #define optional_argument 2 #if defined (__GNU_LIBRARY__) || defined (__cplusplus) || defined (CYGWIN) /* Many other libraries have conflicting prototypes for getopt, with differences in the consts, in stdlib.h. To avoid compilation errors, only prototype getopt for the GNU C library. */ extern int getopt (int argc, char *const *argv, const char *shortopts); #else /* not __GNU_LIBRARY__ || C++ */ extern int getopt (); #endif /* __GNU_LIBRARY__ || C++ */ extern int getopt_long (int argc, char *const *argv, const char *shortopts, const struct option *longopts, int *longind); extern int getopt_long_only (int argc, char *const *argv, const char *shortopts, const struct option *longopts, int *longind); /* Internal only. Users should not call this directly. */ extern int _getopt_internal (int argc, char *const *argv, const char *shortopts, const struct option *longopts, int *longind, int long_only); #ifdef __cplusplus } #endif #endif /* _GETOPT_H */ gnuserv-3.12.8/gnuserv.el0000444000175000017500000007217010135152471015231 0ustar martinsmartins;;; gnuserv.el --- Lisp interface code between Emacs and gnuserv ;; Copyright (C) 1989-1997 Free Software Foundation, Inc. ;; Version: 3.12 ;; Author: Andy Norman (ange@hplb.hpl.hp.com), originally based on server.el ;; Hrvoje Niksic ;; Maintainer: Jan Vroonhof , ;; Hrvoje Niksic ;; Keywords: environment, processes, terminals ;; This file is part of XEmacs. ;; XEmacs 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, or (at your option) ;; any later version. ;; XEmacs 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 XEmacs; see the file COPYING. If not, write to the ;; Free Software Foundation, 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. ;;; Synched up with: Not in FSF. ;;; Commentary: ;; Gnuserv is run when Emacs needs to operate as a server for other ;; processes. Specifically, any number of files can be attached for ;; editing to a running XEmacs process using the `gnuclient' program. ;; Use `M-x gnuserv-start' to start the server and `gnuclient files' ;; to load them to XEmacs. When you are done with a buffer, press ;; `C-x #' (`M-x gnuserv-edit'). You can put (gnuserv-start) to your ;; .emacs, and enable `gnuclient' as your Unix "editor". When all the ;; buffers for a client have been edited and exited with ;; `gnuserv-edit', the client "editor" will return to the program that ;; invoked it. ;; Your editing commands and Emacs' display output go to and from the ;; terminal or X display in the usual way. If you are running under ;; X, a new X frame will be open for each gnuclient. If you are on a ;; TTY, this TTY will be attached as a new device to the running ;; XEmacs, and will be removed once you are done with the buffer. ;; To evaluate a Lisp form in a running Emacs, use the `-eval' ;; argument of gnuclient. To simplify this, we provide the `gnudoit' ;; shell script. For example `gnudoit "(+ 2 3)"' will print `5', ;; whereas `gnudoit "(gnus)"' will fire up your favorite newsreader. ;; Like gnuclient, `gnudoit' requires the server to be started prior ;; to using it. ;; For more information you can refer to man pages of gnuclient, ;; gnudoit and gnuserv, distributed with XEmacs. ;; gnuserv.el was originally written by Andy Norman as an improvement ;; over William Sommerfeld's server.el. Since then, a number of ;; people have worked on it, including Bob Weiner, Darell Kindred, ;; Arup Mukherjee, Ben Wing and Jan Vroonhof. It was completely ;; rewritten (labeled as version 3) by Hrvoje Niksic in May 1997. The ;; new code will not run on GNU Emacs. ;; Jan Vroonhof July/1996 ;; ported the server-temp-file-regexp feature from server.el ;; ported server hooks from server.el ;; ported kill-*-query functions from server.el (and made it optional) ;; synced other behavior with server.el ;; ;; Jan Vroonhof ;; Customized. ;; ;; Hrvoje Niksic May/1997 ;; Completely rewritten. Now uses `defstruct' and other CL stuff ;; to define clients cleanly. Many thanks to Dave Gillespie! ;; ;; Mike Scheidler July, 1997 ;; Added 'Done' button to the menubar. ;;; Code: (defgroup gnuserv nil "The gnuserv suite of programs to talk to Emacs from outside." :group 'environment :group 'processes :group 'terminals) ;;;###autoload (defcustom gnuserv-mode-line-string " Server" "*String to display in the modeline when Gnuserv is active. Set this to nil if you don't want a modeline indicator." :type '(choice string (const :tag "none" nil)) :group 'gnuserv) ;; Provide the old variables as aliases, to avoid breaking .emacs ;; files. However, they are obsolete and should be converted to the ;; new forms. This ugly crock must be before the variable ;; declaration, or the scheme fails. (define-obsolete-variable-alias 'server-frame 'gnuserv-frame) (define-obsolete-variable-alias 'server-done-function 'gnuserv-done-function) (define-obsolete-variable-alias 'server-done-temp-file-function 'gnuserv-done-temp-file-function) (define-obsolete-variable-alias 'server-find-file-function 'gnuserv-find-file-function) (define-obsolete-variable-alias 'server-program 'gnuserv-program) (define-obsolete-variable-alias 'server-visit-hook 'gnuserv-visit-hook) (define-obsolete-variable-alias 'server-done-hook 'gnuserv-done-hook) (define-obsolete-variable-alias 'server-kill-quietly 'gnuserv-kill-quietly) (define-obsolete-variable-alias 'server-temp-file-regexp 'gnuserv-temp-file-regexp) (define-obsolete-variable-alias 'server-make-temp-file-backup 'gnuserv-make-temp-file-backup) ;;;###autoload (defcustom gnuserv-frame nil "*The frame to be used to display all edited files. If nil, then a new frame is created for each file edited. If t, then the currently selected frame will be used. If a function, then this will be called with a symbol `x' or `tty' as the only argument, and its return value will be interpreted as above." :tag "Gnuserv Frame" :type '(radio (const :tag "Create new frame each time" nil) (const :tag "Use selected frame" t) (function-item :tag "Use main Emacs frame" gnuserv-main-frame-function) (function-item :tag "Use visible frame, otherwise create new" gnuserv-visible-frame-function) (function-item :tag "Create special Gnuserv frame and use it" gnuserv-special-frame-function) (function :tag "Other")) :group 'gnuserv :group 'frames) (defcustom gnuserv-frame-plist nil "*Plist of frame properties for creating a gnuserv frame." :type 'plist :group 'gnuserv :group 'frames) (defcustom gnuserv-done-function 'kill-buffer "*Function used to remove a buffer after editing. It is called with one BUFFER argument. Functions such as `kill-buffer' and `bury-buffer' are good values. See also `gnuserv-done-temp-file-function'." :type '(radio (function-item kill-buffer) (function-item bury-buffer) (function :tag "Other")) :group 'gnuserv) (defcustom gnuserv-done-temp-file-function 'kill-buffer "*Function used to remove a temporary buffer after editing. It is called with one BUFFER argument. Functions such as `kill-buffer' and `bury-buffer' are good values. See also `gnuserv-done-temp-file-function'." :type '(radio (function-item kill-buffer) (function-item bury-buffer) (function :tag "Other")) :group 'gnuserv) (defcustom gnuserv-find-file-function 'find-file "*Function to visit a file with. It takes one argument, a file name to visit." :type 'function :group 'gnuserv) (defcustom gnuserv-view-file-function 'view-file "*Function to view a file with. It takes one argument, a file name to view." :type '(radio (function-item view-file) (function-item find-file-read-only) (function :tag "Other")) :group 'gnuserv) (defcustom gnuserv-program "gnuserv" "*Program to use as the editing server." :type 'string :group 'gnuserv) (defcustom gnuserv-visit-hook nil "*Hook run after visiting a file." :type 'hook :group 'gnuserv) (defcustom gnuserv-done-hook nil "*Hook run when done editing a buffer for the Emacs server. The hook functions are called after the file has been visited, with the current buffer set to the visiting buffer." :type 'hook :group 'gnuserv) (defcustom gnuserv-init-hook nil "*Hook run after the server is started." :type 'hook :group 'gnuserv) (defcustom gnuserv-shutdown-hook nil "*Hook run before the server exits." :type 'hook :group 'gnuserv) (defcustom gnuserv-kill-quietly nil "*Non-nil means to kill buffers with clients attached without requiring confirmation." :type 'boolean :group 'gnuserv) (defcustom gnuserv-temp-file-regexp (concat "^" (temp-directory) "/Re\\|/draft$") "*Regexp which should match filenames of temporary files deleted and reused by the programs that invoke the Emacs server." :type 'regexp :group 'gnuserv) (defcustom gnuserv-make-temp-file-backup nil "*Non-nil makes the server backup temporary files also." :type 'boolean :group 'gnuserv) ;;; Internal variables: (defstruct gnuclient "An object that encompasses several buffers in one. Normally, a client connecting to Emacs will be assigned an id, and will request editing of several files. ID - Client id (integer). BUFFERS - List of buffers that \"belong\" to the client. NOTE: one buffer can belong to several clients. DEVICE - The device this client is on. If the device was also created. by a client, it will be placed to `gnuserv-devices' list. FRAME - Frame created by the client, or nil if the client didn't create a frame. All the slots default to nil." (id nil) (buffers nil) (device nil) (frame nil)) (defvar gnuserv-process nil "The current gnuserv process.") (defvar gnuserv-string "" "The last input string from the server.") (defvar gnuserv-current-client nil "The client we are currently talking to.") (defvar gnuserv-clients nil "List of current gnuserv clients. Each element is a gnuclient structure that identifies a client.") (defvar gnuserv-devices nil "List of devices created by clients.") (defvar gnuserv-special-frame nil "Frame created specially for Server.") ;; We want the client-infested buffers to have some modeline ;; identification, so we'll make a "minor mode". (defvar gnuserv-minor-mode nil) (make-variable-buffer-local 'gnuserv-minor-mode) ;;(pushnew '(gnuserv-minor-mode "Server") minor-mode-alist ;; :test 'equal) (add-minor-mode 'gnuserv-minor-mode 'gnuserv-mode-line-string) ;; Sample gnuserv-frame functions (defun gnuserv-main-frame-function (type) "Return a sensible value for the main Emacs frame." (if (or (eq type 'x) (eq type 'gtk) (eq type 'mswindows)) (car (frame-list)) nil)) (defun gnuserv-visible-frame-function (type) "Return a frame if there is a frame that is truly visible, nil otherwise. This is meant in the X sense, so it will not return frames that are on another visual screen. Totally visible frames are preferred. If none found, return nil." (if (or (eq type 'x) (eq type 'gtk) (eq type 'mswindows)) (cond ((car (filtered-frame-list 'frame-totally-visible-p (selected-device)))) ((car (filtered-frame-list (lambda (frame) ;; eq t as in not 'hidden (eq t (frame-visible-p frame))) (selected-device))))) nil)) (defun gnuserv-special-frame-function (type) "Create a special frame for Gnuserv and return it on later invocations." (unless (frame-live-p gnuserv-special-frame) (setq gnuserv-special-frame (make-frame gnuserv-frame-plist))) gnuserv-special-frame) ;;; Communication functions ;; We used to restart the server here, but it's too risky -- if ;; something goes awry, it's too easy to wind up in a loop. (defun gnuserv-sentinel (proc msg) (let ((msgstring (concat "Gnuserv process %s; restart with `%s'")) (keystring (substitute-command-keys "\\[gnuserv-start]"))) (case (process-status proc) (exit (message msgstring "exited" keystring) (gnuserv-prepare-shutdown)) (signal (message msgstring "killed" keystring) (gnuserv-prepare-shutdown)) (closed (message msgstring "closed" keystring)) (gnuserv-prepare-shutdown)))) ;; This function reads client requests from our current server. Every ;; client is identified by a unique ID within the server ;; (incidentally, the same ID is the file descriptor the server uses ;; to communicate to client). ;; ;; The request string can arrive in several chunks. As the request ;; ends with \C-d, we check for that character at the end of string. ;; If not found, keep reading, and concatenating to former strings. ;; So, if at first read we receive "5 (gn", that text will be stored ;; to gnuserv-string. If we then receive "us)\C-d", the two will be ;; concatenated, `current-client' will be set to 5, and `(gnus)' form ;; will be evaluated. ;; ;; Server will send the following: ;; ;; "ID \C-d" (no quotes) ;; ;; ID - file descriptor of the given client; ;; - the actual contents of the request. (defun gnuserv-process-filter (proc string) "Process gnuserv client requests to execute Emacs commands." (setq gnuserv-string (concat gnuserv-string string)) ;; C-d means end of request. (when (string-match "\C-d\n?\\'" gnuserv-string) (cond ((string-match "\\`[0-9]+" gnuserv-string) ; client request id (let ((header (read-from-string gnuserv-string))) ;; Set the client we are talking to. (setq gnuserv-current-client (car header)) ;; Evaluate the expression (condition-case oops (eval (car (read-from-string gnuserv-string (cdr header)))) ;; In case of an error, write the description to the ;; client, and then signal it. (error (setq gnuserv-string "") (when gnuserv-current-client (gnuserv-write-to-client gnuserv-current-client oops)) (setq gnuserv-current-client nil) (signal (car oops) (cdr oops))) (quit (setq gnuserv-string "") (when gnuserv-current-client (gnuserv-write-to-client gnuserv-current-client oops)) (setq gnuserv-current-client nil) (signal 'quit nil))) (setq gnuserv-string ""))) (t (let ((response (car (split-string gnuserv-string "\C-d")))) (setq gnuserv-string "") (error "%s: invalid response from gnuserv" response)))))) ;; This function is somewhat of a misnomer. Actually, we write to the ;; server (using `process-send-string' to gnuserv-process), which ;; interprets what we say and forwards it to the client. The ;; incantation server understands is (from gnuserv.c): ;; ;; "FD/LEN:\n" (no quotes) ;; FD - file descriptor of the given client (which we obtained from ;; the server earlier); ;; LEN - length of the stuff we are about to send; ;; - the actual contents of the request. (defun gnuserv-write-to-client (client-id form) "Write the given form to the given client via the gnuserv process." (when (eq (process-status gnuserv-process) 'run) (let* ((result (format "%s" form)) (s (format "%s/%d:%s\n" client-id (length result) result))) (process-send-string gnuserv-process s)))) ;; The following two functions are helper functions, used by ;; gnuclient. (defun gnuserv-eval (form) "Evaluate form and return result to client." (gnuserv-write-to-client gnuserv-current-client (eval form)) (setq gnuserv-current-client nil)) (defun gnuserv-eval-quickly (form) "Let client know that we've received the request, and then eval the form. This order is important as not to keep the client waiting." (gnuserv-write-to-client gnuserv-current-client nil) (setq gnuserv-current-client nil) (eval form)) (defun make-x-device-with-gtk-fallback (device) (or (condition-case () (make-x-device device) (error nil)) (make-gtk-device))) ;; "Execute" a client connection, called by gnuclient. This is the ;; backbone of gnuserv.el. (defun gnuserv-edit-files (type list &rest flags) "For each (line-number . file) pair in LIST, edit the file at line-number. The visited buffers are memorized, so that when \\[gnuserv-edit] is invoked in such a buffer, or when it is killed, or the client's device deleted, the client will be invoked that the edit is finished. TYPE should either be a (tty TTY TERM PID) list, or (x DISPLAY) list. If a flag is `quick', just edit the files in Emacs. If a flag is `view', view the files read-only." (let (quick view) (mapc (lambda (flag) (case flag (quick (setq quick t)) (view (setq view t)) (t (error "Invalid flag %s" flag)))) flags) (let* ((old-device-num (length (device-list))) (new-frame nil) (dest-frame (if (functionp gnuserv-frame) (funcall gnuserv-frame (car type)) gnuserv-frame)) ;; The gnuserv-frame dependencies are ugly, but it's ;; extremely hard to make that stuff cleaner without ;; breaking everything in sight. (device (cond ((frame-live-p dest-frame) (frame-device dest-frame)) ((null dest-frame) (case (car type) (tty (apply 'make-tty-device (cdr type))) (gtk (make-gtk-device)) (x (make-x-device-with-gtk-fallback (cadr type))) (mswindows (make-mswindows-device)) (t (error "Invalid device type")))) (t (selected-device)))) (frame (cond ((frame-live-p dest-frame) dest-frame) ((null dest-frame) (setq new-frame (make-frame gnuserv-frame-plist device)) new-frame) (t (selected-frame)))) (client (make-gnuclient :id gnuserv-current-client :device device :frame new-frame))) (select-frame frame) (setq gnuserv-current-client nil) ;; If the device was created by this client, push it to the list. (and (/= old-device-num (length (device-list))) (push device gnuserv-devices)) (and (frame-iconified-p frame) (deiconify-frame frame)) ;; Visit all the listed files. (while list (let ((line (caar list)) (path (cdar list))) (select-frame frame) ;; Visit the file. (funcall (if view gnuserv-view-file-function gnuserv-find-file-function) path) (goto-line line) ;; Don't memorize the quick and view buffers. (unless (or quick view) (pushnew (current-buffer) (gnuclient-buffers client)) (setq gnuserv-minor-mode t) ;; Add the "Done" button to the menubar, only in this buffer. (if (and (featurep 'menubar) current-menubar) (progn (set-buffer-menubar current-menubar) (add-menu-button nil ["Done" gnuserv-edit])) )) (run-hooks 'gnuserv-visit-hook) (pop list))) (cond ((and (or quick view) (device-on-window-system-p device)) ;; Exit if on X device, and quick or view. NOTE: if the ;; client is to finish now, it must absolutely /not/ be ;; included to the list of clients. This way the client-ids ;; should be unique. (gnuserv-write-to-client (gnuclient-id client) nil)) (t ;; Else, the client gets a vote. (push client gnuserv-clients) ;; Explain buffer exit options. If dest-frame is nil, the ;; user can exit via `delete-frame'. OTOH, if FLAGS are nil ;; and there are some buffers, the user can exit via ;; `gnuserv-edit'. (if (and (not (or quick view)) (gnuclient-buffers client)) (message "%s" (substitute-command-keys "Type `\\[gnuserv-edit]' to finish editing")) (or dest-frame (message "%s" (substitute-command-keys "Type `\\[delete-frame]' to finish editing"))))))))) ;;; Functions that hook into Emacs in various way to enable operation ;; Defined later. (add-hook 'kill-emacs-hook 'gnuserv-kill-all-clients t) ;; A helper function; used by others. Try avoiding it whenever ;; possible, because it is slow, and conses a list. Use ;; `gnuserv-buffer-p' when appropriate, for instance. (defun gnuserv-buffer-clients (buffer) "Return a list of clients to which BUFFER belongs." (let (res) (dolist (client gnuserv-clients) (when (memq buffer (gnuclient-buffers client)) (push client res))) res)) ;; Like `gnuserv-buffer-clients', but returns a boolean; doesn't ;; collect a list. (defun gnuserv-buffer-p (buffer) (member* buffer gnuserv-clients :test 'memq :key 'gnuclient-buffers)) ;; This function makes sure that a killed buffer is deleted off the ;; list for the particular client. ;; ;; This hooks into `kill-buffer-hook'. It is *not* a replacement for ;; `kill-buffer' (thanks God). (defun gnuserv-kill-buffer-function () "Remove the buffer from the buffer lists of all the clients it belongs to. Any client that remains \"empty\" after the removal is informed that the editing has ended." (let* ((buf (current-buffer))) (dolist (client (gnuserv-buffer-clients buf)) (callf2 delq buf (gnuclient-buffers client)) ;; If no more buffers, kill the client. (when (null (gnuclient-buffers client)) (gnuserv-kill-client client))))) (add-hook 'kill-buffer-hook 'gnuserv-kill-buffer-function) ;; Ask for confirmation before killing a buffer that belongs to a ;; living client. (defun gnuserv-kill-buffer-query-function () (or gnuserv-kill-quietly (not (gnuserv-buffer-p (current-buffer))) (yes-or-no-p (format "Buffer %s belongs to gnuserv client(s); kill anyway? " (current-buffer))))) (add-hook 'kill-buffer-query-functions 'gnuserv-kill-buffer-query-function) (defun gnuserv-kill-emacs-query-function () (or gnuserv-kill-quietly (not (some 'gnuclient-buffers gnuserv-clients)) (yes-or-no-p "Gnuserv buffers still have clients; exit anyway? "))) (add-hook 'kill-emacs-query-functions 'gnuserv-kill-emacs-query-function) ;; If the device of a client is to be deleted, the client should die ;; as well. This is why we hook into `delete-device-hook'. (defun gnuserv-check-device (device) (when (memq device gnuserv-devices) (dolist (client gnuserv-clients) (when (eq device (gnuclient-device client)) ;; we must make sure that the server kill doesn't result in ;; killing the device, because it would cause a device-dead ;; error when `delete-device' tries to do the job later. (gnuserv-kill-client client t)))) (callf2 delq device gnuserv-devices)) (add-hook 'delete-device-hook 'gnuserv-check-device) (defun gnuserv-temp-file-p (buffer) "Return non-nil if BUFFER contains a file considered temporary. These are files whose names suggest they are repeatedly reused to pass information to another program. The variable `gnuserv-temp-file-regexp' controls which filenames are considered temporary." (and (buffer-file-name buffer) (string-match gnuserv-temp-file-regexp (buffer-file-name buffer)))) (defun gnuserv-kill-client (client &optional leave-frame) "Kill the gnuclient CLIENT. This will do away with all the associated buffers. If LEAVE-FRAME, the function will not remove the frames associated with the client." ;; Order is important: first delete client from gnuserv-clients, to ;; prevent gnuserv-buffer-done-1 calling us recursively. (callf2 delq client gnuserv-clients) ;; Process the buffers. (mapc 'gnuserv-buffer-done-1 (gnuclient-buffers client)) (unless leave-frame (let ((device (gnuclient-device client))) ;; kill frame created by this client (if any), unless ;; specifically requested otherwise. ;; ;; note: last frame on a device will not be deleted here. (when (and (gnuclient-frame client) (frame-live-p (gnuclient-frame client)) (second (device-frame-list device))) (delete-frame (gnuclient-frame client))) ;; If the device is live, created by a client, and no longer used ;; by any client, delete it. (when (and (device-live-p device) (memq device gnuserv-devices) (second (device-list)) (not (member* device gnuserv-clients :key 'gnuclient-device))) ;; `gnuserv-check-device' will remove it from `gnuserv-devices'. (delete-device device)))) ;; Notify the client. (gnuserv-write-to-client (gnuclient-id client) nil)) ;; Do away with the buffer. (defun gnuserv-buffer-done-1 (buffer) (dolist (client (gnuserv-buffer-clients buffer)) (callf2 delq buffer (gnuclient-buffers client)) (when (null (gnuclient-buffers client)) (gnuserv-kill-client client))) ;; Get rid of the buffer. (save-excursion (set-buffer buffer) (run-hooks 'gnuserv-done-hook) (setq gnuserv-minor-mode nil) ;; Delete the menu button. (if (and (featurep 'menubar) current-menubar) (delete-menu-item '("Done"))) (funcall (if (gnuserv-temp-file-p buffer) gnuserv-done-temp-file-function gnuserv-done-function) buffer))) ;;; Higher-level functions ;; Choose a `next' server buffer, according to several criteria, and ;; return it. If none are found, return nil. (defun gnuserv-next-buffer () (let* ((frame (selected-frame)) (device (selected-device)) client) (cond ;; If we have a client belonging to this frame, return ;; the first buffer from it. ((setq client (car (member* frame gnuserv-clients :key 'gnuclient-frame))) (car (gnuclient-buffers client))) ;; Else, look for a device. ((and (memq (selected-device) gnuserv-devices) (setq client (car (member* device gnuserv-clients :key 'gnuclient-device)))) (car (gnuclient-buffers client))) ;; Else, try to find any client with at least one buffer, and ;; return its first buffer. ((setq client (car (member-if-not #'null gnuserv-clients :key 'gnuclient-buffers))) (car (gnuclient-buffers client))) ;; Oh, give up. (t nil)))) (defun gnuserv-buffer-done (buffer) "Mark BUFFER as \"done\" for its client(s). Does the save/backup queries first, and calls `gnuserv-done-function'." ;; Check whether this is the real thing. (unless (gnuserv-buffer-p buffer) (error "%s does not belong to a gnuserv client" buffer)) ;; Backup/ask query. (if (gnuserv-temp-file-p buffer) ;; For a temp file, save, and do NOT make a non-numeric backup ;; Why does server.el explicitly back up temporary files? (let ((version-control nil) (buffer-backed-up (not gnuserv-make-temp-file-backup))) (save-buffer)) (if (and (buffer-modified-p) (y-or-n-p (concat "Save file " buffer-file-name "? "))) (save-buffer buffer))) (gnuserv-buffer-done-1 buffer)) ;; Called by `gnuserv-start-1' to clean everything. Hooked into ;; `kill-emacs-hook', too. (defun gnuserv-kill-all-clients () "Kill all the gnuserv clients. Ruthlessly." (mapc 'gnuserv-kill-client gnuserv-clients)) ;; This serves to run the hook and reset ;; `allow-deletion-of-last-visible-frame'. (defun gnuserv-prepare-shutdown () (setq allow-deletion-of-last-visible-frame nil) (run-hooks 'gnuserv-shutdown-hook)) ;; This is a user-callable function, too. (defun gnuserv-shutdown () "Shutdown the gnuserv server, if one is currently running. All the clients will be disposed of via the normal methods." (interactive) (gnuserv-kill-all-clients) (when gnuserv-process (set-process-sentinel gnuserv-process nil) (gnuserv-prepare-shutdown) (condition-case () (delete-process gnuserv-process) (error nil)) (setq gnuserv-process nil))) ;; Actually start the process. Kills all the clients before-hand. (defun gnuserv-start-1 (&optional leave-dead) ;; Shutdown the existing server, if any. (gnuserv-shutdown) ;; If we already had a server, clear out associated status. (unless leave-dead (setq gnuserv-string "" gnuserv-current-client nil) (let ((process-connection-type t)) (setq gnuserv-process (start-process "gnuserv" nil gnuserv-program))) (set-process-sentinel gnuserv-process 'gnuserv-sentinel) (set-process-filter gnuserv-process 'gnuserv-process-filter) (process-kill-without-query gnuserv-process) (setq allow-deletion-of-last-visible-frame t) (run-hooks 'gnuserv-init-hook))) ;;; User-callable functions: ;;;###autoload (defun gnuserv-running-p () "Return non-nil if a gnuserv process is running from this XEmacs session." (not (not gnuserv-process))) ;;;###autoload (defun gnuserv-start (&optional leave-dead) "Allow this Emacs process to be a server for client processes. This starts a gnuserv communications subprocess through which client \"editors\" (gnuclient and gnudoit) can send editing commands to this Emacs job. See the gnuserv(1) manual page for more details. Prefix arg means just kill any existing server communications subprocess." (interactive "P") (and gnuserv-process (not leave-dead) (message "Restarting gnuserv")) (gnuserv-start-1 leave-dead)) (defun gnuserv-edit (&optional count) "Mark the current gnuserv editing buffer as \"done\", and switch to next one. Run with a numeric prefix argument, repeat the operation that number of times. If given a universal prefix argument, close all the buffers of this buffer's clients. The `gnuserv-done-function' (bound to `kill-buffer' by default) is called to dispose of the buffer after marking it as done. Files that match `gnuserv-temp-file-regexp' are considered temporary and are saved unconditionally and backed up if `gnuserv-make-temp-file-backup' is non-nil. They are disposed of using `gnuserv-done-temp-file-function' \(also bound to `kill-buffer' by default). When all of a client's buffers are marked as \"done\", the client is notified." (interactive "P") (when (null count) (setq count 1)) (cond ((numberp count) (while (natnump (decf count)) (let ((frame (selected-frame))) (gnuserv-buffer-done (current-buffer)) (when (eq frame (selected-frame)) ;; Switch to the next gnuserv buffer. However, do this ;; only if we remain in the same frame. (let ((next (gnuserv-next-buffer))) (when next (switch-to-buffer next))))))) (count (let* ((buf (current-buffer)) (clients (gnuserv-buffer-clients buf))) (unless clients (error "%s does not belong to a gnuserv client" buf)) (mapc 'gnuserv-kill-client (gnuserv-buffer-clients buf)))))) (global-set-key "\C-x#" 'gnuserv-edit) (provide 'gnuserv) ;;; gnuserv.el ends here gnuserv-3.12.8/configure0000775000175000017500000060016610706776163015151 0ustar martinsmartins#! /bin/sh # From configure.in Id: configure.in,v 1.7 2004/10/20 01:22:56 martins Exp . # 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="gnuserv.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='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 CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CPP GREP EGREP XMKMF LIBXAUTH 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 _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] --enable-xauth Support XAUTH authentication support. --disable-xauth Do not support XAUTH authentication support. --disable-internet-domain-sockets Do not use Internet domain sockets --disable-unix-domain-sockets Do not use Unix domain sockets --disable-sysv-ipc Do not use SYSV IPC Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-resolv Use -lresolv for host name lookups. --without-resolv Do not use -lresolv for host name lookups. --with-x use the X Window System 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 ac_config_headers="$ac_config_headers config.h" 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_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} { (exit 1); exit 1; }; } fi # 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. # 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' { echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6; } if test "${ac_cv_c_const+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { /* FIXME: Include the comments suggested by Paul. */ #ifndef __cplusplus /* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset cs; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; }; struct s *b; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #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_cv_c_const=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 echo "${ECHO_T}$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then cat >>confdefs.h <<\_ACEOF #define const _ACEOF fi # Check whether --with-resolv was given. if test "${with_resolv+set}" = set; then withval=$with_resolv; sed_downcase='y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/' val=`echo "$withval" | sed -e "$sed_downcase"` case "$val" in "" ) ac_use_resolv=yes ;; yes | no | maybe ) ac_use_resolv=$val ;; * ) { { echo "$as_me:$LINENO: error: $withval: invalid argument to --with-resolv" >&5 echo "$as_me: error: $withval: invalid argument to --with-resolv" >&2;} { (exit 1); exit 1; }; } ;; esac else # Default is not to link with resolv. ac_use_resolv=no fi # Check whether --enable-xauth was given. if test "${enable_xauth+set}" = set; then enableval=$enable_xauth; sed_downcase='y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/' val=`echo "$enableval" | sed -e "$sed_downcase"` case "$val" in yes | no | try ) require_xauth=$val ;; * ) { { echo "$as_me:$LINENO: error: $enableval: invalid argument to --enable-xauth" >&5 echo "$as_me: error: $enableval: invalid argument to --enable-xauth" >&2;} { (exit 1); exit 1; }; } ;; esac else require_xauth=try fi { echo "$as_me:$LINENO: checking whether sys_siglist is declared" >&5 echo $ECHO_N "checking whether sys_siglist is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_sys_siglist+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 /* NetBSD declares sys_siglist in unistd.h. */ #ifdef HAVE_UNISTD_H # include #endif int main () { #ifndef sys_siglist (void) sys_siglist; #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_cv_have_decl_sys_siglist=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_sys_siglist=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_have_decl_sys_siglist" >&5 echo "${ECHO_T}$ac_cv_have_decl_sys_siglist" >&6; } if test $ac_cv_have_decl_sys_siglist = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_SYS_SIGLIST 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define HAVE_DECL_SYS_SIGLIST 0 _ACEOF 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 { 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 { 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" { 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 for ac_header in string.h unistd.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 for ac_header in sys/types.h sys/select.h sys/socket.h sys/time.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 for ac_header in libintl.h sys/un.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 for ac_header in sgtty.h bsd/sgtty.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 { echo "$as_me:$LINENO: checking for socklen_t" >&5 echo $ECHO_N "checking for socklen_t... $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 socklen_t x; 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 { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } 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. */ #include int accept (int, struct sockaddr *, size_t *); 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 { echo "$as_me:$LINENO: result: size_t" >&5 echo "${ECHO_T}size_t" >&6; } cat >>confdefs.h <<\_ACEOF #define socklen_t size_t _ACEOF else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { echo "$as_me:$LINENO: result: int" >&5 echo "${ECHO_T}int" >&6; } cat >>confdefs.h <<\_ACEOF #define socklen_t int _ACEOF fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { 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 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 "$require_xauth" != "no" ; then if test "$have_x" = yes; then o_CPPFLAGS="$CPPFLAGS" if test -n "$x_includes" ; then CPPFLAGS="$CPPFLAGS -I$x_includes" fi if test -n "$x_libraries" ; then CPPFLAGS="$CPPFLAGS -L$x_libraries" fi fi if test "${ac_cv_header_X11_Xauth_h+set}" = set; then { echo "$as_me:$LINENO: checking for X11/Xauth.h" >&5 echo $ECHO_N "checking for X11/Xauth.h... $ECHO_C" >&6; } if test "${ac_cv_header_X11_Xauth_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_X11_Xauth_h" >&5 echo "${ECHO_T}$ac_cv_header_X11_Xauth_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking X11/Xauth.h usability" >&5 echo $ECHO_N "checking X11/Xauth.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 X11/Xauth.h presence" >&5 echo $ECHO_N "checking X11/Xauth.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: X11/Xauth.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: X11/Xauth.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: X11/Xauth.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: X11/Xauth.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: X11/Xauth.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: X11/Xauth.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: X11/Xauth.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: X11/Xauth.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: X11/Xauth.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: X11/Xauth.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: X11/Xauth.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: X11/Xauth.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: X11/Xauth.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: X11/Xauth.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: X11/Xauth.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: X11/Xauth.h: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for X11/Xauth.h" >&5 echo $ECHO_N "checking for X11/Xauth.h... $ECHO_C" >&6; } if test "${ac_cv_header_X11_Xauth_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_X11_Xauth_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_X11_Xauth_h" >&5 echo "${ECHO_T}$ac_cv_header_X11_Xauth_h" >&6; } fi if test $ac_cv_header_X11_Xauth_h = yes; then use_xauth=yes else use_xauth=no fi { echo "$as_me:$LINENO: checking for XauGetAuthByAddr in -lXau" >&5 echo $ECHO_N "checking for XauGetAuthByAddr in -lXau... $ECHO_C" >&6; } if test "${ac_cv_lib_Xau_XauGetAuthByAddr+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXau $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 XauGetAuthByAddr (); int main () { return XauGetAuthByAddr (); ; 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_Xau_XauGetAuthByAddr=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_Xau_XauGetAuthByAddr=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_Xau_XauGetAuthByAddr" >&5 echo "${ECHO_T}$ac_cv_lib_Xau_XauGetAuthByAddr" >&6; } if test $ac_cv_lib_Xau_XauGetAuthByAddr = yes; then use_xauth=yes else use_xauth=no fi if test "$have_x" = yes ; then CPPFLAGS="$o_CPPFLAGS" fi if test "$use_xauth" = "yes" ; then cat >>confdefs.h <<\_ACEOF #define HAVE_XAUTH 1 _ACEOF LIBXAUTH="-lXau" if test "$have_x" = yes ; then if test -n "$x_libraries" ; then LIBXAUTH="-L$x_libraries $LIBXAUTH" fi if test -n "$x_includes" ; then CPPFLAGS="$CPPFLAGS -I$x_includes" fi fi elif test "$require_xauth" = "yes" ; then { { echo "$as_me:$LINENO: error: Cannot find headers or libraries for XAUTH support." >&5 echo "$as_me: error: Cannot find headers or libraries for XAUTH support." >&2;} { (exit 1); exit 1; }; } fi fi if test "$have_x" = "yes"; then cat >>confdefs.h <<\_ACEOF #define HAVE_X_WINDOWS 1 _ACEOF else { { echo "$as_me:$LINENO: error: X development files not found - install them or force with: ./configure \ --x-includes=/usr/local/include \ --x-libraries=/usr/local/lib \ ... It does not matter if the headers and libraries aren't actually there! Sorry: no options currently exist for GTK+ or MS Windows." >&5 echo "$as_me: error: X development files not found - install them or force with: ./configure \ --x-includes=/usr/local/include \ --x-libraries=/usr/local/lib \ ... It does not matter if the headers and libraries aren't actually there! Sorry: no options currently exist for GTK+ or MS Windows." >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: checking for socket in -lsocket" >&5 echo $ECHO_N "checking for socket in -lsocket... $ECHO_C" >&6; } if test "${ac_cv_lib_socket_socket+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $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 socket (); int main () { return socket (); ; 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_socket=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_socket_socket=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_socket" >&5 echo "${ECHO_T}$ac_cv_lib_socket_socket" >&6; } if test $ac_cv_lib_socket_socket = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBSOCKET 1 _ACEOF LIBS="-lsocket $LIBS" fi { echo "$as_me:$LINENO: checking for inet_ntoa in -lnsl" >&5 echo $ECHO_N "checking for inet_ntoa in -lnsl... $ECHO_C" >&6; } if test "${ac_cv_lib_nsl_inet_ntoa+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 inet_ntoa (); int main () { return inet_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_nsl_inet_ntoa=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_nsl_inet_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_nsl_inet_ntoa" >&5 echo "${ECHO_T}$ac_cv_lib_nsl_inet_ntoa" >&6; } if test $ac_cv_lib_nsl_inet_ntoa = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBNSL 1 _ACEOF LIBS="-lnsl $LIBS" fi { echo "$as_me:$LINENO: checking for gettext in -lintl" >&5 echo $ECHO_N "checking for gettext in -lintl... $ECHO_C" >&6; } if test "${ac_cv_lib_intl_gettext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl $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 gettext (); int main () { return gettext (); ; 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_intl_gettext=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_intl_gettext=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_intl_gettext" >&5 echo "${ECHO_T}$ac_cv_lib_intl_gettext" >&6; } if test $ac_cv_lib_intl_gettext = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBINTL 1 _ACEOF LIBS="-lintl $LIBS" fi # Check whether resolv support is desired. # If --with-resolv is specified to configure, support for resolv must # be available or configure will exit with an error. # If --without-resolv is specified, no attempt is made to look for # resolv headers or libraries. # By default, configure will use resolv if all the necessary support is # available, otherwise it won't. No fatal errors should occur in either # circumstance. # Default if not otherwise found ac_resolv_support=no if test $ac_use_resolv != no ; then { echo "$as_me:$LINENO: checking for gethostbyname in -lresolv" >&5 echo $ECHO_N "checking for gethostbyname in -lresolv... $ECHO_C" >&6; } if test "${ac_cv_lib_resolv_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lresolv $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_resolv_gethostbyname=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_resolv_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_resolv_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_lib_resolv_gethostbyname" >&6; } if test $ac_cv_lib_resolv_gethostbyname = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBRESOLV 1 _ACEOF LIBS="-lresolv $LIBS" fi if eval test '$'ac_cv_lib_resolv_gethostbyname = yes; then ac_resolv_support=yes elif test $ac_use_resolv = yes; then { { echo "$as_me:$LINENO: error: Cannot link with -lresolv. Is it missing?" >&5 echo "$as_me: error: Cannot link with -lresolv. Is it missing?" >&2;} { (exit 1); exit 1; }; } fi fi for ac_func in getcwd memcmp strerror 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 # Check whether --enable-internet-domain-sockets was given. if test "${enable_internet_domain_sockets+set}" = set; then enableval=$enable_internet_domain_sockets; fi if test "$enable_internet_domain_sockets" != "no" ; then { echo "$as_me:$LINENO: checking for internet-domain sockets" >&5 echo $ECHO_N "checking for internet-domain sockets... $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 #ifdef AF_INET yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then cat >>confdefs.h <<\_ACEOF #define HAVE_INTERNET_DOMAIN_SOCKETS 1 _ACEOF { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } { echo "$as_me:$LINENO: checking \"for sun_len member in struct sockaddr_un\"" >&5 echo $ECHO_N "checking \"for sun_len member in struct sockaddr_un\"... $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 #include #include int main () { static struct sockaddr_un x; x.sun_len = 1; ; 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; }; cat >>confdefs.h <<\_ACEOF #define HAVE_SOCKADDR_SUN_LEN 1 _ACEOF else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi rm -f conftest* fi # Check whether --enable-internet-unix-sockets was given. if test "${enable_internet_unix_sockets+set}" = set; then enableval=$enable_internet_unix_sockets; fi if test "$enable_unix_domain_sockets" != "no" ; then { echo "$as_me:$LINENO: checking for unix-domain sockets" >&5 echo $ECHO_N "checking for unix-domain sockets... $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 #ifdef AF_UNIX yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then cat >>confdefs.h <<\_ACEOF #define HAVE_UNIX_DOMAIN_SOCKETS 1 _ACEOF { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi rm -f conftest* fi # Check whether --enable-sysv-ipc was given. if test "${enable_sysv_ipc+set}" = set; then enableval=$enable_sysv_ipc; fi if test "$enable_sysv_ipc" != "no" ; then for ac_func in msgget 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 cat >>confdefs.h <<\_ACEOF #define HAVE_SYSVIPC 1 _ACEOF fi done fi { echo "$as_me:$LINENO: checking for GNU libc" >&5 echo $ECHO_N "checking for GNU libc... $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 int main () { #if ! (defined __GLIBC__ || defined __GNU_LIBRARY__) #error Not a GNU libc system :-( ******* ======= ******** &&&&&&&& #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 have_glibc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 have_glibc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $have_glibc" >&5 echo "${ECHO_T}$have_glibc" >&6; } test "$have_glibc" = "yes" && cat >>confdefs.h <<\_ACEOF #define _GNU_SOURCE 1 _ACEOF ac_config_files="$ac_config_files 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 "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES 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 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 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 INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim INSTALL_DATA!$INSTALL_DATA$ac_delim CPP!$CPP$ac_delim GREP!$GREP$ac_delim EGREP!$EGREP$ac_delim XMKMF!$XMKMF$ac_delim LIBXAUTH!$LIBXAUTH$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 54; 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 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" >$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 gnuserv-3.12.8/INSTALL0000644000175000017500000001723007045413340014246 0ustar martinsmartinsBasic Installation ================== These are generic installation instructions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, a file `config.cache' that saves the results of its tests to speed up reconfiguring, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.in' is used to create `configure' by a program called `autoconf'. You only need `configure.in' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. You can give `configure' initial values for variables by setting them in the environment. Using a Bourne-compatible shell, you can do that on the command line like this: CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure Or on systems that have the `env' program, you can do it like this: env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of `make' that supports the `VPATH' variable, such as GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. If you have to use a `make' that does not supports the `VPATH' variable, you have to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' will install the package's files in `/usr/local/bin', `/usr/local/man', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PATH'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec-prefix=PATH', the package will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=PATH' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' can not figure out automatically, but needs to determine by the type of host the package will run on. Usually `configure' can figure that out, but if it prints a message saying it can not guess the host type, give it the `--host=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name with three fields: CPU-COMPANY-SYSTEM See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the host type. If you are building compiler tools for cross-compiling, you can also use the `--target=TYPE' option to select the type of system they will produce code for and the `--build=TYPE' option to select the type of system on which you are compiling the package. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Operation Controls ================== `configure' recognizes the following options to control how it operates. `--cache-file=FILE' Use and save the results of the tests in FILE instead of `./config.cache'. Set FILE to `/dev/null' to disable caching, for debugging `configure'. `--help' Print a summary of the options to `configure', and exit. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--version' Print the version of Autoconf used to generate the `configure' script, and exit. `configure' also accepts some other, not widely useful, options. gnuserv-3.12.8/ChangeLog0000664000175000017500000002104010706776207014777 0ustar martinsmartins2007-10-22 Martin Schwenke * aclocal.m4: Fix more $x_libraries breakage. * Makefile.in: Version 3.12.8. Added compiler.h. Fix dependencies. * aclocal.m4: Fix problem where empty $x_includes and $x_libraries causes ./configure breakage. 2007-10-21 Martin Schwenke * gnuclient.c, gnuslib.c: Merge this: 2006-08-08 Jerry James * gnuslib.c (disconnect_from_server): shutdown() has been fine on Linux for a long time now; use it. Also, don't use length to access the buffer unless it is positive, not just nonzero. * gnuclient.c (filename_expand): Initialize the last array element to get a valid C string in case of overflow. Use strncat to avoid buffer overruns. * gnuclient.c (main): Use strncpy to avoid buffer overruns. * gnuclient.c: Sync with xemacs-21.5.27. * gnuserv.c, sysfile.h, syssignal.h: Version from xemacs-21.5.27. 2004-10-20 Martin Schwenke * README: Updated to say tested under GNU Emacs 21.3, updated gnuserv sources from XEmacs 21.5.17, commented that SYSV_IPC works again under Linux, explained weirdness resulting from missing X development files at compile time. * configure.in: Added error message for when HAVE_X_WINDOWS doesn't get defined. Lifted check for HAVE_SOCKADDR_SUN_LEN from XEmacs 21.5.17. * Makefile.in: Added ChangeLog generation. * Makefile.in: Bumped version to 3.12.7. 2004-10-19 Martin Schwenke * acconfig.h: Added HAVE_SOCKADDR_SUN_LEN. * sysfile.h, gnuserv.el: Updated to version from XEmacs 21.5.17. 2003-05-09 Martin Schwenke * gnuserv-compat.el: Add eval-and-compile around a bunch of code to facilitate byte-compiling. Minor whitespace cleanups. Thanks to Le Wang . (add-minor-mode): fixed so it actually uses its arguments instead of hardcoded stuff from gnuserv.el - oops. * Makefile.in: Cleaned up byte-compile of gnuserv-compat.el. Bumped version number. * gnuserv-compat.el: No longer tested under emacs-19.x. I don't have one of those anymore... :-) * gnuserv-compat.el: Added function add-minor-mode, which is not in emacs-20.7 and earlier. 2002-09-24 Martin Schwenke * README: Added note that this is tested under Emacs 21.2. Updated XEmacs version from which this comes. Commented that I've borrowed some configure stuff from XEmacs. Added known problem about SYSV_IPC version crashing. 2002-09-15 Martin Schwenke * configure.in: Added check for _GNU_SOURCE from XEmacs configure.in. * acconfig.h: Added _GNU_SOURCE. * gnuclient.c (main): Moved declaration of msgp back out to global scope so that tell_emacs_to_resume can see it. 2002-09-14 Martin Schwenke * Makefile.in: Added syssignal.h to DIST_HDRS. * config.h.bot: Removed hardcoded #define for HAVE_X_WINDOWS. * acconfig.h: Added HAVE_X_WINDOWS. * configure.in: Actually check for X. * Makefile.in: Updated VERSION to 3.12.5. * configure.in: Added AC_DECL_SYS_SIGLIST and AC_CHECK_FUNCS(strerror). 2002-09-13 Martin Schwenke * config.h.bot: Added signal related stuff from xemacs-21.5.cvs-20020913 config.h.in. Added hardcoded #define for HAVE_X_WINDOWS. This might be a mistake, but it seems OK. * gnuserv.h, gnuslib.c, gnuclient.c: Updated to xemacs-21.5.cvs-20020913. * syssignal.h: New file. * sysfile.h: Updated to xemacs-21.5.cvs-20020913. * sysfile.h: New file. * gnuserv.el, gnuserv.c, gnuserv.1: Updated to xemacs-21.5.cvs-20020913. 2002-09-03 Martin Schwenke * Makefile.in: installdirs target now includes $(man1dir) instead of $(mandir), which was not defined. Thanks to Francisco Borges . 2001-06-19 Martin Schwenke * README: Added note about "make distclean" if running with LDFLAGS=... Thanks yet again to Geert Kloosterman . 2001-05-07 Martin Schwenke * configure.in: Also added check for SIZEOF_LONG (in previous check-in). Thanks to Gilles Peskine for reporting that this was needed on a 64-bit machine (Alpha). * Makefile.in: Releasing version 3.12.4. * configure.in: Added socklen_t check from XEmacs. Thanks to Geert Kloosterman for reporting the need for this on HP-UX. * acconfig.h: Added socklen_t. * aclocal.m4: New file. * README: - Added section on linking problems. Thanks to Geert Kloosterman for helping to figure out exactly what was going wrong on HP-UX. - Took out known problem about LONGBITS under Solaris 2.6. This should now be fixed. 2001-04-23 Martin Schwenke * config.h.bot: New file. 2001-03-30 Martin Schwenke * acconfig.h, configure.in: New file. 2001-03-15 Martin Schwenke * Makefile.in: Bumped version number. * README: Fixed XEmacs version number. 2001-02-12 Martin Schwenke * Makefile.in: Now uses $(INSTALL_SCRIPT) to install scripts. Thanks to Ilya Martynov . * Makefile.in: Change of version because of changed e-mail address. * README, gnuserv-compat.el: Changed e-mail address. 2001-01-31 Martin Schwenke * Makefile.in: Added sysfile.h to DIST_HDRS. * Makefile.in: Bumped up the version number to reflect that this is the version from xemacs-21.2.43. * README: Changed version number. * gnuclient.c: Upgraded to version from xemacs-21.2.43 and re-patched to handle the configure options relating to sockets and IPC. * getopt.h: Upgraded to version from xemacs-21.2.43. * getopt.h: New file. * getopt.c: Upgraded to version from xemacs-21.2.43. * getopt.c: New file. * gnuserv.1: Upgraded to version from xemacs-21.2.43. * gnuserv.1: New file. * gnuserv.c, gnuserv.el: Upgraded to version from xemacs-21.2.43. * gnuserv.h: Upgraded to version from xemacs-21.2.43 and re-patched to handle the configure options relating to sockets and IPC. * gnuslib.c: Upgraded to version from xemacs-21.2.43 and re-patched to move #endif for sockets above read_line function, since this is needed for IPC-only version to link. * gnudoit, gnuserv.c, gnuserv.el: New file. 2000-10-20 Martin Schwenke * README: Added delete-frame hack and extra credit for xauth work-around. 2000-10-19 Martin Schwenke * README: Documented work-around for SSH problems. Thanks to Martin Thornquist . 2000-08-28 Martin Schwenke * README: Added comment about lack of tty (-nw) functionality. Reported again, this time by Steve Ihde . * README: Indicate that 19.34 - 20.7 have been tested. * Makefile.in: Changed version number to reflect minor changes. * gnuserv-compat.el: - Changed comment to indicate that 19.34 - 20.7 have been tested. - Added docstring and interactive flag to autoload instructions. 2000-08-25 Martin Schwenke * Makefile.in: Added ChangeLog to dist files. * README: Fixed comment about customisation. * gnuserv-compat.el: - Added Emacs 19.34 changes by Ronan Waide . - Changed my e-mail address. * Makefile.in: Fixed copyright years. * README: Changed to Linuxcare address. * README: Removed comment about gnuserv-compat.el not compiling. * Makefile.in: Added compile of gnuserv-compat.el thanks to Geert Kloosterman . * Makefile.in: New file. 2000-06-05 Martin Schwenke * README: Reflect code changes. * gnuserv.h: Removed default communication scheme selection. If user didn't want any of them, then they won't get any... * gnuslib.c: Moved #endif above read_line to make it unconditionally available. * gnuclient.c: Moved definition of msgp to global scope. * gnuslib.c, README: New file. 2000-06-02 Martin Schwenke * gnuserv.h: Cleaned up choice of INTERNET_DOMAIN_SOCKETS, UNIX_DOMAIN_SOCKETS and SYSV_IPC stuff so that it depends on the config.h. * gnuclient.c: Made things work without Internet domain sockets. * gnuclient.c, gnuserv.h: New file. 1999-11-24 Martin Schwenke * gnuserv-compat.el: Fixed typo in autoload doco. * gnuserv-compat.el: Added definition of temp-directory. Is this for 20.4 or 19.34? 1999-07-25 Martin Schwenke * gnuserv-compat.el: - Changed e-mail address. - Cleanups. 1999-02-28 Martin Schwenke * gnuserv-compat.el: New file. gnuserv-3.12.8/README.orig0000644000175000017500000001064307045413340015035 0ustar martinsmartinsThis file is not meant to be proper documentation. See the file gnuserv.1 for more information. **** NOTE: This version of gnuserv has some enhancements over the original version distributed by Andy Norman. See the end of this file for more details. **** To install, copy gnuserv.el into a directory on your GNU Emacs load-path. Edit Makefile and change INCLUDES to point to the src directory underneath your emacs source tree (or make yourself a config.h file in this directory by hand, starting with config.h.proto as a first cut) and type: make This should compile the server and the two clients. Now put gnuserv, gnuclient and gnudoit in a directory that users have in their executable search paths. File : Description ---------------------------------------------------------------- Makefile : Makefile to build gnuserv LICENSE : GNU General License README : this file gnuclient.c : editor client C code gnudoit.c : eval client C code gnuserv.1 : gnuserv man page gnuserv.c : server C code gnuserv.el : server LISP code for GNU Emacs V18,V19, XEmacs/Lucid Emacs and Epoch V4 gnuserv.h : server/client C header file gnuslib.c : server/client C common code src.x11fns.diff : diffs to src/x11fns to raise window (for emacs18) config.h.proto : Use this file as the starting point for constructing a config.h if you don't have access to the one that was used when compiling your emacs. If you find *any* problems at all with gnuserv, or you can think of better ways of doing things (especially remote file access), please e-mail me at one of the addresses below. ange@hplb.hpl.hp.com ange@hpl.hp.co.uk ...!hplabs!hplb!ange ...!ukc!hplb!ange This version of gnuserv has been enhanced by a number of people, including Bob Weiner , Darrell Kindred and Arup Mukherjee . The modifications are basically as follows: Bob Weiner: Integrated support for several versions of emacs. New requests from gnuclient cause the creation of new frames. Removed the restriction on the length of the string passed to gnudoit. Later added a server-done-function variable to control what happens to a buffer after the user is done with it. Mods to each of the .c files as well as gnuserv.el Darrell Kindred: Removed the restriction on the length of the string returned from a gnudoit request, for the purposes of unix/internet sockets. Allow the gnudoit request to be read from stdin if it's not specified on the command line. Internet sockets are not opened unless the GNU_SECURE variable is specified. Unix sockets are created in a protected ancestral directory, since many Unix variants don't enforce socket permissions properly. An internet socket accepting local connections is not opened by default because this would make it possibly to override all security on the unix socket. See the man page for details. Unless told to do otherwise by a command-line argument, gnuclient and gnudoit now try to open a unix socket by default if support for them was compiled in. Mods to each of the .c files and to gnuserv.el. Arup Mukherjee: Removed the restriction on the length of the string returned from a gnudoit request, for the purposes of sysv ipc. Added support for the "gnuserv-frame" variable allowing you to specify control whether or not new screens are created in response to each gnuclient request. Made a number of other bugfixes and changes to the lisp part of the code, allowing gnuserv to work properly with newer emacs versions. All the changes are listed in the changelog at the beginning of gnuserv.el. Also fixed up the man page to reflect the new gnuserv features. On HPs, stopped the "-r" parameter (in gnuclient) from defaulting to /net/. Not all installations want this, and it's much harder to debug when things stop working. Changed the man page to reflect this. Mods to each of the .c files, gnuserv.el and gnuserv.1 More recently - added Xauth(1X11)-style authentication to gnuserv (as of version 2.1). Although the code is completely new, credit is due to Richard Caley ... he wrote a prototype implementation from which I borrowed the basic mechanism for hooking Xauth into gnuserv. gnuserv-3.12.8/gnuserv.c0000444000175000017500000005270710706501065015060 0ustar martinsmartins/* -*-C-*- Server code for handling requests from clients and forwarding them on to the XEmacs process. This file is part of XEmacs. Copying is permitted under those conditions described by the GNU General Public License. Copyright (C) 1989 Free Software Foundation, Inc. Author: Andy Norman (ange@hplb.hpl.hp.com), based on 'etc/server.c' from the 18.52 GNU Emacs distribution. Please mail bugs and suggestions to the author at the above address. */ /* HISTORY * 11-Nov-1990 bristor@simba * Added EOT stuff. */ /* * This file incorporates new features added by Bob Weiner , * Darrell Kindred and Arup Mukherjee . * Please see the note at the end of the README file for details. * * (If gnuserv came bundled with your emacs, the README file is probably * ../etc/gnuserv.README relative to the directory containing this file) */ #include "gnuserv.h" char gnuserv_version[] = "gnuserv version" GNUSERV_VERSION; #ifdef USE_LITOUT #ifdef linux #include #else #include #endif #endif #ifdef AIX #include #endif #include #include #include #include #ifdef HAVE_UNISTD_H #include #endif /* HAVE_UNISTD_H */ #ifdef HAVE_STRING_H #include #endif /* HAVE_STRING_H */ #include "compiler.h" #if !defined(SYSV_IPC) && !defined(UNIX_DOMAIN_SOCKETS) && \ !defined(INTERNET_DOMAIN_SOCKETS) int main () { fprintf (stderr,"Sorry, the Emacs server is only supported on systems that have\n"); fprintf (stderr,"Unix Domain sockets, Internet Domain sockets or System V IPC\n"); exit (1); } /* main */ #else /* SYSV_IPC || UNIX_DOMAIN_SOCKETS || INTERNET_DOMAIN_SOCKETS */ #ifdef SYSV_IPC int ipc_qid = 0; /* ipc message queue id */ pid_t ipc_wpid = 0; /* watchdog task pid */ /* ipc_exit -- clean up the queue id and queue, then kill the watchdog task if it exists. exit with the given status. */ void ipc_exit (int stat) { msgctl (ipc_qid,IPC_RMID,0); if (ipc_wpid != 0) kill (ipc_wpid, SIGKILL); exit (stat); } /* ipc_exit */ /* ipc_handle_signal -- catch the signal given and clean up. */ void ipc_handle_signal(int sig) { ipc_exit (0); } /* ipc_handle_signal */ /* ipc_spawn_watchdog -- spawn a watchdog task to clean up the message queue should the server process die. */ void ipc_spawn_watchdog (void) { if ((ipc_wpid = fork ()) == 0) { /* child process */ pid_t ppid = getppid (); /* parent's process id */ setpgrp(); /* gnu kills process group on exit */ while (1) { if (kill (ppid, 0) < 0) /* ppid is no longer valid, parent may have died */ { ipc_exit (0); } /* if */ sleep(10); /* have another go later */ } /* while */ } /* if */ } /* ipc_spawn_watchdog */ /* ipc_init -- initialize server, setting the global msqid that can be listened on. */ void ipc_init (struct msgbuf **msgpp) { key_t key; /* messge key */ char buf[GSERV_BUFSZ]; /* pathname for key */ sprintf (buf,"%s/gsrv%d",tmpdir,(int)geteuid ()); creat (buf,0600); key = ftok (buf,1); if ((ipc_qid = msgget (key,0600|IPC_CREAT)) == -1) { perror (progname); fprintf (stderr, "%s: unable to create msg queue\n", progname); ipc_exit (1); } /* if */ ipc_spawn_watchdog (); signal (SIGTERM,ipc_handle_signal); signal (SIGINT,ipc_handle_signal); if ((*msgpp = (struct msgbuf *) malloc (sizeof **msgpp + GSERV_BUFSZ)) == NULL) { fprintf (stderr, "%s: unable to allocate space for message buffer\n", progname); ipc_exit(1); } /* if */ } /* ipc_init */ /* handle_ipc_request -- accept a request from a client, pass the request on to the XEmacs process, then wait for its reply and pass that on to the client. */ void handle_ipc_request (struct msgbuf *msgp) { struct msqid_ds msg_st; /* message status */ char buf[GSERV_BUFSZ]; int len; /* length of message / read */ int s, result_len; /* tag fields on the response from emacs */ int offset = 0; int total = 1; /* # bytes that will actually be sent off */ if ((len = msgrcv (ipc_qid, msgp, GSERV_BUFSZ - 1, 1, 0)) < 0) { perror (progname); fprintf (stderr, "%s: unable to receive\n", progname); ipc_exit (1); } /* if */ msgctl (ipc_qid, IPC_STAT, &msg_st); strncpy (buf, msgp->mtext, len); buf[len] = '\0'; /* terminate */ printf ("%d %s", ipc_qid, buf); fflush (stdout); /* now for the response from gnu */ msgp->mtext[0] = '\0'; #if 0 if ((len = read(0,buf,GSERV_BUFSZ-1)) < 0) { perror (progname); fprintf (stderr, "%s: unable to read\n", progname); ipc_exit (1); } /* if */ sscanf (buf, "%d:%[^\n]\n", &junk, msgp->mtext); #else /* read in "n/m:" (n=client fd, m=message length) */ while (offset < (GSERV_BUFSZ-1) && ((len = read (0, buf + offset, 1)) > 0) && buf[offset] != ':') { offset += len; } if (len < 0) { perror (progname); fprintf (stderr, "%s: unable to read\n", progname); exit(1); } /* parse the response from emacs, getting client fd & result length */ buf[offset] = '\0'; sscanf (buf, "%d/%d", &s, &result_len); while (result_len > 0) { if ((len = read(0, buf, min2 (result_len, GSERV_BUFSZ - 1))) < 0) { perror (progname); fprintf (stderr, "%s: unable to read\n", progname); exit (1); } /* Send this string off, but only if we have enough space */ if (GSERV_BUFSZ > total) { if (total + len <= GSERV_BUFSZ) buf[len] = 0; else buf[GSERV_BUFSZ - total] = 0; send_string(s,buf); total += strlen(buf); } result_len -= len; } /* eat the newline */ while ((len = read (0,buf,1)) == 0) ; if (len < 0) { perror(progname); fprintf (stderr,"%s: unable to read\n", progname); exit (1); } if (buf[0] != '\n') { fprintf (stderr,"%s: garbage after result [%c]\n", progname, buf[0]); exit (1); } #endif /* Send a response back to the client. */ msgp->mtype = msg_st.msg_lspid; if (msgsnd (ipc_qid,msgp,strlen(msgp->mtext)+1,0) < 0) perror ("msgsend(gnuserv)"); } /* handle_ipc_request */ #endif /* SYSV_IPC */ #if defined(INTERNET_DOMAIN_SOCKETS) || defined(UNIX_DOMAIN_SOCKETS) /* echo_request -- read request from a given socket descriptor, and send the information to stdout (the gnu process). */ static void echo_request (int s) { char buf[GSERV_BUFSZ]; int len; printf("%d ",s); /* read until we get a newline or no characters */ while ((len = recv(s,buf,GSERV_BUFSZ-1,0)) > 0) { buf[len] = '\0'; printf("%s",buf); if (buf[len-1] == EOT_CHR) { fflush(stdout); break; /* end of message */ } } /* while */ if (len < 0) { perror(progname); fprintf(stderr,"%s: unable to recv\n",progname); exit(1); } /* if */ } /* echo_request */ /* handle_response -- accept a response from stdin (the gnu process) and pass the information on to the relevant client. */ static void handle_response (void) { char buf[GSERV_BUFSZ+1]; int offset=0; int s; int len = 0; int result_len; /* read in "n/m:" (n=client fd, m=message length) */ while (offset < GSERV_BUFSZ && ((len = read(0,buf+offset,1)) > 0) && buf[offset] != ':') { offset += len; } if (len < 0) { perror(progname); fprintf(stderr,"%s: unable to read\n",progname); exit(1); } /* parse the response from emacs, getting client fd & result length */ buf[offset] = '\0'; sscanf(buf,"%d/%d", &s, &result_len); while (result_len > 0) { if ((len = read(0,buf,min2(result_len,GSERV_BUFSZ))) < 0) { perror(progname); fprintf(stderr,"%s: unable to read\n",progname); exit(1); } buf[len] = '\0'; send_string(s,buf); result_len -= len; } /* eat the newline */ while ((len = read(0,buf,1)) == 0) ; if (len < 0) { perror(progname); fprintf(stderr,"%s: unable to read\n",progname); exit(1); } if (buf[0] != '\n') { fprintf(stderr,"%s: garbage after result\n",progname); exit(1); } /* send the newline */ buf[1] = '\0'; send_string(s,buf); close(s); } /* handle_response */ #endif /* INTERNET_DOMAIN_SOCKETS || UNIX_DOMAIN_SOCKETS */ #ifdef INTERNET_DOMAIN_SOCKETS struct entry { unsigned long host_addr; struct entry *next; }; struct entry *permitted_hosts[TABLE_SIZE]; #ifdef AUTH_MAGIC_COOKIE # include # include static Xauth *server_xauth = NULL; #endif static int timed_read (int fd, char *buf, int max, int timeout, int one_line) { fd_set rmask; struct timeval tv; /* = {timeout, 0}; */ char c = 0; int nbytes = 0; int r; tv.tv_sec = timeout; tv.tv_usec = 0; FD_ZERO(&rmask); FD_SET(fd, &rmask); do { r = select(fd + 1, &rmask, NULL, NULL, &tv); if (r > 0) { if (read (fd, &c, 1) == 1 ) { *buf++ = c; ++nbytes; } else { printf ("read error on socket\004\n"); return -1; } } else if (r == 0) { printf ("read timed out\004\n"); return -1; } else { printf ("error in select\004\n"); return -1; } } while ((nbytes < max) && !(one_line && (c == '\n'))); --buf; if (one_line && *buf == '\n') { *buf = 0; } return nbytes; } /* permitted -- return whether a given host is allowed to connect to the server. */ static int permitted (unsigned long host_addr, int fd) { int key; struct entry *entry; char auth_protocol[128]; char buf[1024]; int auth_data_len; if (fd > 0) { /* we are checking permission on a real connection */ /* Read auth protocol name */ if (timed_read(fd, auth_protocol, AUTH_NAMESZ, AUTH_TIMEOUT, 1) <= 0) return FALSE; if (strcmp (auth_protocol, DEFAUTH_NAME) && strcmp (auth_protocol, MCOOKIE_NAME)) { printf ("authentication protocol (%s) from client is invalid...\n", auth_protocol); printf ("... Was the client an old version of gnuclient/gnudoit?\004\n"); return FALSE; } if (!strcmp(auth_protocol, MCOOKIE_NAME)) { /* * doing magic cookie auth */ if (timed_read (fd, buf, 10, AUTH_TIMEOUT, 1) <= 0) return FALSE; auth_data_len = atoi (buf); if (auth_data_len <= 0 || auth_data_len > (int) sizeof (buf)) { return FALSE; } if (timed_read (fd, buf, auth_data_len, AUTH_TIMEOUT, 0) != auth_data_len) return FALSE; #ifdef AUTH_MAGIC_COOKIE if (server_xauth && server_xauth->data) { /* Do a compare without comprising info about the size of the cookie */ int auth_data_pos; int auth_mismatches = ( auth_data_len ^ server_xauth->data_length ); for(auth_data_pos = 0; auth_data_pos < auth_data_len; ++auth_data_pos) auth_mismatches |= ( buf[auth_data_pos] ^ server_xauth->data[auth_data_pos % server_xauth->data_length]); if (auth_mismatches == 0) return TRUE; for(;rand() % 1000;); } #else printf ("client tried Xauth, but server is not compiled with Xauth\n"); #endif /* * auth failed, but allow this to fall through to the GNU_SECURE * protocol.... */ printf ("Xauth authentication failed, trying GNU_SECURE auth...\004\n"); } /* Other auth protocols go here, and should execute only if the * auth_protocol name matches. */ } /* Now, try the old GNU_SECURE stuff... */ /* First find the hash key */ key = HASH(host_addr) % TABLE_SIZE; /* Now check the chain for that hash key */ for(entry=permitted_hosts[key]; entry != NULL; entry=entry->next) if (host_addr == entry->host_addr) return(TRUE); return(FALSE); } /* permitted */ /* add_host -- add the given host to the list of permitted hosts, provided it isn't already there. */ static void add_host (unsigned long host_addr) { int key; struct entry *new_entry; if (!permitted(host_addr, -1)) { if ((new_entry = (struct entry *) malloc(sizeof(struct entry))) == NULL) { fprintf(stderr,"%s: unable to malloc space for permitted host entry\n", progname); exit(1); } /* if */ new_entry->host_addr = host_addr; key = HASH(host_addr) % TABLE_SIZE; new_entry->next = permitted_hosts[key]; permitted_hosts[key] = new_entry; } /* if */ } /* add_host */ /* setup_table -- initialize the table of hosts allowed to contact the server, by reading from the file specified by the GNU_SECURE environment variable Put in the local machine, and, if a security file is specifed, add each host that is named in the file. Return the number of hosts added. */ static int setup_table (void) { FILE *host_file; char *file_name; char hostname[HOSTNAMSZ]; unsigned int host_addr; int i, hosts=0; /* Make sure every entry is null */ for (i=0; is_port; /* Create the listen socket. */ if ((ls = socket (AF_INET,SOCK_STREAM, 0)) == -1) { perror(progname); fprintf(stderr,"%s: unable to create socket\n",progname); exit(1); } /* if */ /* Bind the listen address to the socket. */ if (bind(ls,(struct sockaddr *) &server,sizeof(struct sockaddr_in)) == -1) { perror(progname); fprintf(stderr,"%s: unable to bind socket\n",progname); exit(1); } /* if */ /* Initiate the listen on the socket so remote users * can connect. */ if (listen(ls,20) == -1) { perror(progname); fprintf(stderr,"%s: unable to listen\n",progname); exit(1); } /* if */ return(ls); } /* internet_init */ /* handle_internet_request -- accept a request from a client and send the information to stdout (the gnu process). */ static void handle_internet_request (int ls) { int s; socklen_t addrlen = sizeof (struct sockaddr_in); struct sockaddr_in peer; /* for peer socket address */ memset (&peer, '\0', sizeof (peer)); if ((s = accept(ls,(struct sockaddr *)&peer, &addrlen)) == -1) { perror(progname); fprintf(stderr,"%s: unable to accept\n",progname); exit(1); } /* if */ /* Check that access is allowed - if not return crud to the client */ if (!permitted(peer.sin_addr.s_addr, s)) { send_string(s,"gnudoit: Connection refused\ngnudoit: unable to connect to remote"); close(s); printf("Refused connection from %s\004\n", inet_ntoa(peer.sin_addr)); return; } /* if */ echo_request(s); } /* handle_internet_request */ #endif /* INTERNET_DOMAIN_SOCKETS */ #ifdef UNIX_DOMAIN_SOCKETS /* unix_init -- initialize server, returning an unix-domain socket that can be listened on. */ static int unix_init (void) { int ls; /* socket descriptor */ struct sockaddr_un server; /* unix socket address */ socklen_t bindlen; if ((ls = socket(AF_UNIX,SOCK_STREAM, 0)) < 0) { perror(progname); fprintf(stderr,"%s: unable to create socket\n",progname); exit(1); } /* if */ /* Set up address structure for the listen socket. */ #ifdef HIDE_UNIX_SOCKET sprintf(server.sun_path,"%s/gsrvdir%d",tmpdir,(int)geteuid()); if (mkdir(server.sun_path, 0700) < 0) { /* assume it already exists, and try to set perms */ if (chmod(server.sun_path, 0700) < 0) { perror(progname); fprintf(stderr,"%s: can't set permissions on %s\n", progname, server.sun_path); exit(1); } } strcat(server.sun_path,"/gsrv"); unlink(server.sun_path); /* remove old file if it exists */ #else /* HIDE_UNIX_SOCKET */ sprintf(server.sun_path,"%s/gsrv%d",tmpdir,(int)geteuid()); unlink(server.sun_path); /* remove old file if it exists */ #endif /* HIDE_UNIX_SOCKET */ server.sun_family = AF_UNIX; #ifdef HAVE_SOCKADDR_SUN_LEN /* See W. R. Stevens "Advanced Programming in the Unix Environment" p. 502 */ bindlen = (sizeof (server.sun_len) + sizeof (server.sun_family) + strlen (server.sun_path) + 1); server.sun_len = bindlen; #else bindlen = strlen (server.sun_path) + sizeof (server.sun_family); #endif if (bind(ls,(struct sockaddr *)&server,bindlen) < 0) { perror(progname); fprintf(stderr,"%s: unable to bind socket\n",progname); exit(1); } /* if */ chmod(server.sun_path,0700); /* only this user can send commands */ if (listen(ls,20) < 0) { perror(progname); fprintf(stderr,"%s: unable to listen\n",progname); exit(1); } /* if */ /* #### there are also better ways of dealing with this when sigvec() is present. */ #if defined (HAVE_SIGPROCMASK) { sigset_t _mask; sigemptyset (&_mask); sigaddset (&_mask, SIGPIPE); sigprocmask (SIG_BLOCK, &_mask, NULL); } #else signal(SIGPIPE,SIG_IGN); /* in case user kills client */ #endif return(ls); } /* unix_init */ /* handle_unix_request -- accept a request from a client and send the information to stdout (the gnu process). */ static void handle_unix_request (int ls) { int s; socklen_t len = sizeof (struct sockaddr_un); struct sockaddr_un server; /* for unix socket address */ server.sun_family = AF_UNIX; if ((s = accept(ls,(struct sockaddr *)&server, &len)) < 0) { perror(progname); fprintf(stderr,"%s: unable to accept\n",progname); } /* if */ echo_request(s); } /* handle_unix_request */ #endif /* UNIX_DOMAIN_SOCKETS */ int main (int UNUSED (argc), char *argv[]) { int chan; /* temporary channel number */ #ifdef SYSV_IPC struct msgbuf *msgp; /* message buffer */ #else int ils = -1; /* internet domain listen socket */ int uls = -1; /* unix domain listen socket */ #endif /* SYSV_IPC */ progname = argv[0]; for(chan=3; chan < _NFILE; close(chan++)) /* close unwanted channels */ ; #ifdef WIN32_NATIVE tmpdir = getenv ("TEMP"); if (!tmpdir) tmpdir = getenv ("TMP"); if (!tmpdir) tmpdir = "c:\\"; #else #ifdef USE_TMPDIR tmpdir = getenv ("TMPDIR"); #endif if (!tmpdir) tmpdir = "/tmp"; #endif /* WIN32_NATIVE */ #ifdef USE_LITOUT { /* this is to allow ^D to pass to emacs */ int d = LLITOUT; (void) ioctl(fileno(stdout), TIOCLBIS, &d); } #endif #ifdef SYSV_IPC ipc_init(&msgp); /* get a msqid to listen on, and a message buffer */ #endif /* SYSV_IPC */ #ifdef INTERNET_DOMAIN_SOCKETS ils = internet_init(); /* get an internet domain socket to listen on */ #endif /* INTERNET_DOMAIN_SOCKETS */ #ifdef UNIX_DOMAIN_SOCKETS uls = unix_init(); /* get a unix domain socket to listen on */ #endif /* UNIX_DOMAIN_SOCKETS */ while (1) { #ifdef SYSV_IPC handle_ipc_request(msgp); #else /* NOT SYSV_IPC */ fd_set rmask; FD_ZERO(&rmask); FD_SET(fileno(stdin), &rmask); if (uls >= 0) FD_SET(uls, &rmask); if (ils >= 0) FD_SET(ils, &rmask); if (select(max2(fileno(stdin),max2(uls,ils)) + 1, &rmask, (fd_set *)NULL, (fd_set *)NULL, (struct timeval *)NULL) < 0) { perror(progname); fprintf(stderr,"%s: unable to select\n",progname); return 1; } /* if */ #ifdef UNIX_DOMAIN_SOCKETS if (uls > 0 && FD_ISSET(uls, &rmask)) handle_unix_request(uls); #endif #ifdef INTERNET_DOMAIN_SOCKETS if (ils > 0 && FD_ISSET(ils, &rmask)) handle_internet_request(ils); #endif /* INTERNET_DOMAIN_SOCKETS */ if (FD_ISSET(fileno(stdin), &rmask)) /* from stdin (gnu process) */ handle_response(); #endif /* NOT SYSV_IPC */ } /* while (1) */ } /* main */ #endif /* SYSV_IPC || UNIX_DOMAIN_SOCKETS || INTERNET_DOMAIN_SOCKETS */ gnuserv-3.12.8/devices.el0000644000175000017500000002757307045413340015174 0ustar martinsmartins;;; devices.el -- XEmacs device API emulation ;; Author: wmperry ;; Created: 1998/04/17 19:05:35 ;; Version: 1.7 ;; Keywords: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Copyright (c) 1996 by William M. Perry ;;; Copyright (c) 1996 - 1998 Free Software Foundation, Inc. ;;; ;;; This file is not part of GNU Emacs, but the same permissions apply. ;;; ;;; GNU Emacs 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, or (at your option) ;;; any later version. ;;; ;;; GNU Emacs 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 GNU Emacs; see the file COPYING. If not, write to the ;;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;;; Boston, MA 02111-1307, USA. ;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; This is a complete implementation of all the device-* functions found in ;; XEmacs 19.14. A 'device' for Emacs 19 is just a frame, from which we can ;; determine the connection to an X display, etc. (require 'cl) (eval-when-compile (if (string-match "XEmacs" (emacs-version)) (set 'byte-optimize nil))) (if (string-match "XEmacs" (emacs-version)) nil '() (defalias 'selected-device 'ignore) (defalias 'device-or-frame-p 'framep) (defalias 'device-console 'ignore) (defalias 'device-sound-enabled-p 'ignore) (defalias 'device-live-p 'frame-live-p) (defalias 'devicep 'framep) (defalias 'frame-device 'identity) (defalias 'redisplay-device 'redraw-frame) (defalias 'redraw-device 'redraw-frame) (defalias 'select-device 'select-frame) (defalias 'set-device-class 'ignore) (defun make-device (type connection &optional props) "Create a new device of type TYPE, attached to connection CONNECTION. The valid values for CONNECTION are device-specific; however, CONNECTION is generally a string. (Specifically, for X devices, CONNECTION should be a display specification such as \"foo:0\", and for TTY devices, CONNECTION should be the filename of a TTY device file, such as \"/dev/ttyp4\", or nil to refer to XEmacs' standard input/output.) PROPS, if specified, should be a plist of properties controlling device creation. If CONNECTION specifies an already-existing device connection, that device is simply returned; no new device is created, and PROPS have no effect." (cond ((and (eq type 'x) connection) (make-frame-on-display connection props)) ((eq type 'x) (make-frame props)) ((eq type 'tty) nil) (t (error "Unsupported device-type: %s" type)))) (defun make-frame-on-device (type connection &optional props) "Create a frame of type TYPE on CONNECTION. TYPE should be a symbol naming the device type, i.e. one of x An X display. CONNECTION should be a standard display string such as \"unix:0\", or nil for the display specified on the command line or in the DISPLAY environment variable. Only if support for X was compiled into XEmacs. tty A standard TTY connection or terminal. CONNECTION should be a TTY device name such as \"/dev/ttyp2\" (as determined by the Unix command `tty') or nil for XEmacs' standard input and output (usually the TTY in which XEmacs started). Only if support for TTY's was compiled into XEmacs. ns A connection to a machine running the NeXTstep windowing system. Not currently implemented. win32 A connection to a machine running Microsoft Windows NT or Windows 95. Not currently implemented. pc A direct-write MS-DOS frame. Not currently implemented. PROPS should be an plist of properties, as in the call to `make-frame'. If a connection to CONNECTION already exists, it is reused; otherwise, a new connection is opened." (make-device type connection props)) (defun make-tty-device (&optional tty terminal-type) "Create a new device on TTY. TTY should be the name of a tty device file (e.g. \"/dev/ttyp3\" under SunOS et al.), as returned by the `tty' command. A value of nil means use the stdin and stdout as passed to XEmacs from the shell. If TERMINAL-TYPE is non-nil, it should be a string specifying the type of the terminal attached to the specified tty. If it is nil, the terminal type will be inferred from the TERM environment variable." (make-device 'tty tty (list 'terminal-type terminal-type))) (defun make-x-device (&optional display) (make-device 'x display)) (defun set-device-selected-frame (device frame) "Set the selected frame of device object DEVICE to FRAME. If DEVICE is nil, the selected device is used. If DEVICE is the selected device, this makes FRAME the selected frame." (select-frame frame)) (defun set-device-baud-rate (device rate) "Set the output baud rate of DEVICE to RATE. On most systems, changing this value will affect the amount of padding and other strategic decisions made during redisplay." (setq baud-rate rate)) (defun dfw-device (obj) "Given a device, frame, or window, return the associated device. Return nil otherwise." (cond ((windowp obj) (window-frame obj)) ((framep obj) obj) (t nil))) (defun event-device (event) "Return the device that EVENT occurred on. This will be nil for some types of events (e.g. keyboard and eval events)." (dfw-device (posn-window (event-start event)))) (defun device-connection (&optional device) "Return the connection of the specified device. DEVICE defaults to the selected device if omitted" (or (cdr-safe (assq 'display (frame-parameters device))) "stdio")) (defun find-device (connection &optional type) "Look for an existing device attached to connection CONNECTION. Return the device if found; otherwise, return nil. If TYPE is specified, only return devices of that type; otherwise, return devices of any type. (It is possible, although unlikely, that two devices of different types could have the same connection name; in such a case, the first device found is returned.)" (let ((devices (device-list)) (retval nil)) (while (and devices (not nil)) (if (equal connection (device-connection (car devices))) (setq retval (car devices))) (setq devices (cdr devices))) retval)) (defalias 'get-device 'find-device) (defmacro device-baud-rate (&optional device) "Return the output baud rate of DEVICE." 'baud-rate) (defun device-on-window-system-p (&optional device) "Return non-nil if DEVICE is on a window system. This generally means that there is support for the mouse, the menubar, the toolbar, glyphs, etc." (and (cdr-safe (assq 'display (frame-parameters device))) t)) (defun device-name (&optional device) "Return the name of the specified device." (or (cdr-safe (assq 'display (frame-parameters device))) "stdio")) (defun device-frame-list (&optional device) "Return a list of all frames on DEVICE. If DEVICE is nil, the selected device will be used." (let ((desired (device-connection device))) (filtered-frame-list (function (lambda (x) (equal (device-connection x) desired)))))) (defun device-list () "Return a list of all devices" (let ((seen nil) (cur nil) (conn nil) (retval nil) (not-heard (frame-list))) (while not-heard (setq cur (car not-heard) conn (device-connection cur) not-heard (cdr not-heard)) (if (member conn seen) nil ; Already got it (setq seen (cons conn seen) ; Whoo hoo, a new one! retval (cons cur retval)))) retval)) (defvar delete-device-hook nil "Function or functions to call when a device is deleted. One argument, the to-be-deleted device.") (defun delete-device (device &optional force) "Delete DEVICE, permanently eliminating it from use. Normally, you cannot delete the last non-minibuffer-only frame (you must use `save-buffers-kill-emacs' or `kill-emacs'). However, if optional second argument FORCE is non-nil, you can delete the last frame. (This will automatically call `save-buffers-kill-emacs'.)" (let ((frames (device-frame-list device))) (run-hook-with-args 'delete-device-hook device) (while frames (delete-frame (car frames) force) (setq frames (cdr frames))))) (defun device-color-cells (&optional device) (case window-system ((x win32 w32 pm) (x-display-color-cells device)) (ns (ns-display-color-cells device)) (otherwise 1))) (defun device-pixel-width (&optional device) (case window-system ((x win32 w32 pm) (x-display-pixel-width device)) (ns (ns-display-pixel-width device)) (otherwise (frame-width device)))) (defun device-pixel-height (&optional device) (case window-system ((x win32 w32 pm) (x-display-pixel-height device)) (ns (ns-display-pixel-height device)) (otherwise (frame-height device)))) (defun device-mm-width (&optional device) (case window-system ((x win32 w32 pm) (x-display-mm-width device)) (ns (ns-display-mm-width device)) (otherwise nil))) (defun device-mm-height (&optional device) (case window-system ((x win32 w32 pm) (x-display-mm-height device)) (ns (ns-display-mm-height device)) (otherwise nil))) (defun device-bitplanes (&optional device) (case window-system ((x win32 w32 pm) (x-display-planes device)) (ns (ns-display-planes device)) (otherwise 2))) (defun device-class (&optional device) (case window-system (x ; X11 (cond ((fboundp 'x-display-visual-class) (let ((val (symbol-name (x-display-visual-class device)))) (cond ((string-match "color" val) 'color) ((string-match "gray-scale" val) 'grayscale) (t 'mono)))) ((fboundp 'x-display-color-p) (if (x-display-color-p device) 'color 'mono)) (t 'color))) (pm ; OS/2 Presentation Manager (cond ((fboundp 'pm-display-visual-class) (let ((val (symbol-name (pm-display-visual-class device)))) (cond ((string-match "color" val) 'color) ((string-match "gray-scale" val) 'grayscale) (t 'mono)))) ((fboundp 'pm-display-color-p) (if (pm-display-color-p device) 'color 'mono)) (t 'color))) (ns (cond ((fboundp 'ns-display-visual-class) (let ((val (symbol-name (ns-display-visual-class device)))) (cond ((string-match "color" val) 'color) ((string-match "gray-scale" val) 'grayscale) (t 'mono)))) ((fboundp 'ns-display-color-p) (if (ns-display-color-p device) 'color 'mono)) (t 'mono))) (otherwise 'color))) (defun device-class-list () "Returns a list of valid device classes." (list 'color 'grayscale 'mono)) (defun valid-device-class-p (class) "Given a CLASS, return t if it is valid. Valid classes are 'color, 'grayscale, and 'mono." (memq class (device-class-list))) (defun device-or-frame-type (device-or-frame) "Return the type (e.g. `x' or `tty') of DEVICE-OR-FRAME. DEVICE-OR-FRAME should be a device or a frame object. See `device-type' for a description of the possible types." (or window-system 'tty)) (defun device-type (&optional device) "Return the type of the specified device (e.g. `x' or `tty'). Value is `tty' for a tty device (a character-only terminal), `x' for a device which is a connection to an X server, 'ns' for a device which is a connection to a NeXTStep dps server, 'win32' or 'w32' for a Windows-NT window, 'pm' for an OS/2 Presentation Manager window, 'intuition' for an Amiga screen" (device-or-frame-type device)) (defun device-type-list () "Return a list of valid console types." (if window-system (list window-system 'tty) (list 'tty))) (defun valid-device-type-p (type) "Given a TYPE, return t if it is valid." (memq type (device-type-list))) ) ; This closes the conditional on whether we are in XEmacs or not (provide 'devices) (eval-when-compile (if (string-match "XEmacs" (emacs-version)) (set 'byte-optimize t))) gnuserv-3.12.8/config.h.bot0000444000175000017500000000111107540370714015412 0ustar martinsmartins#define CONST const #if (defined(linux) && defined(HAVE_BSD_SGTTY)) || (!defined(linux) && defined(HAVE_SGTTY)) #define USE_LITOUT #else #define DONT_USE_LITOUT #endif /* From XEmacs config.h.in */ #ifndef BITS_PER_CHAR #define BITS_PER_CHAR 8 #endif #define LONGBITS (SIZEOF_LONG * BITS_PER_CHAR) /* Define the return type of signal handlers if the s/xxx.h file did not already do so. */ #define RETSIGTYPE void #ifndef XCDECL #define XCDECL #endif /* SIGTYPE is the macro we actually use. */ #ifndef SIGTYPE #define SIGTYPE RETSIGTYPE XCDECL #define SIGRETURN return #endif gnuserv-3.12.8/gnuserv.h0000444000175000017500000001322107540357160015060 0ustar martinsmartins/* -*-C-*- Header file for the XEmacs server and client C code. This file is part of XEmacs. Copying is permitted under those conditions described by the GNU General Public License. Copyright (C) 1989 Free Software Foundation, Inc. Author: Andy Norman (ange@hplb.hpl.hp.com), based on 'etc/server.c' and 'etc/emacsclient.c' from the 18.52 GNU Emacs distribution. Please mail bugs and suggestions to the author at the above address. */ /* HISTORY * 11-Nov-1990 bristor@simba * Added EOT stuff. */ /* * This file incorporates new features added by Bob Weiner , * Darrell Kindred and Arup Mukherjee . * Please see the note at the end of the README file for details. * * (If gnuserv came bundled with your emacs, the README file is probably * ../etc/gnuserv.README relative to the directory containing this file) */ #define GNUSERV_VERSION "3.12" /* Note: this setting can cause client-server connection failure if the * value of TMPDIR is not shared by client and server at run-time. */ #define USE_TMPDIR #define PATCHLEVEL 2 #define NO_SHORTNAMES /* gnuserv should not be compiled using SOCKS */ #define DO_NOT_SOCKSIFY #include #undef signal /* Define the communication method between server and clients: * You can have either or both kinds of sockets, but you can't mix * sockets with sysv ipc */ #if defined(HAVE_INTERNET_DOMAIN_SOCKETS) || defined(HAVE_UNIX_DOMAIN_SOCKETS) #if defined(HAVE_INTERNET_DOMAIN_SOCKETS) #define INTERNET_DOMAIN_SOCKETS #endif #if defined(HAVE_UNIX_DOMAIN_SOCKETS) #define UNIX_DOMAIN_SOCKETS #endif #else #if defined(HAVE_SYSVIPC) #define SYSV_IPC #endif #endif /* * Define additional authentication protocols to be used. These methods will * be tried before falling back to the default gnuserv protocol (based on * the GNU_SECURE environment variable). Currently, only MIT-MAGIC-COOKIE-1 * is also supported. * * Comment out the next line(s) if you don't want to enable the * appropriate authentication protocol. */ #if defined (HAVE_XAUTH) #define AUTH_MAGIC_COOKIE #endif /* HAVE_XAUTH */ /* * stuff related to supporting MIT-MAGIC-COOKIE-1 */ #define MCOOKIE_SCREEN "999" /* screen # to use as the gnuserv cookie */ #define MCOOKIE_NAME "MAGIC-1" /* authentication protocol name */ #define MCOOKIE_X_NAME "MIT-MAGIC-COOKIE-1" /* as needed by X */ #define DEFAUTH_NAME "GNU-SECURE" /* name of default auth protocol */ #define AUTH_TIMEOUT 15 /* # seconds to wait for auth data */ #define AUTH_NAMESZ 15 /* max allows auth protocol name size */ #include #include #include #include #include #include #include "syssignal.h" #include #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_SYS_TIME_H #include #endif /* * If you are using SYSV_IPC, you might want to make the buffer size bigger * since it limits the size of requests and responses. Don't make it bigger * than your system's max message size though (usually a couple of k) or else * msgsend will start failing. For sockets, using the system BUFSIZ is usually * what you want. */ # define GSERV_BUFSZ BUFSIZ #ifdef SYSV_IPC #include #include #define send_string(s,str) \ if (strlen(msgp->mtext) + strlen(str) < GSERV_BUFSZ) \ strcat(msgp->mtext,str); \ else \ { \ fprintf(stderr,"%s: not enough message buffer space\n",progname); \ exit(1); \ } \ #endif /* SYSV_IPC */ #if defined(INTERNET_DOMAIN_SOCKETS) || defined(UNIX_DOMAIN_SOCKETS) #include #endif /* INTERNET_DOMAIN_SOCKETS || UNIX_DOMAIN_SOCKETS */ #ifdef INTERNET_DOMAIN_SOCKETS #include #include #include #define TABLE_SIZE 101 /* The number of entries in the hash table */ #define HASH(host) host /* Rather simplistic hash function */ #define DEFAULT_PORT 21490 /* default port number to use is * DEFAULT_PORT + uid */ #endif /* INTERNET_DOMAIN_SOCKETS */ #ifdef UNIX_DOMAIN_SOCKETS #include #define HIDE_UNIX_SOCKET /* put the unix socket in a protected dir */ #endif /* UNIX_DOMAIN_SOCKETS */ /* On some platforms, we need to do the equivalent of "stty litout" to get * characters like ^D to pass through to emacs. This problem has only * been observed under emacs18; fsf19 and lemacs are probably okay without it. */ #ifndef DONT_USE_LITOUT #if !defined(HAVE_TERMIO) && !defined(HAVE_TERMIOS) && !defined(VMS) #if !defined(BSD4_1) #define USE_LITOUT #endif #endif #endif #define HOSTNAMSZ 255 /* max size of a hostname */ #define REPLYSIZ 300 /* max size of reply from server to client */ #undef FALSE #define FALSE 0 #undef TRUE #define TRUE 1 extern char *optarg; extern int optind; extern char *progname; extern char *tmpdir; /* The casts shut Sun's compiler up and are safe in the context these are actually used. */ #define max2(x,y) (((int) (x) > (int) (y)) ? (x) : (y)) #define min2(x,y) (((int) (x) < (int) (y)) ? (x) : (y)) #ifndef _NFILE /* rough guess at maximum number of open files */ #define _NFILE 20 #endif #define EOT_STR "\004" #define EOT_CHR '\004' /* connection types */ #define CONN_UNIX 0 #define CONN_INTERNET 1 #define CONN_IPC 2 /* function declarations */ int make_connection (char *hostarg, int portarg, int *s); #ifdef SYSV_IPC void disconnect_from_ipc_server(); #endif #if defined(INTERNET_DOMAIN_SOCKETS) || defined(UNIX_DOMAIN_SOCKETS) void send_string (int s, const char *msg); void disconnect_from_server (int s, int echo); int read_line (int s, char *dest); #endif #ifdef INTERNET_DOMAIN_SOCKETS int internet_addr (char *host); #endif gnuserv-3.12.8/gnuserv-compat.el0000444000175000017500000001601307656601722016520 0ustar martinsmartins;; gnuserv-compat.el - Help GNU XEmacs gnuserv.el work under GNU Emacs. ;; Copyright (C) 1998, 1999, 2000, 2003 Martin Schwenke ;; ;; Author: Martin Schwenke ;; Maintainer: Martin Schwenke ;; Created: 20 November 1998 ;; $Id: gnuserv-compat.el,v 1.10 2003/05/09 01:26:42 martins Exp $ ;; Keywords: gnuserv ;; 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, 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. ;; ;; If you have not received a copy of the GNU General Public License ;; along with this software, it can be obtained from the GNU Project's ;; World Wide Web server (http://www.gnu.org/copyleft/gpl.html), from ;; its FTP server (ftp://ftp.gnu.org/pub/gnu/GPL), by sending an electronic ;; mail to this program's maintainer or by writing to the Free Software ;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ;;; Commentary: ;; ;; Under non-XEmacs (tested 20.7, 21.x) ;; ;; (autoload 'gnuserv-start "gnuserv-compat" ;; "Allow this Emacs process to be a server for client processes." ;; t) ;; ;; Note that this file does a (require 'gnuserv) near the end. ;; ;; This code does a few things including: ;; ;; * A poor emulation of XEmacs' device handling, mapping devices to ;; frames. See the (tiny bit of) code for details. Note that this ;; emulation might only work for the version of gnuserv that it ;; comes with. Other stuff that uses XEmacs devices might behave ;; badly when used with this emulation. ;;; Code: ;; Miscellaneous functions that are in XEmacs but not GNU Emacs up to ;; 20.3. Also, XEmacs preloads the common lisp stuff, and we might as ;; well use it here. (require 'cl) (eval-and-compile (unless (fboundp 'define-obsolete-variable-alias) (defalias 'define-obsolete-variable-alias 'make-obsolete-variable)) (unless (fboundp 'functionp) (defun functionp (object) "Non-nil if OBJECT is a type of object that can be called as a function." (or (subrp object) (byte-code-function-p object) (eq (car-safe object) 'lambda) (and (symbolp object) (fboundp object))))) ;; add-minor-mode not available in 20.7 (unless (fboundp 'add-minor-mode) (defun add-minor-mode (toggle name) "Register a new minor mode." (pushnew (list toggle name) minor-mode-alist :test 'equal))) ;; temporary-file-directory not available in 19.34 (unless (boundp 'temporary-file-directory) (defvar temporary-file-directory (cond ((getenv "TMPDIR")) (t "/tmp")))) (unless (fboundp 'temp-directory) (defun temp-directory () "Return the pathname to the directory to use for temporary files. On NT/MSDOS, this is obtained from the TEMP or TMP environment variables, defaulting to the value of `temporary-file-directory' if they are both undefined. On Unix it is obtained from TMPDIR, with the value of `temporary-file-directory' as the default." (if (eq system-type 'windows-nt) (cond ((getenv "TEMP")) ((getenv "TMP")) (t (directory-file-name temporary-file-directory))) (cond ((getenv "TMPDIR")) (t (directory-file-name temporary-file-directory)))))) ) ;; eval-and-compile ;; If we're not running XEmacs then advise `make-frame', ;; `delete-frame' and `filtered-frame-list' to handle some device ;; stuff. (if (string-match "XEmacs" (emacs-version)) nil ;; XEmacs `make-frame' takes an optional device to create the frame ;; on. Since `make-device' just calls 'make-frame', we don't want ;; to make a new frame on both occasions. Therefore, if the device ;; already represents a live frame, we modify the frame parameters ;; as desired and then return the existing frame. Modifying the ;; frame parameters can cause an annoying flicker, but that's all we ;; can do! If the device doesn't represent a live frame, we create ;; the frame as requested. (defadvice make-frame (around gnuserv-compat-make-frame first (&optional parameters device) activate) (if (and device (frame-live-p device)) (progn (if parameters (modify-frame-parameters device parameters)) (setq ad-return-value device)) ad-do-it)) ;; Advise `delete-frame' to run `delete-device-hook'. This might be a ;; little too hacky, but it seems to work! If someone actually tries ;; to do something device specific then it will probably blow up! (defadvice delete-frame (before gnuserv-compat-delete-frame first nil activate) (run-hook-with-args 'delete-device-hook frame)) ;; Advise `filtered-frame-list' to ignore the optional device ;; argument. Here we don't follow the mapping of devices to frames. ;; We just assume that any frame satisfying the predicate will do. (defadvice filtered-frame-list (around gnuserv-compat-filtered-frame-list first (predicate &optional device) activate) ad-do-it)) ;; Emulate XEmacs devices. A device is just a frame. For the most ;; part we use devices.el from the Emacs-W3 distribution. In some ;; places the implementation seems wrong, so we "fix" it! (if (string-match "XEmacs" (emacs-version)) nil (require 'devices) (defalias 'device-list 'frame-list) (defalias 'selected-device 'selected-frame) (defun device-frame-list (&optional device) (list (if device device (selected-frame))))) ;; Check iconification and perform deiconification the GNU Emacs way. ;; There might be some XEmacs subtlty that I'm missing, but it seems ;; to do the job. (unless (fboundp 'frame-iconified-p) (defun frame-iconified-p (frame) (equal (frame-visible-p frame) 'icon))) (unless (fboundp 'deiconify-frame) (defalias 'deiconify-frame 'make-frame-visible)) ;; GNU Emacs doesn't have a way of checking if a frame is totally ;; visible, so we just do something sensible. (unless (fboundp 'frame-totally-visible-p) (defun frame-totally-visible-p (frame) (eq t (frame-visible-p frame)))) ;; Make custom stuff work even without customize ;; Courtesy of Hrvoje Niksic ;; via Ronan Waide . (eval-and-compile (condition-case () (require 'custom) (error nil)) (if (and (featurep 'custom) (fboundp 'custom-declare-variable)) nil ;; We've got what we needed ;; We have the old custom-library, hack around it! (defmacro defgroup (&rest args) nil) (defmacro defcustom (var value doc &rest args) (` (defvar (, var) (, value) (, doc)))) (defmacro defface (var value doc &rest args) (` (make-face (, var)))) (defmacro define-widget (&rest args) nil))) ;; Now for gnuserv... (require 'gnuserv) (provide 'gnuserv-compat) ;;; gnuserv-compat.el ends here gnuserv-3.12.8/gnuserv.10000444000175000017500000002666607540353571015014 0ustar martinsmartins.TH GNUSERV 1 "" "XEmacs Server" .UC 4 .SH NAME gnuserv, gnuclient \- Server and Clients for XEmacs .SH SYNOPSIS .B gnuclient [-nw] [-display display] [-q] [-v] [-l library] [-batch] [-f function] [-eval form] [-h hostname] [-p port] [-r remote-pathname] [[+line] file] ... .br .B gnudoit [-q] form .br .B gnuserv .br .B gnuattach Removed as of gnuserv 3.x .SH DESCRIPTION .PP \fIgnuclient\fP allows the user to request a running XEmacs process to edit the named files or directories and/or evaluate lisp forms. Depending on your environment, it can be an X frame or a TTY frame. One typical use for this is with a dialup connection to a machine on which an XEmacs process is currently running. .PP \fIgnudoit\fP is a shell script frontend to ``gnuclient -batch -eval form''. Its use is deprecated. Try to get used to calling gnuclient directly. .PP \fIgnuserv\fP is the server program that is set running by XEmacs to handle all incoming and outgoing requests. It is not usually invoked directly, but is started from XEmacs by loading the \fIgnuserv\fP package and evaluating the Lisp form (gnuserv-start). .PP \fIgnuattach\fP no longer exists. Its functionality has been replaced by \fIgnuclient -nw\fP. .SH OPTIONS .PP \fIgnuclient\fP supports as much of the command line options of Emacs as makes sense in this context. In addition it adds a few of its own. .br Options with long names can also be specified using a double hyphen instead of a single one. .TP 8 .BI \-nw This option makes \fIgnuclient\fP act as a frontend such that XEmacs can attach to the current TTY. XEmacs will then open a new TTY frame. The effect is similar to having started a new XEmacs on this TTY with the ``-nw'' option. It currently only works if XEmacs is running on the same machine as gnuclient. This is the default if the `DISPLAY' environment variable is not set. .TP 8 .BI \-display " display, " \--display " display" If this option is given or the `DISPLAY' environment variable is set then gnuclient will tell XEmacs to edit files in a frame on the specified X device. .TP 8 .BI \-q This option informs \fIgnuclient\fP to exit once connection has been made with the XEmacs process. Normally \fIgnuclient\fP waits until all of the files on the command line have been finished with (their buffers killed) by the XEmacs process, and all the forms have been evaluated. .TP 8 .BI \-v When this option is specified \fIgnuclient\fP will request for the specified files to be viewed instead of edited. .TP 8 .BI \-l " library" Tell Emacs to load the specified library. .TP 8 .BI \-batch Tell Emacs not to open any frames. Just load libraries and evaluate lisp code. If no files to execute, functions to call or forms to eval are given using the .BR \-l , .BR \-f , or .B \-eval options, then forms to eval are read from STDIN. .TP 8 .BI \-f " function," Make Emacs execute the lisp function. .TP 8 .BI \-eval " form" Make Emacs execute the lisp form. .TP 8 .BI \-h " hostname" Used only with Internet-domain sockets, this option specifies the host machine which should be running \fIgnuserv\fP. If this option is not specified then the value of the environment variable GNU_HOST is used if set. If no hostname is specified, and the GNU_HOST variable is not set, an internet connection will not be attempted. N\.B.: \fIgnuserv\fP does NOT allow internet connections unless XAUTH authentication is used or the GNU_SECURE variable has been specified and points at a file listing all trusted hosts. (See SECURITY below.) .br Note that an internet address may be specified instead of a hostname which can speed up connections to the server by quite a bit, especially if the client machine is running YP. .br Note also that a hostname of \fBunix\fP can be used to specify that the connection to the server should use a Unix-domain socket (if supported) rather than an Internet-domain socket. .TP 8 .BI \-p " port" Used only with Internet-domain sockets, this option specifies the service port used to communicate between server and clients. If this option is not specified, then the value of the environment variable GNU_PORT is used, if set, otherwise a service called ``gnuserv'' is looked up in the services database. Finally, if no other value can be found for the port, then a default port is used which is usually 21490 + uid. .br Note that since \fIgnuserv\fP doesn't allow command-line options, the port for it will have to be specified via one of the alternative methods. .TP 8 .BI \-r " pathname" Used only with Internet-domain sockets, the pathname argument may be needed to inform XEmacs how to reach the root directory of a remote machine. \fIgnuclient\fP prepends this string to each path argument given. For example, if you were trying to edit a file on a client machine called otter, whose root directory was accessible from the server machine via the path /net/otter, then this argument should be set to '/net/otter'. If this option is omitted, then the value is taken from the environment variable GNU_NODE, if set, or the empty string otherwise. .TP 8 .BI "[+n] file" This is the path of the file to be edited. If the file is a directory, then the directory browsers dired or monkey are usually invoked instead. The cursor is put at line number 'n' if specified. .SH SETUP \fIgnuserv\fP is packaged standardly with recent versions of XEmacs. Therefore, you should be able to start the server simply by evaluating the XEmacs Lisp form (gnuserv-start), or equivalently by typing `M-x gnuserv-start'. .SH CONFIGURATION The behavior of this suite of program is mostly controlled on the lisp side in Emacs and its behavior can be customized to a large extent. Type `M-x customize-group RET gnuserv RET' for easy access. More documentation can be found in the file `gnuserv.el' .SH EXAMPLE .RS 4 gnuclient -q -f mh-smail .br gnuclient -h cuckoo -r /ange@otter: /tmp/* .br gnuclient -nw ../src/listproc.c .RE .br .br More examples and sample wrapper scripts are provided in the etc/gnuserv directory of the Emacs installation. .SH SYSV IPC SysV IPC is used to communicate between \fIgnuclient\fP and \fIgnuserv\fP if the symbol SYSV_IPC is defined at the top of gnuserv.h. This is incompatible with both Unix-domain and Internet-domain socket communication as described below. A file called /tmp/gsrv??? is created as a key for the message queue, and if removed will cause the communication between server and client to fail until the server is restarted. .SH UNIX-DOMAIN SOCKETS A Unix-domain socket is used to communicate between \fIgnuclient\fP and \fIgnuserv\fP if the symbol UNIX_DOMAIN_SOCKETS is defined at the top of gnuserv.h. A file called /tmp/gsrvdir????/gsrv is created for communication. If the symbol USE_TMPDIR is set at the top of gnuserv.h, $TMPDIR, when set, is used instead of /tmp. If that file is deleted, or TMPDIR has different values for the server and the client, communication between server and client will fail. Only the user running gnuserv will be able to connect to the socket. .SH INTERNET-DOMAIN SOCKETS Internet-domain sockets are used to communicate between \fIgnuclient\fP and \fIgnuserv\fP if the symbol INTERNET_DOMAIN_SOCKETS is defined at the top of gnuserv.h. Both Internet-domain and Unix-domain sockets can be used at the same time. If a hostname is specified via -h or via the GNU_HOST environment variable, \fIgnuclient\fP establish connections using an internet domain socket. If not, a local connection is attempted via either a unix-domain socket or SYSV IPC. .SH SECURITY Using Internet-domain sockets, a more robust form of security is needed that wasn't necessary with either Unix-domain sockets or SysV IPC. Currently, two authentication protocols are supported to provide this: MIT-MAGIC-COOKIE-1 (based on the X11 xauth(1) program) and a simple host-based access control mechanism, hereafter called GNUSERV-1. The GNUSERV-1 protocol is always available, whereas support for MIT-MAGIC-COOKIE-1 may or may not have been enabled (via a #define at the top of gnuserv.h) at compile-time. .PP \fIgnuserv\fP, using GNUSERV-1, performs a limited form of access control at the machine level. By default no internet-domain socket is opened. If the variable GNU_SECURE can be found in \fIgnuserv\fP's environment, and it names a readable filename, then this file is opened and assumed to be a list of hosts, one per line, from which the server will allow requests. Connections from any other host will be rejected. Even the machine on which \fIgnuserv\fP is running is not permitted to make connections via the internet socket unless its hostname is explicitly specified in this file. Note that a host may be either a numeric IP address or a hostname, and that .I any user on an approved host may connect to your gnuserv and execute arbitrary elisp (e.g., delete all your files). If this file contains a lot of hostnames then the server may take quite a time to start up. .PP When the MIT-MAGIC-COOKIE-1 protocol is enabled, an internet socket \fIis\fP opened by default. \fIgnuserv\fP will accept a connection from any host, and will wait for a "magic cookie" (essentially, a password) to be presented by the client. If the client doesn't present the cookie, or if the cookie is wrong, the authentication of the client is considered to have failed. At this point. \fIgnuserv\fP falls back to the GNUSERV-1 protocol; If the client is calling from a host listed in the GNU_SECURE file, the connection will be accepted, otherwise it will be rejected. .TP 4 .I Using MIT-MAGIC-COOKIE-1 authentication When the \fIgnuserv\fP server is started, it looks for a cookie defined for display 999 on the machine where it is running. If the cookie is found, it will be stored for use as the authentication cookie. These cookies are defined in an authorization file (usually ~/.Xauthority) that is manipulated by the X11 xauth(1) program. For example, a machine "kali" which runs an emacs that invokes \fIgnuserv\fP should respond as follows (at the shell prompt) when set up correctly. .PP .RS 8 kali% xauth list .br GS65.SP.CS.CMU.EDU:0 MIT-MAGIC-COOKIE-1 11223344 .br KALI.FTM.CS.CMU.EDU:999 MIT-MAGIC-COOKIE-1 1234 .RE .PP .RS 4 In the above case, the authorization file defines two cookies. The second one, defined for screen 999 on the server machine, is used for gnuserv authentication. .PP On the client machine's side, the authorization file must contain an identical line, specifying the .I server's cookie. In other words, on a machine "foobar" which wishes to connect to "kali," the `xauth list' output should contain the line: .PP .RS 4 KALI.FTM.CS.CMU.EDU:999 MIT-MAGIC-COOKIE-1 1234 .RE .PP For more information on authorization files, take a look at the xauth(1X11) man page, or invoke xauth interactively (without any arguments) and type "help" at the prompt. Remember that case in the name of the authorization protocol (i.e.`MIT-MAGIC-COOKIE-1') .I is significant! .RE .SH ENVIRONMENT .PP .TP 8 .B DISPLAY Default X device to put edit frame. .SH FILES .PP .TP 8 .B /tmp/gsrv??? (SYSV_IPC only) .TP 8 .B /tmp/gsrvdir???/gsrv (unix domain sockets only) .TP 8 .B ~/.emacs XEmacs customization file, see xemacs(1). .SH SEE ALSO .PP .TP 8 xauth(1X11), Xsecurity(1X11), gnuserv.el .SH BUGS .PP NULs occurring in result strings don't get passed back to gnudoit properly. .SH AUTHOR. Andy Norman (ange@hplb.hpl.hp.com), based heavily upon etc/emacsclient.c, etc/server.c and lisp/server.el from the GNU Emacs 18.52 distribution. Various modifications from Bob Weiner (weiner@mot.com), Darrell Kindred (dkindred@cmu.edu), Arup Mukherjee (arup@cmu.edu), Ben Wing (ben@xemacs.org) and Hrvoje Niksic (hniksic@xemacs.org). gnuserv-3.12.8/acconfig.h0000444000175000017500000000076110135154642015137 0ustar martinsmartins/* Define this if SYSV IPC is available (e.g. msgget, etc.) */ #undef HAVE_SYSVIPC /* Define this if internet-domain sockets are available */ #undef HAVE_INTERNET_DOMAIN_SOCKETS /* Define this if berkeley unix-domain sockets are available */ #undef HAVE_UNIX_DOMAIN_SOCKETS /* Define this if have sun_len member in struct sockaddr_un */ #undef HAVE_SOCKADDR_SUN_LEN /* Define this if using Xauth authentication */ #undef HAVE_XAUTH #undef socklen_t #undef HAVE_X_WINDOWS #undef _GNU_SOURCE gnuserv-3.12.8/aclocal.m40000444000175000017500000000767410706776130015075 0ustar martinsmartinsdnl Copyright (C) 1996 Noah S. Friedman dnl $Id: aclocal.m4,v 1.3 2007/10/22 01:26:48 martins Exp $ dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation; either version 2, or (at your option) dnl any later version. dnl dnl This program is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the dnl GNU General Public License for more details. dnl dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, you can either send email to this dnl program's maintainer or write to: The Free Software Foundation, dnl Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. dnl ############################################################ define([AC_ARG_WITH_RESOLV], [AC_ARG_WITH([resolv], [ --with-resolv Use -lresolv for host name lookups. --without-resolv Do not use -lresolv for host name lookups.], [sed_downcase='y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/' val=`echo "$withval" | sed -e "$sed_downcase"` case "$val" in "" ) ac_use_resolv=yes ;; yes | no | maybe ) ac_use_resolv=$val ;; * ) AC_MSG_ERROR([$withval: invalid argument to --with-resolv]) ;; esac ],[# Default is not to link with resolv. ac_use_resolv=no ])dnl ]) dnl ############################################################ define([AC_USE_RESOLV],[ # Check whether resolv support is desired. # If --with-resolv is specified to configure, support for resolv must # be available or configure will exit with an error. # If --without-resolv is specified, no attempt is made to look for # resolv headers or libraries. # By default, configure will use resolv if all the necessary support is # available, otherwise it won't. No fatal errors should occur in either # circumstance. # Default if not otherwise found ac_resolv_support=no if test $ac_use_resolv != no ; then AC_CHECK_LIB(resolv, gethostbyname) if eval test '$'ac_cv_lib_resolv_gethostbyname = yes; then ac_resolv_support=yes elif test $ac_use_resolv = yes; then AC_MSG_ERROR([Cannot link with -lresolv. Is it missing?]) fi fi]) dnl ############################################################ define([AC_ARG_ENABLE_XAUTH], [AC_ARG_ENABLE([xauth], [ --enable-xauth Support XAUTH authentication support. --disable-xauth Do not support XAUTH authentication support.], [sed_downcase='y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/' val=`echo "$enableval" | sed -e "$sed_downcase"` case "$val" in yes | no | try ) require_xauth=$val ;; * ) AC_MSG_ERROR([$enableval: invalid argument to --enable-xauth]) ;; esac],[require_xauth=try])]) dnl ############################################################ define([AC_HAVE_XAUTH], [AC_PATH_X AC_SUBST(LIBXAUTH) if test "$require_xauth" != "no" ; then if test "$have_x" = yes; then o_CPPFLAGS="$CPPFLAGS" if test -n "$x_includes" ; then CPPFLAGS="$CPPFLAGS -I$x_includes" fi if test -n "$x_libraries" ; then CPPFLAGS="$CPPFLAGS -L$x_libraries" fi fi AC_CHECK_HEADER(X11/Xauth.h,[use_xauth=yes],[use_xauth=no]) AC_CHECK_LIB(Xau, XauGetAuthByAddr, [use_xauth=yes], [use_xauth=no]) if test "$have_x" = yes ; then CPPFLAGS="$o_CPPFLAGS" fi if test "$use_xauth" = "yes" ; then AC_DEFINE(HAVE_XAUTH) LIBXAUTH="-lXau" if test "$have_x" = yes ; then if test -n "$x_libraries" ; then LIBXAUTH="-L$x_libraries $LIBXAUTH" fi if test -n "$x_includes" ; then CPPFLAGS="$CPPFLAGS -I$x_includes" fi fi elif test "$require_xauth" = "yes" ; then AC_MSG_ERROR([Cannot find headers or libraries for XAUTH support.]) fi fi]) dnl aclocal.m4 ends here gnuserv-3.12.8/COPYING0000644000175000017500000004321707045413340014254 0ustar martinsmartins GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place - Suite 330 Boston, MA 02111-1307, 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; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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. gnuserv-3.12.8/config.h.in0000664000175000017500000000740010706776207015254 0ustar martinsmartins/* config.h.in. Generated from configure.in by autoheader. */ /* Define this if SYSV IPC is available (e.g. msgget, etc.) */ #undef HAVE_SYSVIPC /* Define this if internet-domain sockets are available */ #undef HAVE_INTERNET_DOMAIN_SOCKETS /* Define this if berkeley unix-domain sockets are available */ #undef HAVE_UNIX_DOMAIN_SOCKETS /* Define this if have sun_len member in struct sockaddr_un */ #undef HAVE_SOCKADDR_SUN_LEN /* Define this if using Xauth authentication */ #undef HAVE_XAUTH #undef socklen_t #undef HAVE_X_WINDOWS #undef _GNU_SOURCE /* Define to 1 if you have the header file. */ #undef HAVE_BSD_SGTTY_H /* Define to 1 if you have the declaration of `sys_siglist', and to 0 if you don't. */ #undef HAVE_DECL_SYS_SIGLIST /* Define to 1 if you have the `getcwd' function. */ #undef HAVE_GETCWD /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `intl' library (-lintl). */ #undef HAVE_LIBINTL /* Define to 1 if you have the header file. */ #undef HAVE_LIBINTL_H /* Define to 1 if you have the `nsl' library (-lnsl). */ #undef HAVE_LIBNSL /* Define to 1 if you have the `resolv' library (-lresolv). */ #undef HAVE_LIBRESOLV /* Define to 1 if you have the `socket' library (-lsocket). */ #undef HAVE_LIBSOCKET /* Define to 1 if you have the `memcmp' function. */ #undef HAVE_MEMCMP /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `msgget' function. */ #undef HAVE_MSGGET /* Define to 1 if you have the header file. */ #undef HAVE_SGTTY_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strerror' function. */ #undef HAVE_STRERROR /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SELECT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOCKET_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_UN_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the version of this package. */ #undef PACKAGE_VERSION /* The size of `long', as computed by sizeof. */ #undef SIZEOF_LONG /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to empty if `const' does not conform to ANSI C. */ #undef const #define CONST const #if (defined(linux) && defined(HAVE_BSD_SGTTY)) || (!defined(linux) && defined(HAVE_SGTTY)) #define USE_LITOUT #else #define DONT_USE_LITOUT #endif /* From XEmacs config.h.in */ #ifndef BITS_PER_CHAR #define BITS_PER_CHAR 8 #endif #define LONGBITS (SIZEOF_LONG * BITS_PER_CHAR) /* Define the return type of signal handlers if the s/xxx.h file did not already do so. */ #define RETSIGTYPE void #ifndef XCDECL #define XCDECL #endif /* SIGTYPE is the macro we actually use. */ #ifndef SIGTYPE #define SIGTYPE RETSIGTYPE XCDECL #define SIGRETURN return #endif