dist_3.5-30.orig/0002755000175000017500000000000011272612640014042 5ustar srivastasrivastadist_3.5-30.orig/Wishlist0000644000175000017500000000452010473316164015576 0ustar srivastasrivasta*** List of wishes for dist version 3.0 *** ======================================================================= If you wish to implement one of the following, you're welcome :-). In that case, please let me know about it. I will probably integrate your changes in my version (after some sanity checks, because I can't maintain something I don't understand). This list has no priority order whatsoever, so you may pick up one of the following suggestion and start working on it. In that case, you may want to get all the official patches for dist 3.0 first and make sure nobody is already working on that topic. ======================================================================= *** jmake Make the names used more uniform. For instance, 'Simple' appears in many rules, but with different meanings, thus making the Jmakefile harder to understand at a first glance. Allow per-system compilation rules, so that objects and source file do not inter-mix but are kept in separate directories. *** metaconfig Write some "generic" templates for writing new units, so that the user only needs to fill up some fields. For instance, there could be a template for d_* and i_* units. [That's done, they are under mcon/files. Now I only need to write the generator on top of them] Make Configure know about cross-compiling. Make Configure know about VPATH for separate object directory, with proper support from jmake. Implement the ?I: and ?L: lines. The ?I: fills in inclwanted for you, while ?L: fills in the libswanted variable. For instance, when using a socket() call, one may need to look at -lbsd. If d_socket.U lists 'bsd' within its ?L: line, then the libswanted variable will be correctly set. [Note: there are some hooks for this already] Build a library of PD routines that may be otherwise missing on some older systems, eg: getopt(). Those routines will be automagically added to the package by relying on ?P: lines, something like: ?P:getopt (HAS_GETOPT): getopt.c which would include getopt.c in the package (under some PD dir) when getopt is used and HAS_GETOPT is *not* used within the sources, in order to achieve transparent implementation. *** metalint Process '@' pre-processor lines, and signal mismatches, unrecognized commands, etc... Also warn when testing wantedness of unknown symbols or obsolete ones, etc... *** pat tools Clean that stuff. dist_3.5-30.orig/lib/0002755000175000017500000000000011272612640014610 5ustar srivastasrivastadist_3.5-30.orig/lib/Jmakefile0000644000175000017500000000313010473672443016426 0ustar srivastasrivasta/* * Jmakefile for lib subdirectory. */ ;# $Id: Jmakefile 5 2006-08-25 22:09:39Z rmanfredi $ ;# ;# Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ;# ;# You may redistribute only under the terms of the Artistic Licence, ;# as specified in the README file that comes with the distribution. ;# You may reuse parts of this distribution only within the terms of ;# that same Artistic Licence; a copy of which may be found at the root ;# of the source tree for dist 4.0. ;# ;# $Log: Jmakefile,v $ ;# Revision 3.0.1.1 1994/01/24 13:43:31 ram ;# patch16: added new directory for C code sources ;# ;# Revision 3.0 1993/08/18 12:04:34 ram ;# Baseline for dist 3.0 netwide release. ;# FILES = errnolist.a errnolist.mk FILES_SH = errnolist makedepend makedir INSTALLFLAGS = -m 444 all:: /* So that default make does not default to install */ MakeDirectories(install,$(PRIVLIB)/lib) InstallMultiple($(FILES),$(PRIVLIB)/lib) /* * InstallSingleExt: * This rule installs a single file whose basename is 'file' and * extension is 'old' into 'file^^new'. This allows changing the * dot extension of a file, for instance file.sh can be installed as * file.SH. */ #define InstallSingleExt(step,file,dest,flags,old,new) @!\ step:: file^^old @@\ @case '${MFLAGS}' in *[i]*) set +e;; esac; \ @@\ (set -x; $(INSTALL) -c flags file^^old dest/file^^new) @@\ @!\ de^^step:: @@\ @case '${MFLAGS}' in *[i]*) set +e;; esac; \ @@\ (set -x; $(RM) dest/file^^new) #define install_rule \ InstallSingleExt(install,!f,$(PRIVLIB)/lib,-m 444,.sh,.SH) Expand(install_rule,f!$(FILES_SH)!) SetSubdirs(C) dist_3.5-30.orig/lib/errnolist.sh0000644000175000017500000000244610473316164017175 0ustar srivastasrivasta# $Id: errnolist.sh,v 3.0.1.1 1994/01/24 14:00:00 ram Exp ram $ # # Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi # # You may redistribute only under the terms of the Artistic Licence, # as specified in the README file that comes with the distribution. # You may reuse parts of this distribution only within the terms of # that same Artistic Licence; a copy of which may be found at the root # of the source tree for dist 4.0. # # Original Author: Harlan Stenn # # $Log: errnolist.sh,v $ # Revision 3.0.1.1 1994/01/24 14:00:00 ram # patch16: changed top ln-style config.sh lookup into test-style one # # Revision 3.0 1993/08/18 12:04:36 ram # Baseline for dist 3.0 netwide release. # case $CONFIG in '') if test -f config.sh; then TOP=.; elif test -f ../config.sh; then TOP=..; elif test -f ../../config.sh; then TOP=../..; elif test -f ../../../config.sh; then TOP=../../..; elif test -f ../../../../config.sh; then TOP=../../../..; else echo "Can't find config.sh."; exit 1 fi . $TOP/config.sh ;; esac case "$0" in */*) cd `expr X$0 : 'X\(.*\)/'` ;; esac case "$errnolistc" in '') ;; *) echo "Making $errnolistc ..." awk -f errnolist.a < /usr/include/sys/errno.h > $errnolistc echo "It would be a good idea to make sure that $errnolistc is correct." esac dist_3.5-30.orig/lib/errnolist.mk0000644000175000017500000000211110473316164017157 0ustar srivastasrivasta# $Id: errnolist.mk,v 3.0.1.1 1994/01/24 13:59:32 ram Exp ram $ # # Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi # # You may redistribute only under the terms of the Artistic Licence, # as specified in the README file that comes with the distribution. # You may reuse parts of this distribution only within the terms of # that same Artistic Licence; a copy of which may be found at the root # of the source tree for dist 4.0. # # Original Author: Harlan Stenn # # $Log: errnolist.mk,v $ # Revision 3.0.1.1 1994/01/24 13:59:32 ram # patch16: now uses modern shell metaconfig symbols # # Revision 3.0 1993/08/18 12:04:36 ram # Baseline for dist 3.0 netwide release. # # # Make rules for the errnolist stuff case "$errnolist" in '') ;; *) $spitshell >>Makefile <>Makefile <>Makefile <<'!NO!SUBS!' foo: foo.o $(ERRNOLIST_OBJ) $(CC) -o $@ foo.o $(ERRNOLIST_OBJ) !NO!SUBS! dist_3.5-30.orig/lib/C/0002755000175000017500000000000011272612640014772 5ustar srivastasrivastadist_3.5-30.orig/lib/C/Jmakefile0000644000175000017500000000112210473666773016620 0ustar srivastasrivasta/* * Jmakefile for C subdirectory. */ ;# $Id: Jmakefile 3 2006-08-25 21:39:07Z rmanfredi $ ;# ;# Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ;# ;# You may redistribute only under the terms of the Artistic Licence, ;# as specified in the README file that comes with the distribution. ;# You may reuse parts of this distribution only within the terms of ;# that same Artistic Licence; a copy of which may be found at the root ;# of the source tree for dist 4.0. ;# ;# $Log: Jmakefile,v $ ;# Revision 3.0.1.1 1994/01/24 13:43:38 ram ;# patch16: created ;# SetSubdirs(fake) dist_3.5-30.orig/lib/C/fake/0002755000175000017500000000000011272612640015700 5ustar srivastasrivastadist_3.5-30.orig/lib/C/fake/getopt.C0000644000175000017500000000617210473316164017316 0ustar srivastasrivasta/* * getopt.C -- A getopt implementation. */ /* * $Id: getopt.C,v 3.0.1.1 1994/01/24 13:58:40 ram Exp ram $ * * Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi * * You may redistribute only under the terms of the Artistic Licence, * as specified in the README file that comes with the distribution. * You may reuse parts of this distribution only within the terms of * that same Artistic Licence; a copy of which may be found at the root * of the source tree for dist 4.0. * * Original Author: unknown, got this off net.sources * * $Log: getopt.C,v $ * Revision 3.0.1.1 1994/01/24 13:58:40 ram * patch16: created * */ #include "config.h" #include #ifdef I_STRING #include #else #include #endif #include "confmagic.h" /* Remove if not metaconfig -M */ #ifndef HAS_GETOPT /* * Get option letter from argument vector */ int opterr = 1, /* Useless, never set or used */ optind = 1, /* Index into parent argv vector */ optopt; /* Character checked for validity */ char *optarg; /* Argument associated with option */ #define BADCH (int) '?' #define EMSG "" #define tell(s) \ do { \ fputs(*nargv, stderr); \ fputs(s, stderr); \ fputc(optopt, stderr); \ fputc('\n', stderr); \ return BADCH; \ } while (0) /* * getopt * * Parses command line flags and arguments. Given the original arguments * via the (nargc, nargv) tuple, and a list of flags via 'ostr', it returns * the next flag recognized, and sets the externally visible 'optarg' * variable to point to the start of the flags's parameter, if any expected. * * When facing an invalid flag, getopt() returns '?'. * * The 'ostr' string is a list of allowed flag characters, optionally by ':' * when the flag expects a parameter, which can immediately follow the * flag or come as the next word. * * In any case, the 'optopt' variable is set upon return to the flag being * looked at, whether it was a valid flag or not. */ V_FUNC(int getopt, (nargc, nargv, ostr) int nargc /* Argument count */ NXT_ARG char **nargv /* Argument vector */ NXT_ARG char *ostr /* String specifying options */) { static char *place = EMSG; /* Option letter processing */ register1 char *oli; /* Option letter list index */ /* * Update scanning pointer. */ if (!*place) { if( optind >= nargc || *(place = nargv[optind]) != '-' || !*++place ) return EOF; if (*place == '-') { /* Found "--", end option processing */ ++optind; return EOF; } } /* * Is option letter OK? */ if ( (optopt = (int)*place++) == (int)':' || !(oli = index(ostr,optopt)) ) { if (!*place) ++optind; tell(": illegal option -- "); } /* * Found a valid option, process it. */ if (*++oli != ':') { /* Don't need argument */ optarg = NULL; if (!*place) ++optind; } else { /* Need an argument */ if (*place) optarg = place; /* No white space */ else if (nargc <= ++optind) { /* No argument */ place = EMSG; tell(": option requires an argument -- "); } else optarg = nargv[optind]; /* White space */ place = EMSG; ++optind; } return optopt; /* Dump back option letter */ } #endif dist_3.5-30.orig/lib/C/fake/Jmakefile0000644000175000017500000000146010473675126017523 0ustar srivastasrivasta/* * Jmakefile for C/fake subdirectory. */ ;# $Id: Jmakefile 9 2006-08-25 22:31:50Z rmanfredi $ ;# ;# Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ;# ;# You may redistribute only under the terms of the Artistic Licence, ;# as specified in the README file that comes with the distribution. ;# You may reuse parts of this distribution only within the terms of ;# that same Artistic Licence; a copy of which may be found at the root ;# of the source tree for dist 4.0. ;# ;# $Log: Jmakefile,v $ ;# Revision 3.0.1.1 1994/01/24 13:43:44 ram ;# patch16: created ;# FILES = dup2.C getopt.C rename.C scandir.C setsid.C INSTALLFLAGS = -m 444 all:: /* So that default make does not default to install */ MakeDirectories(install,$(PRIVLIB)/lib/C/fake) InstallMultiple($(FILES),$(PRIVLIB)/lib/C/fake) dist_3.5-30.orig/lib/C/fake/rename.C0000644000175000017500000000204510473316164017256 0ustar srivastasrivasta/* * rename.C -- A rename emulation, for renaming files only. */ /* * $Id: rename.C,v 3.0.1.1 1994/01/24 13:58:42 ram Exp ram $ * * Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi * * You may redistribute only under the terms of the Artistic Licence, * as specified in the README file that comes with the distribution. * You may reuse parts of this distribution only within the terms of * that same Artistic Licence; a copy of which may be found at the root * of the source tree for dist 4.0. * * $Log: rename.C,v $ * Revision 3.0.1.1 1994/01/24 13:58:42 ram * patch16: created * */ #include "config.h" #include "confmagic.h" /* Remove if not metaconfig -M */ #ifndef HAS_RENAME /* * rename * * Renames a file within a file system. This cannot be used to rename * directories, unfortunately. */ V_FUNC(int rename, (from, to), char *from /* Original name */ NXT_ARG char *to /* Target name */) { (void) unlink(to); if (-1 == link(from, to)) return -1; if (-1 == unlink(from)) return -1; return 0; } #endif dist_3.5-30.orig/lib/C/fake/setsid.C0000644000175000017500000000264410473316164017307 0ustar srivastasrivasta/* * setsid.C -- A setsid replacement. */ /* * $Id: setsid.C,v 3.0.1.1 1994/01/24 13:58:47 ram Exp ram $ * * Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi * * You may redistribute only under the terms of the Artistic Licence, * as specified in the README file that comes with the distribution. * You may reuse parts of this distribution only within the terms of * that same Artistic Licence; a copy of which may be found at the root * of the source tree for dist 4.0. * * $Log: setsid.C,v $ * Revision 3.0.1.1 1994/01/24 13:58:47 ram * patch16: created * */ #include "config.h" #include "confmagic.h" /* Remove if not metaconfig -M */ #ifndef HAS_SETSID /* * setsid * * Set the process group ID and create a new session for the process. * * This is a pale imitation of the setsid() system call, since a session * and a process group are two distinct things for the kernel. However, * when setsid() is not available, the effects should be comparable. */ V_FUNC_VOID(int setsid) { int error = 0; #ifdef HAS_SETPGID /* * setpgid() supersedes setpgrp() in OSF/1. */ error = setpgid(0 ,getpid()); #else #ifdef HAS_SETPGRP /* * Good old way to get a process group leader. */ #ifdef USE_BSDPGRP error = setpgrp(0 ,getpid()); /* bsd way */ #else error = setpgrp(); /* usg way */ #endif #endif #endif /* * When none of the above is defined, do nothing. */ return error; } #endif dist_3.5-30.orig/lib/C/fake/dup2.C0000644000175000017500000000346310473316164016666 0ustar srivastasrivasta/* * dup2.C -- A dup2 emulation. */ /* * $Id: dup2.C,v 3.0.1.1 1994/01/24 13:58:37 ram Exp ram $ * * Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi * * You may redistribute only under the terms of the Artistic Licence, * as specified in the README file that comes with the distribution. * You may reuse parts of this distribution only within the terms of * that same Artistic Licence; a copy of which may be found at the root * of the source tree for dist 4.0. * * Original Author: Larry Wall * * $Log: dup2.C,v $ * Revision 3.0.1.1 1994/01/24 13:58:37 ram * patch16: created * */ #include "config.h" #ifdef I_FCNTL #include #endif #include "confmagic.h" /* Remove if not metaconfig -M */ #ifndef HAS_DUP2 /* * dup2 * * This routine duplicates file descriptor 'old' into 'new'. After the * operation, both 'new' and 'old' refer to the same file 'old' was referring * to in the first place. * * Returns 0 if OK, -1 on failure with errno being set to indicate the error. * */ V_FUNC(int dup2, (old, new), int old /* Opened file descriptor */ NXT_ARG int new /* File descriptor we'd like to get */) { #ifdef HAS_FCNTL #ifdef F_DUPFD #define USE_FNCTL #endif #endif #ifdef USE_FCNTL if (old == new) return 0; close(new); return fcntl(old, F_DUPFD, new); #else int fd_used[256]; /* Fixed stack used to record dup'ed files */ int fd_top = 0; /* Top in the fixed stack */ int fd; /* Currently dup'ed file descriptor */ if (old == new) return 0; close(new); /* Ensure one free slot */ while ((fd = dup(old)) != new) /* Until dup'ed file matches */ fd_used[fd_top++] = fd; /* Remember we have to close it later */ while (fd_top > 0) /* Close all useless dup'ed slots */ close(fd_used[--fd_top]); return 0; #endif } #endif dist_3.5-30.orig/lib/C/fake/scandir.C0000644000175000017500000000740510473316164017437 0ustar srivastasrivasta/* * scandir.C -- A scandir implementation. */ /* * $Id: scandir.C,v 3.0.1.1 1994/01/24 13:58:45 ram Exp ram $ * * Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi * * You may redistribute only under the terms of the Artistic Licence, * as specified in the README file that comes with the distribution. * You may reuse parts of this distribution only within the terms of * that same Artistic Licence; a copy of which may be found at the root * of the source tree for dist 4.0. * * $Log: scandir.C,v $ * Revision 3.0.1.1 1994/01/24 13:58:45 ram * patch16: created * */ #include "config.h" #ifdef I_STRING #include #else #include #endif #ifdef I_DIRENT #include #else #ifdef I_SYS_NDIR #include #else #ifdef I_SYS_DIR #include #endif #endif #endif #include "confmagic.h" /* Remove if not metaconfig -M */ #ifndef HAS_SCANDIR extern Malloc_t malloc(); extern Malloc_t realloc(); extern DIR *opendir(); extern Direntry_t *readdir(); #define DIR_NULL ((DIR *) 0) #define ENTRY_NULL ((Direntry_t *) 0) static int alphasort _((Direntry_t **, Direntry_t **)); /* * scandir * * This routine reads the directory `dirnam' and builds an array of * pointers to directory entries using malloc(). The second parameter * is the address of a pointer to an array of structure pointers. The * third parameter is a pointer to a routine which is called with a * pointer to a directory entry and should return a non zero value * if the directory entry should be included in the arrary. If this * pointer is NULL, then all the directory entries will be included. * The last argument is a pointer to a routine which is passed to * qsort() to sort the completed array. If this pointer is NULL, the * array is not sorted. * scandir() returns the number of entries in the array and a pointer * to the array through the parameter namlist. * alphasort() is a routine which sorts the array alphabetically. */ V_FUNC(int scandir, (dirnam, namelist, sel, comp), char *dirnam /* Direcotry name */ NXT_ARG Direntry_t ***namelist /* Pointer to an array of struct ptrs */ NXT_ARG int (*sel)() /* Routine to select entries */ NXT_ARG int (*comp)() /* Routine passed to qsort */) { DIR *dirp; /* Returned by opendir() */ Direntry_t *dp; /* Read entry */ Direntry_t *dp_save; /* Place where entry is stored */ Direntry_t **tmplist; /* Where the array list is stored */ int nent = 0; /* Number of entries */ dirp = opendir(dirnam); if (dirp == DIR_NULL) return -1; /* Directory cannot be opened for reading */ for (dp = readdir(dirp); dp != ENTRY_NULL; dp = readdir(dirp)) { if (sel == ((int (*)()) 0) || (*sel)(dp)) { /* If entry has to be included */ nent++; /* One more entry */ if (nent == 1) { /* Create array for first entry */ tmplist = (Direntry_t **) malloc(sizeof(Direntry_t *)); if (tmplist == (Direntry_t **) 0) return -1; /* Cannot create array */ } else { /* Reallocate for a new entry */ tmplist = (Direntry_t **) realloc(tmplist, nent*sizeof(Direntry_t *)); if (tmplist == (Direntry_t **) 0) return -1; /* Cannot reallocate array */ } dp_save = (Direntry_t *) malloc(sizeof(Direntry_t)); if (dp_save == ENTRY_NULL) return -1; /* No space to save entry */ bcopy((char *) dp, (char *) dp_save, sizeof(Direntry_t)); *(tmplist+(nent-1)) = dp_save; } } if (comp != ((int (*)()) 0) && nent) /* Need sorting ? */ qsort(tmplist, nent, sizeof(Direntry_t *), comp); *namelist = tmplist; /* Passes the address of the arrray */ closedir(dirp); /* Close directory */ return nent; /* Number of items */ } P_FUNC(int alphasort, (d1, d2), Direntry_t **d1 NXT_ARG Direntry_t **d2) { return strcmp((*d1)->d_name, (*d2)->d_name); } #endif dist_3.5-30.orig/lib/C/fake/Makefile.SH0000755000175000017500000001046210473675243017667 0ustar srivastasrivasta: Makefile.SH generated from Jmake.tmpl and Jmakefile [jmake 3.5 PL0] : $X-Id: Jmake.tmpl 8 2006-08-25 22:27:18Z rmanfredi $ case $CONFIG in '') if test -f config.sh; then TOP=.; elif test -f ../config.sh; then TOP=..; elif test -f ../../config.sh; then TOP=../..; elif test -f ../../../config.sh; then TOP=../../..; elif test -f ../../../../config.sh; then TOP=../../../..; else echo "Can't find config.sh."; exit 1 fi . $TOP/config.sh ;; esac case "$0" in */*) cd `expr X$0 : 'X\(.*\)/'` ;; esac CURRENT=lib/C/fake DIR=`echo $CURRENT/ | sed -e 's/\.\///g'` echo "Extracting ${DIR}Makefile (with variable substitutions)" INSTALL=`echo $install | sed -e 's,\./i,\$(TOP)/i,'` INSTALLDIR=`echo $installdir | sed -e 's,\./i,\$(TOP)/i,'` DATE=`date` $spitshell >Makefile <>Makefile <<'!NO!SUBS!' ######################################################################## # Jmake rules for building libraries, programs, scripts, and data files # $X-Id: Jmake.rules 8 2006-08-25 22:27:18Z rmanfredi $ ######################################################################## # Start of Jmakefile # $X-Id: Jmakefile 9 2006-08-25 22:31:50Z rmanfredi $ # # Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi # # You may redistribute only under the terms of the Artistic Licence, # as specified in the README file that comes with the distribution. # You may reuse parts of this distribution only within the terms of # that same Artistic Licence; a copy of which may be found at the root # of the source tree for dist 4.0. # # $X-Log: Jmakefile,v $ # Revision 3.0.1.1 1994/01/24 13:43:44 ram # patch16: created # FILES = dup2.C getopt.C rename.C scandir.C setsid.C INSTALLFLAGS = -m 444 all:: install:: @case '${MFLAGS}' in *[i]*) set +e;; esac; \ for dir in $(PRIVLIB)/lib/C/fake; do \ (set -x; test -d $$dir || $(INSTALLDIR) $$dir) || \ exit 1; \ done local_install:: $(FILES) @case '${MFLAGS}' in *[i]*) set +e;; esac; \ (set -x; test -d $(INSTALL_PREFIX)$(PRIVLIB)/lib/C/fake || \ $(INSTALLDIR) $(INSTALL_PREFIX)$(PRIVLIB)/lib/C/fake); \ for i in $(FILES); do \ (set -x; $(INSTALL) -c $(INSTALLFLAGS) \ $$i $(INSTALL_PREFIX)$(PRIVLIB)/lib/C/fake) || exit 1;\ done local_deinstall:: @case '${MFLAGS}' in *[i]*) set +e;; esac; \ for i in $(FILES); do \ (set -x; $(RM) $(INSTALL_PREFIX)$(PRIVLIB)/lib/C/fake/$$i); \ done ######################################################################## # Common rules for all Makefiles -- do not edit all:: clean: local_clean realclean: local_realclean clobber: local_clobber local_clean:: if test -f core; then $(RM) core; fi $(RM) *~ *.o local_realclean:: local_clean local_clobber:: local_realclean $(RM) Makefile config.sh install:: local_install install.man:: maybe_install.man deinstall:: local_deinstall deinstall.man:: maybe_deinstall.man install.man-no: deinstall.man-no: maybe_install.man: install.man-no maybe_deinstall.man: deinstall.man-no Makefile.SH: Jmakefile -@if test -f $(TOP)/.package; then \ if test -f Makefile.SH; then \ echo " $(RM) Makefile.SH~; $(MV) Makefile.SH Makefile.SH~"; \ $(RM) Makefile.SH~; $(MV) Makefile.SH Makefile.SH~; \ fi; \ echo " $(JMAKE) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT)" ; \ $(JMAKE) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT) ; \ else touch $@; fi Makefile: Makefile.SH /bin/sh Makefile.SH tags:: $(CTAGS) -w *.[ch] $(CTAGS) -xw *.[ch] > tags local_clobber:: $(RM) tags ######################################################################## # Empty rules for directories with no sub-directories -- do not edit local_install:: @echo "install in $(CURRENT) done." local_deinstall:: @echo "deinstall in $(CURRENT) done." local_install.man:: @echo "install.man in $(CURRENT) done." local_deinstall.man:: @echo "deinstall.man in $(CURRENT) done." Makefiles:: Makefiles.SH:: !NO!SUBS! chmod 644 Makefile $eunicefix Makefile dist_3.5-30.orig/lib/C/Makefile.SH0000755000175000017500000001266210473675243016765 0ustar srivastasrivasta: Makefile.SH generated from Jmake.tmpl and Jmakefile [jmake 3.5 PL0] : $X-Id: Jmake.tmpl 8 2006-08-25 22:27:18Z rmanfredi $ case $CONFIG in '') if test -f config.sh; then TOP=.; elif test -f ../config.sh; then TOP=..; elif test -f ../../config.sh; then TOP=../..; elif test -f ../../../config.sh; then TOP=../../..; elif test -f ../../../../config.sh; then TOP=../../../..; else echo "Can't find config.sh."; exit 1 fi . $TOP/config.sh ;; esac case "$0" in */*) cd `expr X$0 : 'X\(.*\)/'` ;; esac CURRENT=lib/C DIR=`echo $CURRENT/ | sed -e 's/\.\///g'` echo "Extracting ${DIR}Makefile (with variable substitutions)" DATE=`date` $spitshell >Makefile <>Makefile <<'!NO!SUBS!' ######################################################################## # Jmake rules for building libraries, programs, scripts, and data files # $X-Id: Jmake.rules 8 2006-08-25 22:27:18Z rmanfredi $ ######################################################################## # Start of Jmakefile # $X-Id: Jmakefile 3 2006-08-25 21:39:07Z rmanfredi $ # # Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi # # You may redistribute only under the terms of the Artistic Licence, # as specified in the README file that comes with the distribution. # You may reuse parts of this distribution only within the terms of # that same Artistic Licence; a copy of which may be found at the root # of the source tree for dist 4.0. # # $X-Log: Jmakefile,v $ # Revision 3.0.1.1 1994/01/24 13:43:38 ram # patch16: created # ######################################################################## # Common rules for all Makefiles -- do not edit all:: clean: sub_clean local_clean realclean: sub_realclean local_realclean clobber: sub_clobber local_clobber local_clean:: if test -f core; then $(RM) core; fi $(RM) *~ *.o local_realclean:: local_clean local_clobber:: local_realclean $(RM) Makefile config.sh install:: local_install sub_install install.man:: maybe_install.man sub_install.man deinstall:: sub_deinstall local_deinstall deinstall.man:: sub_deinstall.man maybe_deinstall.man install.man-no: deinstall.man-no: maybe_install.man: install.man-no maybe_deinstall.man: deinstall.man-no Makefile.SH: Jmakefile -@if test -f $(TOP)/.package; then \ if test -f Makefile.SH; then \ echo " $(RM) Makefile.SH~; $(MV) Makefile.SH Makefile.SH~"; \ $(RM) Makefile.SH~; $(MV) Makefile.SH Makefile.SH~; \ fi; \ echo " $(JMAKE) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT)" ; \ $(JMAKE) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT) ; \ else touch $@; fi Makefile: Makefile.SH /bin/sh Makefile.SH tags:: $(CTAGS) -w *.[ch] $(CTAGS) -xw *.[ch] > tags local_clobber:: $(RM) tags ######################################################################## # Rules for building in sub-directories -- do not edit subdirs: @case '${MFLAGS}' in *[ik]*) set +e;; esac; \ for i in $(SUBDIRS) ;\ do \ (cd $$i ; echo $(VERB) "in $(DIR)$$i..."; \ $(MAKE) $(MFLAGS) $(FLAGS) $(TARGET)) || exit 1; \ done sub_install:: @$(MAKE) subdirs TARGET=install VERB="Installing" FLAGS= sub_deinstall:: @$(MAKE) subdirs TARGET=deinstall VERB="Deinstalling" FLAGS= @echo "Back to $(CURRENT) for "deinstall... sub_install.man:: @$(MAKE) subdirs TARGET=install.man VERB="Installing man pages" FLAGS= sub_deinstall.man:: @$(MAKE) subdirs TARGET=deinstall.man VERB="Deinstalling man pages" FLAGS= @echo "Back to $(CURRENT) for "deinstall.man... sub_clean:: @$(MAKE) subdirs TARGET=clean VERB="Cleaning" FLAGS= @echo "Back to $(CURRENT) for "clean... sub_realclean:: @$(MAKE) subdirs TARGET=realclean VERB="Real cleaning" FLAGS= @echo "Back to $(CURRENT) for "realclean... sub_clobber:: @$(MAKE) subdirs TARGET=clobber VERB="Clobbering" FLAGS= @echo "Back to $(CURRENT) for "clobber... tag:: @case '${MFLAGS}' in *[ik]*) set +e;; esac; \ for i in $(SUBDIRS) ;\ do \ (cd $$i ; echo "Tagging" "in $(DIR)$$i..."; \ $(MAKE) $(MFLAGS) tag) || exit 1; \ done Makefiles:: @case '${MFLAGS}' in *[ik]*) set +e;; esac; \ for i in $(SUBDIRS);\ do \ echo "Making "Makefiles" in $(DIR)$$i..."; \ (cd $$i || exit 1; \ if test ! -f Makefile; then /bin/sh Makefile.SH; fi; \ $(MAKE) $(MFLAGS) Makefiles) || exit 1;\ done Makefiles.SH:: Makefile.SH @case '${MFLAGS}' in *[ik]*) set +e;; esac; \ for i in $(SUBDIRS);\ do \ case "$(DIR)$$i/" in \ */*/*/*/) newtop=../../../..;; \ */*/*/) newtop=../../..;; \ */*/) newtop=../..;; \ */) newtop=..;; \ esac; \ case "$(TOP)" in \ /*) newtop="$(TOP)" ;; \ esac; \ echo "Making Makefiles.SH in $(DIR)$$i..."; \ (cd $$i || exit 1; \ if test -f Jmakefile; then \ $(MAKE) $(MFLAGS) -f ../Makefile \ Makefile TOP=$$newtop CURRENT=$(DIR)$$i && \ $(MAKE) $(MFLAGS) Makefiles.SH; \ fi; \ ) || exit 1; \ done all:: @$(MAKE) subdirs TARGET=all VERB="Making all" FLAGS= local_install:: local_deinstall:: local_install.man:: local_deinstall.man:: !NO!SUBS! chmod 644 Makefile $eunicefix Makefile dist_3.5-30.orig/lib/makedir.sh0000644000175000017500000000367510473316164016575 0ustar srivastasrivastacase $CONFIG in '') if test -f config.sh; then TOP=.; elif test -f ../config.sh; then TOP=..; elif test -f ../../config.sh; then TOP=../..; elif test -f ../../../config.sh; then TOP=../../..; elif test -f ../../../../config.sh; then TOP=../../../..; else echo "Can't find config.sh."; exit 1 fi . $TOP/config.sh ;; esac case "$0" in */*) cd `expr X$0 : 'X\(.*\)/'` ;; esac echo "Extracting makedir (with variable substitutions)" $spitshell >makedir < # # $Log: makedir.sh,v $ # Revision 3.0.1.1 1994/01/24 14:00:08 ram # patch16: changed top ln-style config.sh lookup into test-style one # # Revision 3.0 1993/08/18 12:04:38 ram # Baseline for dist 3.0 netwide release. # export PATH || (echo "OOPS, this isn't sh. Desperation time. I will feed myself to sh."; sh \$0; kill \$\$) case \$# in 0) $echo "makedir pathname filenameflag" exit 1 ;; esac : guarantee one slash before 1st component case \$1 in /*) ;; *) set ./\$1 \$2 ;; esac : strip last component if it is to be a filename case X\$2 in X1) set \`$echo \$1 | $sed 's:\(.*\)/[^/]*\$:\1:'\` ;; *) set \$1 ;; esac : return reasonable status if nothing to be created if $test -d "\$1" ; then exit 0 fi list='' while true ; do case \$1 in */*) list="\$1 \$list" set \`echo \$1 | $sed 's:\(.*\)/:\1 :'\` ;; *) break ;; esac done set \$list for dir do $mkdir \$dir >/dev/null 2>&1 done !GROK!THIS! $eunicefix makedir chmod +x makedir dist_3.5-30.orig/lib/errnolist.a0000644000175000017500000000304710473316164017001 0ustar srivastasrivasta# $Id: errnolist.a,v 3.0 1993/08/18 12:04:35 ram Exp ram $ # # Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi # # You may redistribute only under the terms of the Artistic Licence, # as specified in the README file that comes with the distribution. # You may reuse parts of this distribution only within the terms of # that same Artistic Licence; a copy of which may be found at the root # of the source tree for dist 4.0. # # Original Author: Harlan Stenn # # $Log: errnolist.a,v $ # Revision 3.0 1993/08/18 12:04:35 ram # Baseline for dist 3.0 netwide release. # # # This is a simple-minded awk script to generate an initialization for # sys_errnolist on systems that don't have it. # This file now depends only on sys/errno.h error numbers under maxerr being # in order. It will complain and die if not. NOTE: It will still produce # a compilable output file, even with errors, so you must check the output. BEGIN { format = "\t\"%s\",\n" printf("/*\n** This is a generated file. Do NOT edit it unless you really have to...\n*/\n\n") printf("char *sys_errnolist[] = {\n") maxerr = 89 } $1=="#define" { if(count > maxerr || substr($2,1,1) != "E") next # we're not interested if($3 < count) { # this is bad printf("Fatal error: %s out of order at %s\n",\ FILENAME, $2)>"/dev/tty" exit 1 } # fill in the blanks while($3 > count) { dummy=sprintf("EDUMMY%d",count) printf(format,dummy) count++ } printf(format,$2) count++ } END { printf("\t0\n};\n") } dist_3.5-30.orig/lib/Makefile.SH0000755000175000017500000001621310473675243016577 0ustar srivastasrivasta: Makefile.SH generated from Jmake.tmpl and Jmakefile [jmake 3.5 PL0] : $X-Id: Jmake.tmpl 8 2006-08-25 22:27:18Z rmanfredi $ case $CONFIG in '') if test -f config.sh; then TOP=.; elif test -f ../config.sh; then TOP=..; elif test -f ../../config.sh; then TOP=../..; elif test -f ../../../config.sh; then TOP=../../..; elif test -f ../../../../config.sh; then TOP=../../../..; else echo "Can't find config.sh."; exit 1 fi . $TOP/config.sh ;; esac case "$0" in */*) cd `expr X$0 : 'X\(.*\)/'` ;; esac CURRENT=lib DIR=`echo $CURRENT/ | sed -e 's/\.\///g'` echo "Extracting ${DIR}Makefile (with variable substitutions)" INSTALL=`echo $install | sed -e 's,\./i,\$(TOP)/i,'` INSTALLDIR=`echo $installdir | sed -e 's,\./i,\$(TOP)/i,'` DATE=`date` $spitshell >Makefile <>Makefile <<'!NO!SUBS!' ######################################################################## # Jmake rules for building libraries, programs, scripts, and data files # $X-Id: Jmake.rules 8 2006-08-25 22:27:18Z rmanfredi $ ######################################################################## # Start of Jmakefile # $X-Id: Jmakefile 5 2006-08-25 22:09:39Z rmanfredi $ # # Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi # # You may redistribute only under the terms of the Artistic Licence, # as specified in the README file that comes with the distribution. # You may reuse parts of this distribution only within the terms of # that same Artistic Licence; a copy of which may be found at the root # of the source tree for dist 4.0. # # $X-Log: Jmakefile,v $ # Revision 3.0.1.1 1994/01/24 13:43:31 ram # patch16: added new directory for C code sources # # Revision 3.0 1993/08/18 12:04:34 ram # Baseline for dist 3.0 netwide release. # FILES = errnolist.a errnolist.mk FILES_SH = errnolist makedepend makedir INSTALLFLAGS = -m 444 all:: install:: @case '${MFLAGS}' in *[i]*) set +e;; esac; \ for dir in $(PRIVLIB)/lib; do \ (set -x; test -d $$dir || $(INSTALLDIR) $$dir) || \ exit 1; \ done local_install:: $(FILES) @case '${MFLAGS}' in *[i]*) set +e;; esac; \ (set -x; test -d $(INSTALL_PREFIX)$(PRIVLIB)/lib || \ $(INSTALLDIR) $(INSTALL_PREFIX)$(PRIVLIB)/lib); \ for i in $(FILES); do \ (set -x; $(INSTALL) -c $(INSTALLFLAGS) \ $$i $(INSTALL_PREFIX)$(PRIVLIB)/lib) || exit 1;\ done local_deinstall:: @case '${MFLAGS}' in *[i]*) set +e;; esac; \ for i in $(FILES); do \ (set -x; $(RM) $(INSTALL_PREFIX)$(PRIVLIB)/lib/$$i); \ done install:: errnolist.sh @case '${MFLAGS}' in *[i]*) set +e;; esac; \ (set -x; $(INSTALL) -c -m 444 errnolist.sh $(PRIVLIB)/lib/errnolist.SH) deinstall:: @case '${MFLAGS}' in *[i]*) set +e;; esac; \ (set -x; $(RM) $(PRIVLIB)/lib/errnolist.SH) install:: makedepend.sh @case '${MFLAGS}' in *[i]*) set +e;; esac; \ (set -x; $(INSTALL) -c -m 444 makedepend.sh $(PRIVLIB)/lib/makedepend.SH) deinstall:: @case '${MFLAGS}' in *[i]*) set +e;; esac; \ (set -x; $(RM) $(PRIVLIB)/lib/makedepend.SH) install:: makedir.sh @case '${MFLAGS}' in *[i]*) set +e;; esac; \ (set -x; $(INSTALL) -c -m 444 makedir.sh $(PRIVLIB)/lib/makedir.SH) deinstall:: @case '${MFLAGS}' in *[i]*) set +e;; esac; \ (set -x; $(RM) $(PRIVLIB)/lib/makedir.SH) ######################################################################## # Common rules for all Makefiles -- do not edit all:: clean: sub_clean local_clean realclean: sub_realclean local_realclean clobber: sub_clobber local_clobber local_clean:: if test -f core; then $(RM) core; fi $(RM) *~ *.o local_realclean:: local_clean local_clobber:: local_realclean $(RM) Makefile config.sh install:: local_install sub_install install.man:: maybe_install.man sub_install.man deinstall:: sub_deinstall local_deinstall deinstall.man:: sub_deinstall.man maybe_deinstall.man install.man-no: deinstall.man-no: maybe_install.man: install.man-no maybe_deinstall.man: deinstall.man-no Makefile.SH: Jmakefile -@if test -f $(TOP)/.package; then \ if test -f Makefile.SH; then \ echo " $(RM) Makefile.SH~; $(MV) Makefile.SH Makefile.SH~"; \ $(RM) Makefile.SH~; $(MV) Makefile.SH Makefile.SH~; \ fi; \ echo " $(JMAKE) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT)" ; \ $(JMAKE) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT) ; \ else touch $@; fi Makefile: Makefile.SH /bin/sh Makefile.SH tags:: $(CTAGS) -w *.[ch] $(CTAGS) -xw *.[ch] > tags local_clobber:: $(RM) tags ######################################################################## # Rules for building in sub-directories -- do not edit subdirs: @case '${MFLAGS}' in *[ik]*) set +e;; esac; \ for i in $(SUBDIRS) ;\ do \ (cd $$i ; echo $(VERB) "in $(DIR)$$i..."; \ $(MAKE) $(MFLAGS) $(FLAGS) $(TARGET)) || exit 1; \ done sub_install:: @$(MAKE) subdirs TARGET=install VERB="Installing" FLAGS= sub_deinstall:: @$(MAKE) subdirs TARGET=deinstall VERB="Deinstalling" FLAGS= @echo "Back to $(CURRENT) for "deinstall... sub_install.man:: @$(MAKE) subdirs TARGET=install.man VERB="Installing man pages" FLAGS= sub_deinstall.man:: @$(MAKE) subdirs TARGET=deinstall.man VERB="Deinstalling man pages" FLAGS= @echo "Back to $(CURRENT) for "deinstall.man... sub_clean:: @$(MAKE) subdirs TARGET=clean VERB="Cleaning" FLAGS= @echo "Back to $(CURRENT) for "clean... sub_realclean:: @$(MAKE) subdirs TARGET=realclean VERB="Real cleaning" FLAGS= @echo "Back to $(CURRENT) for "realclean... sub_clobber:: @$(MAKE) subdirs TARGET=clobber VERB="Clobbering" FLAGS= @echo "Back to $(CURRENT) for "clobber... tag:: @case '${MFLAGS}' in *[ik]*) set +e;; esac; \ for i in $(SUBDIRS) ;\ do \ (cd $$i ; echo "Tagging" "in $(DIR)$$i..."; \ $(MAKE) $(MFLAGS) tag) || exit 1; \ done Makefiles:: @case '${MFLAGS}' in *[ik]*) set +e;; esac; \ for i in $(SUBDIRS);\ do \ echo "Making "Makefiles" in $(DIR)$$i..."; \ (cd $$i || exit 1; \ if test ! -f Makefile; then /bin/sh Makefile.SH; fi; \ $(MAKE) $(MFLAGS) Makefiles) || exit 1;\ done Makefiles.SH:: Makefile.SH @case '${MFLAGS}' in *[ik]*) set +e;; esac; \ for i in $(SUBDIRS);\ do \ case "$(DIR)$$i/" in \ */*/*/*/) newtop=../../../..;; \ */*/*/) newtop=../../..;; \ */*/) newtop=../..;; \ */) newtop=..;; \ esac; \ case "$(TOP)" in \ /*) newtop="$(TOP)" ;; \ esac; \ echo "Making Makefiles.SH in $(DIR)$$i..."; \ (cd $$i || exit 1; \ if test -f Jmakefile; then \ $(MAKE) $(MFLAGS) -f ../Makefile \ Makefile TOP=$$newtop CURRENT=$(DIR)$$i && \ $(MAKE) $(MFLAGS) Makefiles.SH; \ fi; \ ) || exit 1; \ done all:: @$(MAKE) subdirs TARGET=all VERB="Making all" FLAGS= local_install:: local_deinstall:: local_install.man:: local_deinstall.man:: !NO!SUBS! chmod 644 Makefile $eunicefix Makefile dist_3.5-30.orig/lib/makedepend.sh0000644000175000017500000001122710473316164017246 0ustar srivastasrivastacase $CONFIG in '') if test -f config.sh; then TOP=.; elif test -f ../config.sh; then TOP=..; elif test -f ../../config.sh; then TOP=../..; elif test -f ../../../config.sh; then TOP=../../..; elif test -f ../../../../config.sh; then TOP=../../../..; else echo "Can't find config.sh."; exit 1 fi . $TOP/config.sh ;; esac case "$0" in */*) cd `expr X$0 : 'X\(.*\)/'` ;; esac echo "Extracting makedepend (with variable substitutions)" $spitshell >makedepend < # # $Log: makedepend.sh,v $ # Revision 3.0.1.1 1994/01/24 14:00:05 ram # patch16: changed top ln-style config.sh lookup into test-style one # # Revision 3.0 1993/08/18 12:04:37 ram # Baseline for dist 3.0 netwide release. # export PATH || (echo "OOPS, this isn't sh. Desperation time. I will feed myself to sh."; sh \$0; kill \$\$) cat='$cat' cppflags='$cppflags' cp='$cp' cpp='$cppstdin' echo='$echo' egrep='$egrep' expr='$expr' mv='$mv' rm='$rm' sed='$sed' sort='$sort' test='$test' tr='$tr' uniq='$uniq' !GROK!THIS! $spitshell >>makedepend <<'!NO!SUBS!' $cat /dev/null >.deptmp $rm -f *.c.c c/*.c.c if test -f Makefile; then mf=Makefile else mf=makefile fi if test -f $mf; then defrule=`<$mf sed -n \ -e '/^\.c\.o:.*;/{' \ -e 's/\$\*\.c//' \ -e 's/^[^;]*;[ ]*//p' \ -e q \ -e '}' \ -e '/^\.c\.o: *$/{' \ -e N \ -e 's/\$\*\.c//' \ -e 's/^.*\n[ ]*//p' \ -e q \ -e '}'` fi case "$defrule" in '') defrule='$(CC) -c $(CFLAGS)' ;; esac make clist || ($echo "Searching for .c files..."; \ $echo *.c | $tr ' ' '\012' | $egrep -v '\*' >.clist) gotnone=true for file in `$cat .clist`; do # for file in `cat /dev/null`; do case "$file" in *.c) filebase=`basename $file .c` ;; *.y) filebase=`basename $file .c` ;; '') continue ;; esac gotnone=false $echo "Finding dependencies for $filebase.o." $sed -n <$file >$file.c \ -e "/^${filebase}_init(/q" \ -e '/^#/{' \ -e 's|/\*.*$||' \ -e 's|\\$||' \ -e p \ -e '}' $cpp -I/usr/local/include -I. $cppflags $file.c | \ $sed \ -e '/^# *[0-9]/!d' \ -e 's/^.*"\(.*\)".*$/'$filebase'.o: \1/' \ -e 's|: \./|: |' \ -e 's|\.c\.c|.c|' | \ $uniq | $sort | $uniq >> .deptmp done $sed Makefile.new -e '1,/^# AUTOMATICALLY/!d' make shlist || ($echo "Searching for .SH files..."; \ $echo *.SH | $tr ' ' '\012' | $egrep -v '\*' >.shlist) if $gotnone || $test -s .deptmp; then for file in `cat .shlist`; do $echo `$expr X$file : 'X\(.*\).SH`: $file config.sh \; \ /bin/sh $file >> .deptmp done $echo "Updating Makefile..." $echo "# If this runs make out of memory, delete /usr/include lines." \ >> Makefile.new $sed 's|^\(.*\.o:\) *\(.*/.*\.c\) *$|\1 \2; '"$defrule \2|" .deptmp \ >>Makefile.new else make hlist || ($echo "Searching for .h files..."; \ $echo *.h | $tr ' ' '\012' | $egrep -v '\*' >.hlist) $echo "You don't seem to have a proper C preprocessor. Using grep instead." $egrep '^#include ' `cat .clist` `cat .hlist` >.deptmp $echo "Updating Makefile..." <.clist $sed -n \ -e '/\//{' \ -e 's|^\(.*\)/\(.*\)\.c|\2.o: \1/\2.c; '"$defrule \1/\2.c|p" \ -e d \ -e '}' \ -e 's|^\(.*\)\.c|\1.o: \1.c|p' >> Makefile.new <.hlist $sed -n 's|\(.*/\)\(.*\)|s= \2= \1\2=|p' >.hsed <.deptmp $sed -n 's|c:#include "\(.*\)".*$|o: \1|p' | \ $sed 's|^[^;]*/||' | \ $sed -f .hsed >> Makefile.new <.deptmp $sed -n 's|c:#include <\(.*\)>.*$|o: /usr/include/\1|p' \ >> Makefile.new <.deptmp $sed -n 's|h:#include "\(.*\)".*$|h: \1|p' | \ $sed -f .hsed >> Makefile.new <.deptmp $sed -n 's|h:#include <\(.*\)>.*$|h: /usr/include/\1|p' \ >> Makefile.new for file in `$cat .shlist`; do $echo `$expr X$file : 'X\(.*\).SH`: $file config.sh \; \ /bin/sh $file >> Makefile.new done fi $rm -f Makefile.old $cp Makefile Makefile.old $cp Makefile.new Makefile $rm Makefile.new $echo "# WARNING: Put nothing here or make depend will gobble it up!" >> Makefile $rm -f .deptmp `sed 's/\.c/.c.c/' .clist` .shlist .clist .hlist .hsed !NO!SUBS! $eunicefix makedepend chmod +x makedepend case `pwd` in *SH) $rm -f ../makedepend ln makedepend ../makedepend ;; esac dist_3.5-30.orig/revision.h0000644000175000017500000000017011113123603016033 0ustar srivastasrivasta/* * THIS FILE IS AUTOMATICALLY GENERATED -- DO NOT EDIT * * Generated by bin/svn-revision. */ #define REVISION 29 dist_3.5-30.orig/Configure0000755000175000017500000030537211025027404015713 0ustar srivastasrivasta#! /bin/sh # # If these # comments don't work, trim them. Don't worry about any other # shell scripts, Configure will trim # comments from them for you. # # (If you are trying to port this package to a machine without sh, # I would suggest you have a look at the prototypical config_h.SH file # and edit it to reflect your system. Some packages may include samples # of config.h for certain machines, so you might look for one of those.) # # Yes, you may rip this off to use in other distribution packages. This # script belongs to the public domain and cannot be copyrighted. # # Note: this Configure script was generated automatically. Rather than # working with this copy of Configure, you may wish to get metaconfig. # The dist package (which contains metaconfig) is available via SVN: # svn co https://svn.sourceforge.net/svnroot/dist/trunk/dist # $Id: Head.U 25 2008-05-28 11:19:25Z rmanfredi $ # # Generated on Wed May 28 13:22:26 CEST 2008 [metaconfig 3.5-25] cat >c1$$ <c2$$ </dev/null` test "$me" || me=$0 ;; esac : Proper separator for the PATH environment variable p_=: : On OS/2 this directory should exist if this is not floppy only system ":-]" if test -d c:/. ; then if test -n "$OS2_SHELL"; then p_=\; PATH=`cmd /c "echo %PATH%" | tr '\\\\' / ` OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'` elif test -n "$DJGPP"; then case "X${MACHTYPE:-nonesuchmach}" in *cygwin) ;; *) p_=\; ;; esac fi fi : Proper PATH setting paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin' paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin" paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin" paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin" paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb" paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin" paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib" paths="$paths /sbin /usr/sbin /usr/libexec" paths="$paths /system/gnu_library/bin" for p in $paths do case "$p_$PATH$p_" in *$p_$p$p_*) ;; *) test -d $p && PATH=$PATH$p_$p ;; esac done PATH=.$p_$PATH export PATH : shall we be using ksh? inksh='' needksh='' avoidksh='' newsh=/bin/ksh changesh='' if (PATH=.; alias -x) >/dev/null 2>&1; then inksh=true fi if test -f /hp-ux -a -f /bin/ksh; then needksh='to avoid sh bug in "here document" expansion' fi if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then if test X`/usr/bin/uname -v` = X4; then avoidksh="to avoid AIX 4's /bin/sh" newsh=/usr/bin/bsh fi fi if test -f /osf_boot -a -f /usr/sbin/setld; then if test X`/usr/bin/uname -s` = XOSF1; then avoidksh="to avoid Digital UNIX' ksh" newsh=/bin/sh unset BIN_SH fi fi case "$inksh/$needksh" in /[a-z]*) ENV='' changesh=true reason="$needksh" ;; esac case "$inksh/$avoidksh" in true/[a-z]*) changesh=true reason="$avoidksh" ;; esac case "$inksh/$needksh-$avoidksh-" in true/--) cat <&2 </dev/null 2>&1`; then shsharp=true spitshell=cat xcat=/bin/cat test -f $xcat$_exe || xcat=/usr/bin/cat if test ! -f $xcat$_exe; then for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do if test -f $p/cat$_exe; then xcat=$p/cat break fi done if test ! -f $xcat$_exe; then echo "Can't find cat anywhere!" exit 1 fi fi echo "#!$xcat" >sharp $eunicefix sharp chmod +x sharp ./sharp > today 2>/dev/null if test -s today; then sharpbang='#!' else echo "#! $xcat" > sharp $eunicefix sharp chmod +x sharp ./sharp > today 2>/dev/null if test -s today; then sharpbang='#! ' else sharpbang=': use ' fi fi else echo " " echo "Your $sh doesn't grok # comments--I will strip them later on." shsharp=false cd .. echo "exec grep -v '^[ ]*#'" >spitshell chmod +x spitshell $eunicefix spitshell spitshell=`pwd`/spitshell cd UU echo "I presume that if # doesn't work, #! won't work either!" sharpbang=': use ' fi rm -f sharp today : figure out how to guarantee sh startup case "$startsh" in '') startsh=${sharpbang}${sh} ;; *) esac cat >sharp < cmdline.opt <>cmdline.opt < cmdl.opt $arg EOC arg_exp=`cat cmdl.opt` args_exp="$args_exp$args_sep'$arg_exp'" argn=`expr $argn + 1` args_sep=' ' done rm -f cmdl.opt : produce awk script to parse command line options cat >options.awk <<'EOF' BEGIN { optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification len = length(optstr); for (i = 1; i <= len; i++) { c = substr(optstr, i, 1); if (i < len) a = substr(optstr, i + 1, 1); else a = ""; if (a == ":") { arg[c] = 1; i++; } opt[c] = 1; } } { expect = 0; str = $0; if (substr(str, 1, 1) != "-") { printf("'%s'\n", str); next; } len = length($0); for (i = 2; i <= len; i++) { c = substr(str, i, 1); if (!opt[c]) { printf("-%s\n", substr(str, i)); next; } printf("-%s\n", c); if (arg[c]) { if (i < len) printf("'%s'\n", substr(str, i + 1)); else expect = 1; next; } } } END { if (expect) print "?"; } EOF : process the command line options set X `for arg in "$@"; do echo "X$arg"; done | sed -e s/X// | awk -f options.awk` eval "set $*" shift rm -f options.awk : set up default values fastread='' reuseval=false config_sh='' alldone='' error='' silent='' extractsh='' override='' knowitall='' rm -f optdef.sh posthint.sh cat >optdef.sh <&2 error=true fi cd UU shift;; -h) shift; error=true;; -r) shift; reuseval=true;; -s) shift; silent=true; realsilent=true;; -E) shift; alldone=exit;; -K) shift; knowitall=true;; -O) shift; override=true;; -S) shift; silent=true; extractsh=true;; -D) shift case "$1" in *=) echo "$me: use '-U symbol=', not '-D symbol='." >&2 echo "$me: ignoring -D $1" >&2 ;; *=*) echo "$1" | \ sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;; *) echo "$1='define'" >> optdef.sh;; esac shift ;; -U) shift case "$1" in *=) echo "$1" >> optdef.sh;; *=*) echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2 echo "$me: ignoring -U $1" >&2 ;; *) echo "$1='undef'" >> optdef.sh;; esac shift ;; -A) shift xxx='' yyy="$1" zzz='' uuu=undef case "$yyy" in *=*) zzz=`echo "$yyy"|sed 's!=.*!!'` case "$zzz" in *:*) zzz='' ;; *) xxx=append zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'` yyy=`echo "$yyy"|sed 's!=.*!!'` ;; esac ;; esac case "$xxx" in '') case "$yyy" in *:*) xxx=`echo "$yyy"|sed 's!:.*!!'` yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` zzz=`echo "$yyy"|sed 's!^[^=]*=!!'` yyy=`echo "$yyy"|sed 's!=.*!!'` ;; *) xxx=`echo "$yyy"|sed 's!:.*!!'` yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;; esac ;; esac case "$xxx" in append) echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;; clear) echo "$yyy=''" >> posthint.sh ;; define) case "$zzz" in '') zzz=define ;; esac echo "$yyy='$zzz'" >> posthint.sh ;; eval) echo "eval \"$yyy=$zzz\"" >> posthint.sh ;; prepend) echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;; undef) case "$zzz" in '') zzz="$uuu" ;; esac echo "$yyy=$zzz" >> posthint.sh ;; *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;; esac shift ;; -V) echo "$me generated by metaconfig 3.5-25." >&2 exit 0;; --) break;; -*) echo "$me: unknown option $1" >&2; shift; error=true;; *) break;; esac done case "$error" in true) cat >&2 <&1 case "$silent" in true) exec 1>/dev/null;; esac : run the defines and the undefines, if any, but leave the file out there... touch optdef.sh . ./optdef.sh : create the posthint manipulation script and leave the file out there... touch posthint.sh : set package name package='dist' first=`echo $package | sed -e 's/^\(.\).*/\1/'` last=`echo $package | sed -e 's/^.\(.*\)/\1/'` case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;; *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;; esac : script used to emulate mkdir -p cat >mkdirp <>mkdirp <<'EOS' name=$1; create=""; while test $name; do if test ! -d "$name"; then create="$name $create" name=`echo $name | sed -e "s|^[^/]*$||"` name=`echo $name | sed -e "s|\(.*\)/.*|\1|"` else name="" fi done for file in $create; do mkdir $file done EOS chmod +x mkdirp $eunicefix mkdirp : Some greps do not return status, grrr. echo "grimblepritz" >grimble if grep blurfldyick grimble >/dev/null 2>&1 ; then contains=contains elif grep grimblepritz grimble >/dev/null 2>&1 ; then contains=grep else contains=contains fi rm -f grimble : the following should work in any shell case "$contains" in contains*) echo " " echo "AGH! Grep doesn't return a status. Attempting remedial action." cat >contains <<'EOSS' grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp EOSS chmod +x contains esac : Find the path to the source tree case "$src" in '') case "$0" in */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'` ;; *) src='.';; esac;; esac case "$src" in '') src=/ rsrc=/ ;; /*) rsrc="$src";; *) rsrc="../$src";; esac if test -f $rsrc/Configure && \ $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1 then : found it, so we are ok. else rsrc='' for src in . .. ../.. ../../.. ../../../..; do if test -f ../$src/Configure && \ $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1 then rsrc=../$src break fi done fi case "$rsrc" in '') cat <&4 Sorry, I can't seem to locate the source dir for $package. Please start Configure with an explicit path -- i.e. /some/path/Configure. EOM exit 1 ;; ../.) rsrc='..';; *) echo " " echo "Sources for $package found in \"$src\"." >&4 ;; esac : script used to extract .SH files with variable substitutions cat >extract <>extract <<'EOS' echo "Doing variable substitutions on .SH files..." if test -f "$SRC/MANIFEST"; then set x `awk '{print $1}' <$SRC/MANIFEST | grep '\.SH'` else echo "(Looking for .SH files under the source directory.)" set x `(cd "$SRC"; find . -name "*.SH" -print)` fi shift case $# in 0) set x `(cd "$SRC"; echo *.SH)`; shift;; esac if test ! -f "$SRC/$1"; then shift fi for file in $*; do case "$SRC" in ".") case "$file" in */*) dir=`expr X$file : 'X\(.*\)/'` file=`expr X$file : 'X.*/\(.*\)'` (cd $dir && . ./$file) ;; *) . ./$file ;; esac ;; *) case "$file" in */*) dir=`expr X$file : 'X\(.*\)/'` file=`expr X$file : 'X.*/\(.*\)'` ./mkdirp $dir sh <"$SRC/$dir/$file" ;; *) sh <"$SRC/$file" ;; esac ;; esac done if test -f "$SRC/config_h.SH"; then if test ! -f config.h; then sh <"$SRC/config_h.SH" fi fi EOS : extract files and exit if asked to do so case "$extractsh" in true) case "$realsilent" in true) ;; *) exec 1>&4;; esac case "$config_sh" in '') config_sh='config.sh';; esac echo " " echo "Fetching answers from $config_sh..." cd .. . $config_sh test "$override" && . ./optdef.sh echo " " . UU/extract rm -rf UU echo "Extraction done." exit 0 ;; esac : Eunice requires " " instead of "", can you believe it echo " " : Here we go... echo "Beginning of configuration questions for $package." trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15 : first determine how to suppress newline on echo command echo " " echo "Checking echo to see how to suppress newlines..." (echo "hi there\c" ; echo " ") >.echotmp if $contains c .echotmp >/dev/null 2>&1 ; then echo "...using -n." n='-n' c='' else cat <<'EOM' ...using \c EOM n='' c='\c' fi echo $n "The star should be here-->$c" echo '*' rm -f .echotmp : Now test for existence of everything in MANIFEST echo " " if test -f "$rsrc/MANIFEST"; then echo "First let's make sure your kit is complete. Checking..." >&4 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \ (split -l 50 2>/dev/null || split -50) rm -f missing tmppwd=`pwd` for filelist in x??; do (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \ >/dev/null 2>>"$tmppwd/missing") done if test -s missing; then cat missing >&4 cat >&4 <<'EOM' THIS PACKAGE SEEMS TO BE INCOMPLETE. You have the option of continuing the configuration process, despite the distinct possibility that your kit is damaged, by typing 'y'es. If you do, don't blame me if something goes wrong. I advise you to type 'n'o and contact the author (Raphael_Manfredi@grenoble.hp.com). EOM echo $n "Continue? [n] $c" >&4 read ans case "$ans" in y*) echo "Continuing..." >&4 rm -f missing ;; *) echo "ABORTING..." >&4 kill $$ ;; esac else echo "Looks good..." fi else echo "There is no MANIFEST file. I hope your kit is complete !" fi rm -f missing x?? : Find the appropriate value for a newline for tr echo " " if test -n "$DJGPP"; then trnl='\012' fi if test X"$trnl" = X; then case "`echo foo | tr '\n' x 2>/dev/null`" in foox) trnl='\n' ;; esac fi if test X"$trnl" = X; then case "`echo foo | tr '\012' x 2>/dev/null`" in foox) trnl='\012' ;; esac fi if test X"$trnl" = X; then case "`echo foo | tr '\r\n' xy 2>/dev/null`" in fooxy) trnl='\n\r' ;; esac fi if test X"$trnl" = X; then cat <&2 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'. EOM exit 1 else echo "We'll use '$trnl' to transliterate a newline." fi : compute the number of columns on the terminal for proper question formatting case "$COLUMNS" in '') COLUMNS='80';; esac : set up the echo used in my read myecho="case \"\$xxxm\" in '') echo $n \"\$rp $c\" >&4;; *) case \"\$rp\" in '') echo $n \"[\$xxxm] $c\";; *) if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then echo \"\$rp\" >&4 echo $n \"[\$xxxm] $c\" >&4 else echo $n \"\$rp [\$xxxm] $c\" >&4 fi ;; esac;; esac" : now set up to do reads with possible shell escape and default assignment cat <myread $startsh xxxm=\$dflt $myecho ans='!' case "\$fastread" in yes) case "\$dflt" in '') ;; *) ans=''; case "\$silent-\$rp" in true-) ;; *) echo " " >&4;; esac;; esac;; *) case "\$silent" in true) case "\$rp" in '') ans='';; esac;; esac;; esac while expr "X\$ans" : "X!" >/dev/null; do read answ set x \$xxxm shift aok=''; eval "ans=\\"\$answ\\"" && aok=y case "\$answ" in "!") sh 1>&4 echo " " $myecho ;; !*) set x \`expr "X\$ans" : "X!\(.*\)\$"\` shift sh 1>&4 -c "\$*" echo " " $myecho ;; "\$ans") case "\$ans" in \\&*) set x \`expr "X\$ans" : "X&\(.*\)\$"\` shift case "\$1" in -d) fastread=yes echo "(OK, I'll run with -d after this question.)" >&4 ;; -*) echo "*** Sorry, \$1 not supported yet." >&4 ;; esac $myecho ans=! ;; esac;; *) case "\$aok" in y) echo "*** Substitution done -- please confirm." xxxm="\$ans" ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\` xxxm="\$ans" ans=! ;; *) echo "*** Error -- try again." ans=! ;; esac $myecho ;; esac case "\$ans\$xxxm\$nostick" in '') ans=! $myecho ;; esac done case "\$ans" in '') ans="\$xxxm";; esac EOSC : create .config dir to save info across Configure sessions test -d ../.config || mkdir ../.config cat >../.config/README </dev/null` case "$user" in '') user=`whoami 2>&1`;; esac if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then firsttime=false echo " " rp='Would you like to see the instructions?' dflt=n . ./myread case "$ans" in [yY]*) ;; *) needman=false;; esac fi if $needman; then cat <>../.config/instruct;; esac fi : script used to emit important warnings cat >warn <msg else cat >msg fi echo "*** WARNING:" >&4 sed -e 's/^/*** /' &4 echo "*** " >&4 cat msg >>config.msg echo " " >>config.msg rm -f msg EOS chmod +x warn $eunicefix warn : find out where common programs are echo " " echo "Locating common programs..." >&4 cat <loc $startsh case \$# in 0) exit 1;; esac thing=\$1 shift dflt=\$1 shift for dir in \$*; do case "\$thing" in .) if test -d \$dir/\$thing; then echo \$dir exit 0 fi ;; *) for thisthing in \$dir/\$thing; do : just loop through to pick last item done if test -f \$thisthing; then echo \$thisthing exit 0 elif test -f \$thisthing$_exe; then echo \$thisthing exit 0 elif test -f \$dir/\$thing.exe; then if test -n "$DJGPP"; then echo \$dir/\$thing.exe else : on Eunice apparently echo \$dir/\$thing fi exit 0 fi ;; esac done echo \$dflt exit 1 EOSC chmod +x loc $eunicefix loc loclist=" awk cat chgrp chmod chown cp echo expr grep mkdir mv rm sed sort touch tr uniq " trylist=" cpp date inews less line ln mail make more nroff perl pg rmail sendmail smail test uname vi zcat " pth=`echo $PATH | sed -e "s/$p_/ /g"` pth="$pth /lib /usr/lib" for file in $loclist; do eval xxx=\$$file case "$xxx" in /*|?:[\\/]*) if test -f "$xxx"; then : ok else ./warn "no $xxx -- ignoring your setting for $file." xxx=`./loc $file $file $pth` fi ;; '') xxx=`./loc $file $file $pth`;; *) xxx=`./loc $xxx $xxx $pth`;; esac eval $file=$xxx$_exe eval _$file=$xxx case "$xxx" in /*) echo $file is in $xxx. ;; ?:[\\/]*) echo $file is in $xxx. ;; *) echo "I don't know where '$file' is, and my life depends on it." >&4 echo "Go find a public domain implementation or fix your PATH setting!" >&4 exit 1 ;; esac done echo " " echo "Don't worry if any of the following aren't found..." say=offhand for file in $trylist; do eval xxx=\$$file case "$xxx" in /*|?:[\\/]*) if test -f "$xxx"; then : ok else ./warn "no $xxx -- ignoring your setting for $file." xxx=`./loc $file $file $pth` fi ;; '') xxx=`./loc $file $file $pth`;; *) xxx=`./loc $xxx $xxx $pth`;; esac eval $file=$xxx$_exe eval _$file=$xxx case "$xxx" in /*) echo $file is in $xxx. ;; ?:[\\/]*) echo $file is in $xxx. ;; *) echo "I don't see $file out there, $say." say=either ;; esac done case "$egrep" in egrep) echo "Substituting grep for egrep." egrep=$grep _egrep=$_grep ;; esac case "$ln" in ln) echo "Substituting cp for ln." ln=$cp _ln=$_cp ;; esac case "$make" in make) case "$gmake" in gmake) echo "I can't find make or gmake, and my life depends on it." >&4 echo "Go find a public domain implementation or fix your PATH setting!" >&4 exit 1 ;; esac ;; esac case "$gmake" in gmake) ;; *) # We can't have osname yet. if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS # Assume that gmake, if found, is definitely GNU make # and prefer it over the system make. echo "Substituting gmake for make." make=$gmake _make=$_gmake fi ;; esac case "$test" in test) echo "Hopefully test is built into your sh." ;; *) if `sh -c "PATH= test true" >/dev/null 2>&1`; then echo "Using the test built into your sh." test=test _test=test fi ;; esac case "$echo" in echo) echo "Hopefully echo is built into your sh." ;; '') ;; *) echo " " echo "Checking compatibility between $echo and builtin echo (if any)..." >&4 $echo $n "hi there$c" >foo1 echo $n "hi there$c" >foo2 if cmp foo1 foo2 >/dev/null 2>&1; then echo "They are compatible. In fact, they may be identical." else case "$n" in '-n') n='' c='\c';; *) n='-n' c='';; esac cat <$c" $echo "*" fi $rm -f foo1 foo2 ;; esac : generate the trygcc script for later perusal cat <trygcc $startsh EOS cat <<'EOSC' >>trygcc case "$cc" in '') ;; *) $rm -f try try.* $cat >try.c <&4 despair=yes trygcc=yes case "$cc" in *gcc*) trygcc=no ;; esac case "`$cc -v -c try.c 2>&1`" in *gcc*) trygcc=no ;; esac if $test X"$trygcc" = Xyes; then if gcc -o try -c try.c; then echo " " echo "You seem to have a working gcc, though." >&4 rp="Would you like to use it?" dflt=y if $test -f myread; then . ./myread else if $test -f UU/myread; then . ./UU/myread else echo "Cannot find myread, sorry. Aborting." >&2 exit 1 fi fi case "$ans" in [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no; $cat *.cbu >checktmp 2>/dev/null if $contains ccflags checktmp >/dev/null; then ./warn <checkcc $startsh EOS cat <<'EOSC' >>checkcc case "$cc" in '') ;; *) $rm -f try try.* $cat >try.c <&4 fi $cat >&4 < /dev/null 2>&1 && $test -f sym; then echo "Symbolic links are supported." >&4 lns="$ln -s" else echo "Symbolic links are NOT supported." >&4 lns="$ln" fi $rm -f blurfl sym : determine whether symbolic links are supported echo " " case "$lns" in *"ln"*" -s") echo "Checking how to test for symbolic links..." >&4 $lns blurfl sym if $test "X$issymlink" = X; then case "$newsh" in '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;; *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;; esac if test $? = 0; then issymlink="test -h" else echo "Your builtin 'test -h' may be broken." >&4 case "$test" in /*) ;; *) pth=`echo $PATH | sed -e "s/$p_/ /g"` for p in $pth do if test -f "$p/$test"; then test="$p/$test" break fi done ;; esac case "$test" in /*) echo "Trying external '$test -h'." >&4 issymlink="$test -h" if $test ! -h sym >/dev/null 2>&1; then echo "External '$test -h' is broken, too." >&4 issymlink='' fi ;; *) issymlink='' ;; esac fi fi if $test "X$issymlink" = X; then if $test -L sym 2>/dev/null; then issymlink="$test -L" echo "The builtin '$test -L' worked." >&4 fi fi if $test "X$issymlink" != X; then echo "You can test for symbolic links with '$issymlink'." >&4 else echo "I do not know how you can test for symbolic links." >&4 fi $rm -f blurfl sym ;; *) echo "No symbolic links, so not testing for their testing..." >&4 ;; esac : define absolute package source directory case "$src" in /*) pkgsrc=$src;; *) pkgsrc=`cd $rsrc; pwd`;; esac : Duplicate the tree with symbolic links if -Dmksymlinks was supplied case "$mksymlinks" in $define|true|[yY]*) echo " " case "$src" in ''|'.') echo "Cannot create symlinks in the original directory." >&4 exit 1 ;; *) case "$lns:$issymlink" in *"ln"*" -s:"*"test -"?) echo "Creating the symbolic links..." >&4 echo "(First creating the subdirectories...)" >&4 cd .. awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | \ sort -u | while true do read dir test -z "$dir" && break ./UU/mkdirp $dir 2>/dev/null if test -d $dir; then : ok else echo "Failed to create '$dir'. Aborting." >&4 exit 1 fi done echo "(Now creating the symlinks...)" >&4 awk '{print $1}' $src/MANIFEST | while true; do read filename test -z "$filename" && break if test -f $filename; then if $issymlink $filename; then rm -f $filename fi fi if test -f $filename; then echo "$filename already exists, not symlinking." else ln -s $pkgsrc/$filename $filename fi done echo "(Checking current directory...)" >&4 cd UU awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \ (split -l 50 2>/dev/null || split -50) rm -f missing tmppwd=`pwd` for filelist in x??; do (cd ..; ls `cat "$tmppwd/$filelist"` \ >/dev/null 2>>"$tmppwd/missing") done if test -s missing; then echo "Failed duplication of source tree. Aborting." >&4 exit 1 fi ;; *) echo "(I cannot figure out how to do symbolic links, ignoring!)" >&4 ;; esac ;; esac ;; esac : see whether [:lower:] and [:upper:] are supported character classes echo " " case "`echo AbyZ | LC_ALL=C $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in ABYZ) echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4 up='[:upper:]' low='[:lower:]' ;; *) # There is a discontinuity in EBCDIC between 'I' and 'J' # (0xc9 and 0xd1), therefore that is a nice testing point. if test "X$up" = X -o "X$low" = X; then case "`echo IJ | LC_ALL=C $tr '[I-J]' '[i-j]' 2>/dev/null`" in ij) up='[A-Z]' low='[a-z]' ;; esac fi if test "X$up" = X -o "X$low" = X; then case "`echo IJ | LC_ALL=C $tr I-J i-j 2>/dev/null`" in ij) up='A-Z' low='a-z' ;; esac fi if test "X$up" = X -o "X$low" = X; then case "`echo IJ | od -x 2>/dev/null`" in *C9D1*|*c9d1*) echo "Hey, this might be EBCDIC." >&4 if test "X$up" = X -o "X$low" = X; then case "`echo IJ | \ LC_ALL=C $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in ij) up='[A-IJ-RS-Z]' low='[a-ij-rs-z]' ;; esac fi if test "X$up" = X -o "X$low" = X; then case "`echo IJ | LC_ALL=C $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in ij) up='A-IJ-RS-Z' low='a-ij-rs-z' ;; esac fi ;; esac fi esac case "`echo IJ | LC_ALL=C $tr \"$up\" \"$low\" 2>/dev/null`" in ij) echo "Using $up and $low to convert case." >&4 ;; *) echo "I don't know how to translate letters from upper to lower case." >&4 echo "Your tr is not acting any way I know of." >&4 exit 1 ;; esac : set up the translation script tr, must be called with ./tr of course cat >tr <&4 exit 1 ;; esac : Determine the name of the machine myuname=`$uname -a 2>/dev/null` $test -z "$myuname" && myuname=`hostname 2>/dev/null` myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \ ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '` newmyuname="$myuname" $test -f "$uname$_exe" && has_uname=y : Guessing of the OS name -- half the following guesses are probably wrong... : If you have better tests or hints, please send them to the metaconfig : authors and to Raphael_Manfredi@grenoble.hp.com $test -f /irix && osname=irix $test -f /xenix && osname=sco_xenix $test -f /dynix && osname=dynix $test -f /dnix && osname=dnix $test -f /lynx.os && osname=lynxos $test -f /unicos && osname=unicos && osvers=`$uname -r` $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r` $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r` $test -f /bin/mips && /bin/mips && osname=mips $test -d /NextApps && set X `hostinfo | $grep 'NeXT Mach.*:' | \ $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4 $test -d /usr/apollo/bin && osname=apollo $test -f /etc/saf/_sactab && osname=svr4 $test -d /usr/include/minix && osname=minix $test -f /system/gnu_library/bin/ar.pm && osname=vos if $test -d /MachTen -o -d /MachTen_Folder; then osname=machten if $test -x /sbin/version; then osvers=`/sbin/version | $awk '{print $2}' | $sed -e 's/[A-Za-z]$//'` elif $test -x /usr/etc/version; then osvers=`/usr/etc/version | $awk '{print $2}' | $sed -e 's/[A-Za-z]$//'` else osvers="$2.$3" fi fi $test -f /sys/posix.dll && $test -f /usr/bin/what && set X `/usr/bin/what /sys/posix.dll` && $test "$3" = UWIN && osname=uwin && osvers="$5" if $test "X$has_uname" != X; then set X $myuname shift case "$5" in fps*) osname=fps ;; mips*) case "$4" in umips) osname=umips ;; *) osname=mips ;; esac;; [23]100) osname=mips ;; next*) osname=next ;; i386*) tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'` if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then osname='sco' osvers=$tmp elif $test -f /etc/kconfig; then osname=isc if $test "$lns" = "$ln -s"; then osvers=4 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then osvers=3 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then osvers=2 fi fi tmp='' ;; pc*) if $test -n "$DJGPP"; then osname=dos osvers=djgpp fi ;; esac case "$1" in aix) osname=aix tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1` case "$tmp" in 'not found') osvers="$4"."$3" ;; '<3240'|'<>3240') osvers=3.2.0 ;; '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;; '=3250'|'>3250') osvers=3.2.5 ;; *) osvers=$tmp;; esac ;; bsd386) osname=bsd386 osvers=`$uname -r` ;; cygwin*) osname=cygwin osvers="$3" ;; *dc.osx) osname=dcosx osvers="$3" ;; dnix) osname=dnix osvers="$3" ;; domainos) osname=apollo osvers="$3" ;; dgux) osname=dgux osvers="$3" ;; dynixptx*) osname=dynixptx osvers=`echo "$4"|sed 's/^v//'` ;; freebsd) osname=freebsd osvers="$3" ;; genix) osname=genix ;; hp*) osname=hpux osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'` ;; irix*) osname=irix case "$3" in 4*) osvers=4 ;; 5*) osvers=5 ;; *) osvers="$3" ;; esac ;; linux) osname=linux case "$3" in *) osvers="$3" ;; esac ;; MiNT) osname=mint ;; netbsd*) osname=netbsd osvers="$3" ;; news-os) osvers="$3" case "$3" in 4*) osname=newsos4 ;; *) osname=newsos ;; esac ;; next*) osname=next ;; nonstop-ux) osname=nonstopux ;; openbsd) osname=openbsd osvers="$3" ;; POSIX-BC | posix-bc ) osname=posix-bc osvers="$3" ;; powerux | power_ux | powermax_os | powermaxos | \ powerunix | power_unix) osname=powerux osvers="$3" ;; qnx) osname=qnx osvers="$4" ;; solaris) osname=solaris case "$3" in 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;; *) osvers="$3" ;; esac ;; sunos) osname=sunos case "$3" in 5*) osname=solaris osvers=`echo $3 | $sed 's/^5/2/g'` ;; *) osvers="$3" ;; esac ;; titanos) osname=titanos case "$3" in 1*) osvers=1 ;; 2*) osvers=2 ;; 3*) osvers=3 ;; 4*) osvers=4 ;; *) osvers="$3" ;; esac ;; ultrix) osname=ultrix osvers="$3" ;; osf1|mls+) case "$5" in alpha) osname=dec_osf osvers=`sizer -v | awk '{print $3}' | \ ./tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'` case "$osvers" in [1-9].[0-9]*) ;; *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;; esac ;; hp*) osname=hp_osf1 ;; mips) osname=mips_osf1 ;; esac ;; unixware) osname=svr5 osvers="$4" ;; uts) osname=uts osvers="$3" ;; vos) osvers="$3" ;; $2) case "$osname" in *isc*) ;; *freebsd*) ;; svr*) : svr4.x or possibly later case "svr$3" in ${osname}*) osname=svr$3 osvers=$4 ;; esac case "$osname" in svr4.0) : Check for ESIX if $test -f /stand/boot ; then eval `$grep '^INITPROG=[a-z/0-9]*$' /stand/boot` if $test -n "$INITPROG" -a -f "$INITPROG"; then isesix=`strings -a $INITPROG | \ $grep 'ESIX SYSTEM V/386 Release 4.0'` if $test -n "$isesix"; then osname=esix4 fi fi fi ;; esac ;; *) if $test -f /etc/systemid; then osname=sco set `echo $3 | $sed 's/\./ /g'` $4 if $test -f $src/hints/sco_$1_$2_$3.sh; then osvers=$1.$2.$3 elif $test -f $src/hints/sco_$1_$2.sh; then osvers=$1.$2 elif $test -f $src/hints/sco_$1.sh; then osvers=$1 fi else case "$osname" in '') : Still unknown. Probably a generic Sys V. osname="sysv" osvers="$3" ;; esac fi ;; esac ;; *) case "$osname" in '') : Still unknown. Probably a generic BSD. osname="$1" osvers="$3" ;; esac ;; esac else if $test -f /vmunix -a -f $src/hints/news_os.sh; then (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1 if $contains news-os UU/kernel.what >/dev/null 2>&1; then osname=news_os fi $rm -f UU/kernel.what elif $test -d c:/.; then set X $myuname osname=os2 osvers="$5" fi fi : Try to determine whether config.sh was made on this system case "$config_sh" in '') dflt=n case "$knowitall" in '') if test -f ../config.sh; then if $contains myuname= ../config.sh >/dev/null 2>&1; then eval "`$grep myuname= ../config.sh`" fi if test "X$myuname" = "X$newmyuname"; then dflt=y fi fi ;; *) dflt=y;; esac : Get old answers from config file if it was generated on the same system hint=default if $test -f ../config.sh; then echo " " rp="I see a config.sh file. Shall I use it to set the defaults?" . ./myread case "$ans" in n*|N*) echo "OK, I'll ignore it." mv ../config.sh ../config.sh.old myuname="$newmyuname" ;; *) echo "Fetching default answers from your old config.sh file..." >&4 tmp_n="$n" tmp_c="$c" tmp_sh="$sh" . ../config.sh cp ../config.sh . n="$tmp_n" c="$tmp_c" hint=previous ;; esac fi ;; *) echo " " echo "Fetching default answers from $config_sh..." >&4 tmp_n="$n" tmp_c="$c" tmp_sh="$sh" cd .. cp $config_sh config.sh 2>/dev/null chmod +w config.sh . ./config.sh cd UU cp ../config.sh . n="$tmp_n" c="$tmp_c" hint=previous ;; esac case "$sh" in '') sh="$tmp_sh" ;; esac $test "$override" && . ./optdef.sh : Restore computed paths for file in $loclist $trylist; do eval $file="\$_$file" done . ./checkcc case "$targetarch" in '') ;; *) hostarch=$osname osname=`echo $targetarch|sed 's,^[^-]*-,,'` osvers='' ;; esac : Process their -A options . ./posthint.sh : Ask them to confirm the OS name cat << EOM Configure uses the operating system name and version to set some defaults. The default value is probably right if the name rings a bell. Otherwise, since spelling matters for me, either accept the default or answer "none" to leave it blank. EOM case "$osname" in ''|' ') case "$hintfile" in ''|' '|none) dflt=none ;; *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;; esac ;; *) dflt="$osname" ;; esac rp="Operating system name?" . ./myread case "$ans" in none) osname='' ;; *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;; esac echo " " case "$osvers" in ''|' ') case "$hintfile" in ''|' '|none) dflt=none ;; *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'` dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'` case "$dflt" in ''|' ') dflt=none ;; esac ;; esac ;; *) dflt="$osvers" ;; esac rp="Operating system version?" . ./myread case "$ans" in none) osvers='' ;; *) osvers="$ans" ;; esac : who configured the system cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1` cf_by=`(logname) 2>/dev/null` case "$cf_by" in "") cf_by=`(whoami) 2>/dev/null` case "$cf_by" in "") cf_by=unknown ;; esac ;; esac : allow them to override the AFS root case "$afsroot" in '') afsroot=/afs ;; *) afsroot=$afsroot ;; esac : is AFS running? echo " " case "$afs" in $define|true) afs=true ;; $undef|false) afs=false ;; *) if $test -d $afsroot; then afs=true else afs=false fi ;; esac if $afs; then echo "AFS may be running... I'll be extra cautious then..." >&4 else echo "AFS does not seem to be running..." >&4 fi : determine where manual pages are on this system echo " " case "$sysman" in '') syspath='/usr/share/man/man1 /usr/man/man1' syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1" syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1" syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1" syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1" syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1" sysman=`./loc . /usr/man/man1 $syspath` ;; esac if $test -d "$sysman"; then echo "System manual is in $sysman." >&4 else echo "Could not find manual pages in source form." >&4 fi : decide how portable to be case "$d_portable" in "$define") dflt=y;; *) dflt=n;; esac $cat <<'EOH' I can set things up so that your shell scripts and binaries are more portable, at what may be a noticable cost in performance. In particular, if you ask to be portable, the following happens: 1) Shell scripts will rely on the PATH variable rather than using the paths derived above. 2) ~username interpretations will be done at run time rather than by Configure. EOH rp="Do you expect to run these scripts and binaries on multiple machines?" . ./myread case "$ans" in y*) d_portable="$define" ;; *) d_portable="$undef" ;; esac : set up shell script to do ~ expansion cat >filexp <&2 exit 1 fi case "\$1" in */*) echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\` ;; *) echo \$dir ;; esac fi ;; *) echo \$1 ;; esac EOSS chmod +x filexp $eunicefix filexp : now set up to get a file name cat <getfile $startsh EOS cat <<'EOSC' >>getfile tilde='' fullpath='' already='' skip='' none_ok='' exp_file='' nopath_ok='' orig_rp="$rp" orig_dflt="$dflt" case "$gfpth" in '') gfpth='.' ;; esac case "$fn" in *\(*) : getfile will accept an answer from the comma-separated list : enclosed in parentheses even if it does not meet other criteria. expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok fn=`echo $fn | sed 's/(.*)//'` ;; esac case "$fn" in *:*) loc_file=`expr $fn : '.*:\(.*\)'` fn=`expr $fn : '\(.*\):.*'` ;; esac case "$fn" in *~*) tilde=true;; esac case "$fn" in */*) fullpath=true;; esac case "$fn" in *+*) skip=true;; esac case "$fn" in *n*) none_ok=true;; esac case "$fn" in *e*) exp_file=true;; esac case "$fn" in *p*) nopath_ok=true;; esac case "$fn" in *f*) type='File';; *d*) type='Directory';; *l*) type='Locate';; esac what="$type" case "$what" in Locate) what='File';; esac case "$exp_file" in '') case "$d_portable" in "$define") ;; *) exp_file=true;; esac ;; esac cd .. while test "$type"; do redo='' rp="$orig_rp" dflt="$orig_dflt" case "$tilde" in true) rp="$rp (~name ok)";; esac . UU/myread if test -f UU/getfile.ok && \ $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1 then value="$ans" ansexp="$ans" break fi case "$ans" in none) value='' ansexp='' case "$none_ok" in true) type='';; esac ;; *) case "$tilde" in '') value="$ans" ansexp="$ans";; *) value=`UU/filexp $ans` case $? in 0) if test "$ans" != "$value"; then echo "(That expands to $value on this system.)" fi ;; *) value="$ans";; esac ansexp="$value" case "$exp_file" in '') value="$ans";; esac ;; esac case "$fullpath" in true) case "$ansexp" in /*) value="$ansexp" ;; [a-zA-Z]:/*) value="$ansexp" ;; *) redo=true case "$already" in true) echo "I shall only accept a full path name, as in /bin/ls." >&4 echo "Use a ! shell escape if you wish to check pathnames." >&4 ;; *) echo "Please give a full path name, starting with slash." >&4 case "$tilde" in true) echo "Note that using ~name is ok provided it expands well." >&4 already=true ;; esac esac ;; esac ;; esac case "$redo" in '') case "$type" in File) for fp in $gfpth; do if test "X$fp" = X.; then pf="$ansexp" else pf="$fp/$ansexp" fi if test -f "$pf"; then type='' elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1 then echo "($value is not a plain file, but that's ok.)" type='' fi if test X"$type" = X; then value="$pf" break fi done ;; Directory) for fp in $gfpth; do if test "X$fp" = X.; then dir="$ans" direxp="$ansexp" else dir="$fp/$ansexp" direxp="$fp/$ansexp" fi if test -d "$direxp"; then type='' value="$dir" break fi done ;; Locate) if test -d "$ansexp"; then echo "(Looking for $loc_file in directory $value.)" value="$value/$loc_file" ansexp="$ansexp/$loc_file" fi if test -f "$ansexp"; then type='' fi case "$nopath_ok" in true) case "$value" in */*) ;; *) echo "Assuming $value will be in people's path." type='' ;; esac ;; esac ;; esac case "$skip" in true) type=''; esac case "$type" in '') ;; *) if test "$fastread" = yes; then dflt=y else dflt=n fi rp="$what $value doesn't exist. Use that name anyway?" . UU/myread dflt='' case "$ans" in y*) type='';; *) echo " ";; esac ;; esac ;; esac ;; esac done cd UU ans="$value" rp="$orig_rp" dflt="$orig_dflt" rm -f getfile.ok test "X$gfpthkeep" != Xy && gfpth="" EOSC : determine root of directory hierarchy where package will be installed. case "$prefix" in '') dflt=`./loc . /usr/local /usr/local /local /opt /usr` ;; *) dflt="$prefix" ;; esac $cat <bsd echo exit 1 >usg echo exit 1 >v7 echo exit 1 >osf1 echo exit 1 >eunice echo exit 1 >xenix echo exit 1 >venix echo exit 1 >os2 echo exit 1 >gnu echo exit 1 >linux echo exit 1 >dos d_bsd="$undef" d_linux="$undef" d_dos="$undef" d_os2="$undef" $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1 then echo "Looks kind of like an OSF/1 system, but we'll see..." echo exit 0 >osf1 elif test `echo abc | $tr a-z A-Z` = Abc ; then xxx=`./loc addbib blurfl $pth` if $test -f $xxx; then echo "Looks kind of like a USG system with BSD features, but we'll see..." echo exit 0 >bsd echo exit 0 >usg else if $contains SIGTSTP foo >/dev/null 2>&1 ; then echo "Looks kind of like an extended USG system, but we'll see..." else echo "Looks kind of like a USG system, but we'll see..." fi echo exit 0 >usg fi elif $contains SIGTSTP foo >/dev/null 2>&1 ; then echo "Looks kind of like a BSD system, but we'll see..." d_bsd="$define" echo exit 0 >bsd elif $rm --version 2>/dev/null >foo; $contains "Free Software Foundation" foo >/dev/null then xxx=`uname` echo exit 0 >gnu echo "Looks kind of like a GNU/$xxx system, but we'll see..." if $test X$xxx = XLinux; then d_linux="$define" echo exit 0 >linux fi else echo "Looks kind of like a Version 7 system, but we'll see..." echo exit 0 >v7 fi case "$eunicefix" in *unixtovms*) $cat <<'EOI' There is, however, a strange, musty smell in the air that reminds me of something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit. EOI echo exit 0 >eunice d_eunice="$define" : it so happens the Eunice I know will not run shell scripts in Unix format ;; *) echo " " echo "Congratulations. You aren't running Eunice." d_eunice="$undef" ;; esac case "$p_" in :) ;; *) $cat <<'EOI' I have the feeling something is not exactly right, however...don't tell me... EOI if test -n "$DJGPP"; then case "X${MACHTYPE:-nonesuchmach}" in cygwin) echo "hah!... you're running under Cygwin!";; *) echo "got it... you're running DOS with DJGPP!";; esac echo exit 0 >dos d_dos="$define" else $cat <<'EOI' lemme think...does HAL ring a bell?...no, of course, you're only running OS/2! EOI echo exit 0 >os2 d_os2="$define" fi ;; esac if test -f /xenix; then echo "Actually, this looks more like a XENIX system..." echo exit 0 >xenix d_xenix="$define" else echo " " echo "It's not Xenix..." d_xenix="$undef" fi chmod +x xenix $eunicefix xenix if test -f /venix; then echo "Actually, this looks more like a VENIX system..." echo exit 0 >venix else echo " " if ./xenix; then : null else echo "Nor is it Venix..." fi fi chmod +x bsd usg v7 osf1 eunice xenix venix dos os2 gnu linux $eunicefix bsd usg v7 osf1 eunice xenix venix dos os2 gnu linux $rm -f foo : What should the include directory be ? echo " " $echo $n "Hmm... $c" dflt='/usr/include' incpath='' mips_type='' if $test -f /bin/mips && /bin/mips; then echo "Looks like a MIPS system..." $cat >usr.c <<'EOCP' #ifdef SYSTYPE_BSD43 /bsd43 #endif EOCP if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then dflt='/bsd43/usr/include' incpath='/bsd43' mips_type='BSD 4.3' else mips_type='System V' fi $rm -f usr.c usr.out echo "and you're compiling with the $mips_type compiler and libraries." xxx_prompt=y echo "exit 0" >mips else echo "Doesn't look like a MIPS system." xxx_prompt=n echo "exit 1" >mips fi chmod +x mips $eunicefix mips case "$usrinc" in '') ;; *) dflt="$usrinc";; esac case "$xxx_prompt" in y) fn=d/ echo " " rp='Where are the include files you want to use?' . ./getfile usrinc="$ans" ;; *) usrinc="$dflt" ;; esac : see if we have to deal with yellow pages, now NIS. if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then if $test -f /usr/etc/nibindd; then echo " " echo "I'm fairly confident you're on a NeXT." echo " " rp='Do you get the hosts file via NetInfo?' dflt=y case "$hostcat" in nidump*) ;; '') ;; *) dflt=n;; esac . ./myread case "$ans" in y*) hostcat='nidump hosts .';; *) case "$hostcat" in nidump*) hostcat='';; esac ;; esac fi case "$hostcat" in nidump*) ;; *) case "$hostcat" in *ypcat*) dflt=y;; '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then dflt=y else dflt=n fi;; *) dflt=n;; esac echo " " rp='Are you getting the hosts file via yellow pages?' . ./myread case "$ans" in y*) hostcat='ypcat hosts';; *) hostcat='cat /etc/hosts';; esac ;; esac fi case "$hostcat" in '') hostcat=':' $test -f /etc/hosts && hostcat='cat /etc/hosts';; esac case "$groupcat" in '') groupcat=':' $test -f /etc/group && groupcat='cat /etc/group';; esac case "$passcat" in '') passcat=':' $test -f /etc/passwd && passcat='cat /etc/passwd';; esac : now get the host name echo " " echo "Figuring out host name..." >&4 case "$myhostname" in '') cont=true echo 'Maybe "hostname" will work...' if tans=`sh -c hostname 2>&1` ; then myhostname=$tans phostname=hostname cont='' fi ;; *) cont='';; esac if $test "$cont"; then if ./xenix; then echo 'Oh, dear. Maybe "/etc/systemid" is the key...' if tans=`cat /etc/systemid 2>&1` ; then myhostname=$tans phostname='cat /etc/systemid' echo "Whadyaknow. Xenix always was a bit strange..." cont='' fi elif $test -r /etc/systemid; then echo "(What is a non-Xenix system doing with /etc/systemid?)" fi fi if $test "$cont"; then echo 'No, maybe "uuname -l" will work...' if tans=`sh -c 'uuname -l' 2>&1` ; then myhostname=$tans phostname='uuname -l' else echo 'Strange. Maybe "uname -n" will work...' if tans=`sh -c 'uname -n' 2>&1` ; then myhostname=$tans phostname='uname -n' else echo 'Oh well, maybe I can mine it out of whoami.h...' if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'` phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h" else case "$myhostname" in '') echo "Does this machine have an identity crisis or something?" phostname='';; *) echo "Well, you said $myhostname before..." phostname='echo $myhostname';; esac fi fi fi fi case "$myhostname" in '') myhostname=noname ;; esac : you do not want to know about this set $myhostname myhostname=$1 : verify guess if $test "$myhostname" ; then dflt=y rp='Your host name appears to be "'$myhostname'".'" Right?" . ./myread case "$ans" in y*) ;; *) myhostname='';; esac fi : bad guess or no guess while $test "X$myhostname" = X ; do dflt='' rp="Please type the (one word) name of your host:" . ./myread myhostname="$ans" done : translate upper to lower if necessary case "$myhostname" in *[A-Z]*) echo "(Normalizing case in your host name)" myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'` ;; esac case "$myhostname" in *.*) dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"` myhostname=`expr "X$myhostname" : "X\([^.]*\)\."` echo "(Trimming domain name from host name--host name is now $myhostname)" ;; *) case "$mydomain" in '') { test "X$hostcat" = "Xypcat hosts" && ypmatch "$myhostname" hosts 2>/dev/null |\ $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \ $test -s hosts } || { $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ / /[ ]$myhostname[ . ]/p" > hosts } tmp_re="[ . ]" $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ } END { print sum }" hosts` = x1 || tmp_re="[ ]" dflt=.`$awk \ "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \ hosts | $sort | $uniq | \ $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"` case `$echo X$dflt` in X*\ *) echo "(Several hosts in /etc/hosts matched hostname)" dflt=. ;; X.) if $test -f /etc/hosts; then echo "(You do not have fully-qualified names in /etc/hosts)" else echo "(I cannot locate a hosts database anywhere)" fi ;; esac case "$dflt" in .) tans=`./loc resolv.conf X /etc /usr/etc` if $test -f "$tans"; then echo "(Attempting domain name extraction from $tans)" dflt=.`$sed -n -e 's/ / /g' \ -e 's/^search *\([^ ]*\).*/\1/p' $tans \ | ./tr '[A-Z]' '[a-z]' 2>/dev/null` case "$dflt" in .) dflt=.`$sed -n -e 's/ / /g' \ -e 's/^domain *\([^ ]*\).*/\1/p' $tans \ | ./tr '[A-Z]' '[a-z]' 2>/dev/null` ;; esac fi ;; esac case "$dflt" in .) echo "(No help from resolv.conf either -- attempting clever guess)" dflt=.`sh -c domainname 2>/dev/null` case "$dflt" in '') dflt='.';; .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;; esac ;; esac case "$dflt$osname" in .os390) file="//'SYS1.TCPPARMS(TCPDATA)'" echo "(Attempting domain name extraction from $file)" dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "$file" 2>/dev/null` ;; esac case "$dflt" in .) echo "(Lost all hope -- silly guess then)" dflt='.nonet' ;; esac $rm -f hosts ;; *) dflt="$mydomain";; esac;; esac echo " " rp="What is your domain name?" . ./myread tans="$ans" case "$ans" in '') ;; .*) ;; *) tans=".$tans";; esac mydomain="$tans" : translate upper to lower if necessary case "$mydomain" in *[A-Z]*) echo "(Normalizing case in your domain name)" mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'` ;; esac : a little sanity check here case "$phostname" in '') ;; *) case `$phostname | ./tr '[A-Z]' '[a-z]'` in $myhostname$mydomain|$myhostname) ;; *) case "$phostname" in sed*) echo "(That doesn't agree with your whoami.h file, by the way.)" ;; *) echo "(That doesn't agree with your $phostname command, by the way.)" ;; esac ;; esac ;; esac : determine the e-mail address of the user who is running us $cat <&4 $cat >foo.c <<'EOF' #define A(x) x #define B(y) y A(a)B(b) EOF if $cpp foo.c >foo.cpp; $contains ab foo.cpp >/dev/null 2>&1; then echo "Plain '$cpp' works just fine." cpp_trad="$cpp" elif $cpp -traditional foo.c >foo.cpp; \ $contains ab foo.cpp >/dev/null 2>&1; then echo "We'll use '$cpp -traditional' to get proper semantics." cpp_trad="$cpp -traditional" else echo "I don't know how to get traditional semantics with '$cpp'." >&4 cpp_trad="$cpp" fi $rm -f foo.c foo.cpp : Check whether they have gcc in any guise. echo " " echo "Checking for GNU cc in disguise and/or its version number..." >&4 $cat >try.c < int main() { #ifdef __GNUC__ #ifdef __VERSION__ printf("%s\n", __VERSION__); #else printf("%s\n", "1"); #endif #endif exit(0); } EOM if $cc -o try $ccflags $ldflags try.c >/dev/null 2>&1; then gccversion=`$run ./try` case "$gccversion" in '') echo "You are not using GNU cc." ;; *) echo "You are using GNU cc $gccversion." ccname=gcc ;; esac else echo " " echo "*** WHOA THERE!!! ***" >&4 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4 case "$knowitall" in '') echo " You'd better start hunting for one and let me know about it." >&4 exit 1 ;; esac fi $rm -f try try.* case "$gccversion" in 1*) cpp=`./loc gcc-cpp $cpp $pth` ;; esac case "$gccversion" in '') gccosandvers='' ;; *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'` gccosandvers=`$cc -v 2>&1 | \ $grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"` gccshortvers='' case "$gccosandvers" in $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr $osname$osvers) ;; # looking good $osname*) cat <&4 *** WHOA THERE!!! *** Your gcc has not been compiled for the exact release of your operating system ($gccosandvers versus $osname$osvers). In general it is a good idea to keep gcc synchronized with the operating system because otherwise serious problems may ensue when trying to compile software, like Perl. I'm trying to be optimistic here, though, and will continue. If later during the configuration and build icky compilation problems appear (headerfile conflicts being the most common manifestation), I suggest reinstalling the gcc to match your operating system release. EOM ;; *) gccosandvers='' ;; # failed to parse, better be silent esac ;; esac case "$ccname" in '') ccname="$cc" ;; esac : gcc 3.1 complains about adding -Idirectories that it already knows about, : so we will take those off from locincpth. case "$gccversion" in 3*) echo "main(){}">try.c for incdir in `$cc -v -c try.c 2>&1 | \ sed '1,/^#include <\.\.\.>/d;/^End of search list/,$d;s/^ //'` ; do locincpth=`echo $locincpth | sed s!$incdir!!` done $rm -f try try.* esac : see how we invoke the C preprocessor echo " " echo "Now, how can we feed standard input to your C preprocessor..." >&4 cat <<'EOT' >testcpp.c #define ABC abc #define XYZ xyz ABC.XYZ EOT cd .. if $test ! -f cppstdin; then echo "$startsh" >cppstdin if $test "X$osname" = "Xaix" -a "X$gccversion" = X; then echo 'cat >.$$.c; rm -f .$$.u; '"$cc"' ${1+"$@"} -M -c .$$.c 2>/dev/null; \ test -s .$$.u && \ awk '"'"'$2 ~ /\.h$/ { print "# 0 \""$2"\"" }'"'"' .$$.u; \ rm -f .$$.o .$$.u; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >> cppstdin else echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >>cppstdin fi; else echo "Keeping your $hint cppstdin wrapper." fi chmod 755 cppstdin $eunicefix cppstdin wrapper=`pwd`/cppstdin ok='false' cd UU if $test "X$cppstdin" != "X" && \ $cppstdin $cppminus testcpp.out 2>&1 && \ $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 then echo "You used to use $cppstdin $cppminus so we'll use that again." case "$cpprun" in '') echo "But let's see if we can live without a wrapper..." ;; *) if $cpprun $cpplast testcpp.out 2>&1 && \ $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 then echo "(And we'll use $cpprun $cpplast to preprocess directly.)" ok='true' else echo "(However, $cpprun $cpplast does not work, let's see...)" fi ;; esac else case "$cppstdin" in '') ;; *) echo "Good old $cppstdin $cppminus does not seem to be of any help..." ;; esac fi if $ok; then : nothing elif echo 'Maybe "'"$cc"' -E" will work...'; \ $cc -E testcpp.out 2>&1; \ $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then echo "Yup, it does." x_cpp="$cc -E" x_minus=''; elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \ $cc -E - testcpp.out 2>&1; \ $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then echo "Yup, it does." x_cpp="$cc -E" x_minus='-'; elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \ $cc -P testcpp.out 2>&1; \ $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then echo "Yipee, that works!" x_cpp="$cc -P" x_minus=''; elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \ $cc -P - testcpp.out 2>&1; \ $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then echo "At long last!" x_cpp="$cc -P" x_minus='-'; elif echo 'No such luck, maybe "'$cpp'" will work...'; \ $cpp testcpp.out 2>&1; \ $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then echo "It works!" x_cpp="$cpp" x_minus=''; elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \ $cpp - testcpp.out 2>&1; \ $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then echo "Hooray, it works! I was beginning to wonder." x_cpp="$cpp" x_minus='-'; elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \ $wrapper testcpp.out 2>&1; \ $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then x_cpp="$wrapper" x_minus='' echo "Eureka!" else dflt='' rp="No dice. I can't find a C preprocessor. Name one:" . ./myread x_cpp="$ans" x_minus='' $x_cpp testcpp.out 2>&1 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then echo "OK, that will do." >&4 else echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4 exit 1 fi fi case "$ok" in false) cppstdin="$x_cpp" cppminus="$x_minus" cpprun="$x_cpp" cpplast="$x_minus" set X $x_cpp shift case "$1" in "$cpp") echo "Perhaps can we force $cc -E using a wrapper..." if $wrapper testcpp.out 2>&1; \ $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 then echo "Yup, we can." cppstdin="$wrapper" cppminus=''; else echo "Nope, we'll have to live without it..." fi ;; esac case "$cpprun" in "$wrapper") cpprun='' cpplast='' ;; esac ;; esac case "$cppstdin" in "$wrapper"|'cppstdin') ;; *) $rm -f $wrapper;; esac $rm -f testcpp.c testcpp.out : Set private lib path case "$plibpth" in '') if ./mips; then plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib" fi;; esac case "$libpth" in ' ') dlist='';; '') dlist="$loclibpth $plibpth $glibpth";; *) dlist="$libpth";; esac : Now check and see which directories actually exist, avoiding duplicates libpth='' for xxx in $dlist do if $test -d $xxx; then case " $libpth " in *" $xxx "*) ;; *) libpth="$libpth $xxx";; esac fi done $cat <<'EOM' Some systems have incompatible or broken versions of libraries. Among the directories listed in the question below, please remove any you know not to be holding relevant libraries, and add any that are needed. Say "none" for none. EOM case "$libpth" in '') dflt='none';; *) set X $libpth shift dflt=${1+"$@"} ;; esac rp="Directories to use for library searches?" . ./myread case "$ans" in none) libpth=' ';; *) libpth="$ans";; esac : determine optimize, if desired, or use for debug flag also case "$optimize" in ' '|$undef) dflt='none';; '') case "$gccversion" in '') dflt='-O';; *) dflt='-O2 -g';; esac ;; *) dflt="$optimize";; esac case "$gccversion" in '') $cat </dev/null 2>&1 then dflt="$dflt -posix" fi ;; esac case "$gccversion" in 1*|2*) dflt="$dflt -Wall";; *) dflt="$dflt -W -Wall -Wformat=2 -Wshadow";; esac ;; esac case "$mips_type" in *BSD*|'') inclwanted="$locincpth $usrinc";; *) inclwanted="$locincpth $inclwanted $usrinc/bsd";; esac for thisincl in $inclwanted; do if $test -d $thisincl; then if $test x$thisincl != x$usrinc; then case "$dflt" in *$thisincl*);; *) dflt="$dflt -I$thisincl";; esac fi fi done inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then xxx=true; elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then xxx=true; else xxx=false; fi; if $xxx; then case "$dflt" in *$2*);; *) dflt="$dflt -D$2";; esac; fi' if ./osf1; then set signal.h __LANGUAGE_C__; eval $inctest else set signal.h LANGUAGE_C; eval $inctest fi case "$hint" in default|recommended) dflt="$ccflags $dflt" ;; *) dflt="$ccflags";; esac case "$dflt" in ''|' ') dflt=none;; esac $cat <&4 set X $cppflags shift cppflags='' $cat >cpp.c <<'EOM' #define BLURFL foo BLURFL xx LFRULB EOM previous='' for flag in $* do case "$flag" in -*) ftry="$flag";; *) ftry="$previous $flag";; esac if $cppstdin -DLFRULB=bar $ftry $cppminus cpp1.out 2>/dev/null && \ $cpprun -DLFRULB=bar $ftry $cpplast cpp2.out 2>/dev/null && \ $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \ $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1 then cppflags="$cppflags $ftry" previous='' else previous="$flag" fi done set X $cppflags shift cppflags=${1+"$@"} case "$cppflags" in *-*) echo "They appear to be: $cppflags";; esac $rm -f cpp.c cpp?.out ;; esac : flags used in final linking phase case "$ldflags" in '') if ./venix; then dflt='-i -z' else dflt='' fi case "$ccflags" in *-posix*) dflt="$dflt -posix" ;; esac ;; *) dflt="$ldflags";; esac : Try to guess additional flags to pick up local libraries. for thislibdir in $libpth; do case " $loclibpth " in *" $thislibdir "*) case "$dflt " in *"-L$thislibdir "*) ;; *) dflt="$dflt -L$thislibdir" ;; esac ;; esac done case "$dflt" in '') dflt='none' ;; *) set X $dflt; shift; dflt="$@";; esac $cat <&4 set X $cc $optimize $ccflags $ldflags -o try try.c shift $cat >try.msg < try.c <<'EOF' #include int main() { exit(0); } EOF dflt=y if sh -c "$cc $optimize $ccflags $ldflags -o try try.c" >>try.msg 2>&1; then if sh -c './try' >>try.msg 2>&1; then dflt=n else echo "The program compiled OK, but exited with status $?." >>try.msg rp="You have a problem. Shall I abort Configure" dflt=y fi else echo "I can't compile the test program." >>try.msg rp="You have a BIG problem. Shall I abort Configure" dflt=y fi case "$dflt" in y) $cat try.msg >&4 case "$knowitall" in '') echo "(The supplied flags might be incorrect with this C compiler.)" ;; *) dflt=n;; esac echo " " . ./myread case "$ans" in n*|N*) ;; *) echo "Ok. Stopping Configure." >&4 exit 1 ;; esac ;; n) echo "OK, that should do.";; esac $rm -f try try.* core : determine default editor echo " " case "$defeditor" in '') case "$vi" in */*) dflt="$vi";; *) dflt=/usr/ucb/vi;; esac ;; *) dflt="$defeditor" ;; esac fn=f/ rp="What is the default editor on your system?" . ./getfile defeditor="$ans" : locate a BSD compatible install program echo " " echo "Looking for a BSD-compatible install program..." >&4 creatdir='' case "$install" in '') tryit='' for dir in $pth; do for file in ginstall installbsd scoinst install; do if $test -f $dir/$file; then tryit="$tryit $dir/$file" fi done done $cat >try.c </dev/null 2>&1; then cp try try.ns strip try >/dev/null 2>&1 else echo "(I can't seem to compile a trivial C program -- bypassing.)" echo "try" >try cp try try.ns fi $cat >tryinst </dev/null 2>&1 if $test -d foo/bar; then creatdir="$prog -d" fi (ls -l d/try >try.ls; ls -l d/try.ns >tryno.ls) 2>/dev/null if (cmp -s d/try try && cmp -s d/try.ns try.ns && \ $contains 'rwxrw-r--' tryno.ls && \ $contains 'rw-r---w-' try.ls) >/dev/null 2>&1 then dflt="$prog" echo "ok, that will do." break fi echo "not good$either." either=' either' $rm -f try*.ls done $rm -rf foo d tryinst try try*.ls try.* case "$dflt" in '') echo "Hopefully, $package comes with its own install script!" dflt='./install' ;; esac ;; *) dflt="$install";; esac $cat <&4 case "$installdir" in '') $mkdir -p foo/bar >/dev/null 2>&1 if $test -d foo/bar; then echo "Great, we can build them using 'mkdir -p'." creatdir='mkdir -p' else case "$creatdir" in '') if eval "$install -d foo/bar"; $test -d foo/bar; then creatdir="install -d" echo "It looks like '$creatdir' will do it for us." fi ;; *) eval "$creatdir foo/bar" >/dev/null 2>&1 if $test -d foo/bar; then echo "Ah! We can use '$creatdir' to do just that." else creatdir='' fi ;; esac fi $rm -rf foo case "$creatdir" in '') echo "Heck! Another ancient system lacking the comfort of modern ones!" echo "You can thank $package for bringing you its own install script!" installdir='./install -d' ;; *) installdir="$creatdir";; esac ;; *) echo "As you already told me, '$installdir' should work.";; esac : determine the name of a reasonable mailer case "$mailer" in '') if $test -f "$sendmail"; then dflt="$sendmail" elif $test -f "$smail"; then dflt="$smail" elif $test -f "$rmail"; then dflt="$rmail" elif $test -f /bin/mail; then dflt=/bin/mail else dflt=$mail fi ;; *) dflt="$mailer";; esac $cat <&4 if $test -r $rsrc/patchlevel.h;then patchlevel=`awk \ '/^#[ ]*define[ ][ ]*PATCHLEVEL/ {print $3}' \ < $rsrc/patchlevel.h` else patchlevel=0 fi if $test -r $rsrc/revision.h;then revision=`awk \ '/^#[ ]*define[ ][ ]*REVISION/ {print $3}' \ < $rsrc/revision.h` else revision=0 fi case "$revision" in 0) echo "(You have $package $baserev PL$patchlevel.)" ;; *) case "$patchlevel" in 0) echo "(You have $package $baserev-$revision)";; *) echo "(You have $package $baserev-$revision PL$patchlevel)";; esac ;; esac : determine perl absolute location case "$perlpath" in '') if test -f /usr/bin/perl; then dflt=/usr/bin/perl else case "$perl" in */*) dflt="$perl";; *) dflt=/usr/bin/perl;; esac fi ;; *) dflt="$perlpath" ;; esac echo " " fn=f~/ rp="Where is perl located on your system?" . ./getfile perlpath="$ans" : figure out how to guarantee perl startup case "$sharpbang" in *!) $cat >xtry </dev/null 2>&1; then $cat <&4 . ./config.arch fi : configuration may be patched via a 'config.over' file if $test -f config.over; then echo " " dflt=y rp='I see a config.over file. Do you wish to load it?' . UU/myread case "$ans" in n*) echo "OK, I'll ignore it.";; *) . ./config.over echo "Configuration override changes have been loaded." ;; esac fi : in case they want portability, strip down executable paths case "$d_portable" in "$define") echo " " echo "Stripping down executable paths..." >&4 xsed=$sed for file in $loclist $trylist; do eval sfile="\$$file" sfile=`echo $sfile | $xsed -e 's,.*/\(.*\),\1,'` eval $file="$sfile" done ;; esac : create config.sh file echo " " echo "Creating config.sh..." >&4 $spitshell <config.sh $startsh # # This file was produced by running the Configure script. It holds all the # definitions figured out by Configure. Should you modify one of these values, # do not forget to propagate your changes by running "Configure -der". You may # instead choose to run each of the .SH files by yourself, or "Configure -S". # # Package name : $package # Source directory : $src # Configuration time: $cf_time # Configured by : $cf_by # Target system : $myuname EOT $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh $spitshell <>config.sh Author='$Author' Date='$Date' Header='$Header' Id='$Id' Locker='$Locker' Log='$Log' RCSfile='$RCSfile' Revision='$Revision' Source='$Source' State='$State' _a='$_a' _exe='$_exe' _o='$_o' afs='$afs' afsroot='$afsroot' ar='$ar' archobjs='$archobjs' awk='$awk' baserev='$baserev' bash='$bash' bison='$bison' byacc='$byacc' c='$c' cat='$cat' ccflags='$ccflags' ccname='$ccname' ccversion='$ccversion' cf_by='$cf_by' cf_email='$cf_email' cf_time='$cf_time' chgrp='$chgrp' chmod='$chmod' chown='$chown' comm='$comm' compress='$compress' contains='$contains' cp='$cp' cpio='$cpio' cpp='$cpp' cpp_trad='$cpp_trad' cppflags='$cppflags' cpplast='$cpplast' cppminus='$cppminus' cpprun='$cpprun' cppstdin='$cppstdin' csh='$csh' d_berknames='$d_berknames' d_bsd='$d_bsd' d_dos='$d_dos' d_eunice='$d_eunice' d_linux='$d_linux' d_os2='$d_os2' d_passnames='$d_passnames' d_portable='$d_portable' d_usgnames='$d_usgnames' d_xenix='$d_xenix' date='$date' defeditor='$defeditor' echo='$echo' egrep='$egrep' emacs='$emacs' eunicefix='$eunicefix' expr='$expr' find='$find' firstmakefile='$firstmakefile' flex='$flex' from='$from' gccosandvers='$gccosandvers' gccversion='$gccversion' glibpth='$glibpth' gmake='$gmake' grep='$grep' groupcat='$groupcat' gzip='$gzip' hint='$hint' hostcat='$hostcat' incpath='$incpath' inews='$inews' install='$install' installdir='$installdir' installmansrc='$installmansrc' installprivlib='$installprivlib' installscript='$installscript' issymlink='$issymlink' ksh='$ksh' ldflags='$ldflags' less='$less' libpth='$libpth' line='$line' lint='$lint' lkflags='$lkflags' ln='$ln' lns='$lns' locincpth='$locincpth' loclibpth='$loclibpth' lp='$lp' lpr='$lpr' ls='$ls' mail='$mail' mailer='$mailer' mailx='$mailx' make='$make' make_set_make='$make_set_make' manext='$manext' mansrc='$mansrc' mansrcexp='$mansrcexp' mips_type='$mips_type' mkdir='$mkdir' more='$more' mv='$mv' mydomain='$mydomain' myhostname='$myhostname' myuname='$myuname' n='$n' nametype='$nametype' nm='$nm' nroff='$nroff' optimize='$optimize' orgname='$orgname' osname='$osname' osvers='$osvers' package='$package' pager='$pager' passcat='$passcat' patchlevel='$patchlevel' perl='$perl' perlpath='$perlpath' pg='$pg' phostname='$phostname' pkgsrc='$pkgsrc' plibpth='$plibpth' pmake='$pmake' pr='$pr' prefix='$prefix' prefixexp='$prefixexp' privlib='$privlib' privlibexp='$privlibexp' revision='$revision' rm='$rm' rmail='$rmail' run='$run' scriptdir='$scriptdir' scriptdirexp='$scriptdirexp' sed='$sed' sendmail='$sendmail' sh='$sh' shar='$shar' sharpbang='$sharpbang' shsharp='$shsharp' sleep='$sleep' smail='$smail' sort='$sort' spackage='$spackage' spitshell='$spitshell' src='$src' startperl='$startperl' startsh='$startsh' submit='$submit' sysman='$sysman' tail='$tail' tar='$tar' targetarch='$targetarch' tbl='$tbl' tee='$tee' test='$test' to='$to' touch='$touch' tr='$tr' trnl='$trnl' troff='$troff' uname='$uname' uniq='$uniq' usecrosscompile='$usecrosscompile' usrinc='$usrinc' uuname='$uuname' vi='$vi' xlibpth='$xlibpth' zcat='$zcat' zip='$zip' EOT : add special variables $test -f $src/patchlevel.h && \ awk '/^#define/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh $test -f $src/revision.h && \ awk '/^#define/ {printf "%s=%s\n",$2,$3}' $src/revision.h >>config.sh echo "CONFIG=true" >>config.sh : propagate old symbols if $test -f UU/config.sh; then UU/oldconfig.sh $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \ config.sh config.sh UU/oldconfig.sh |\ $sort | $uniq -u >UU/oldsyms set X `cat UU/oldsyms` shift case $# in 0) ;; *) cat <>config.sh for sym in `cat UU/oldsyms`; do echo " Propagating $hint variable "'$'"$sym..." eval 'tmp="$'"${sym}"'"' echo "$tmp" | \ sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh done ;; esac fi : Finish up by extracting the .SH files case "$alldone" in exit) $rm -rf UU echo "Extraction done." exit 0 ;; cont) ;; '') dflt='' nostick=true $cat <&4 -c "$ans";; esac ;; esac : if this fails, just run all the .SH files by hand . ./config.sh echo " " exec 1>&4 pwd=`pwd` . ./UU/extract cd "$pwd" if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then dflt=y case "$silent" in true) ;; *) $cat < makedepend.out &" It can take a while, so you might not want to run it right now. EOM ;; esac rp="Run $make depend now?" . UU/myread case "$ans" in y*) $make depend && echo "Now you must run '$make'." ;; *) echo "You must run '$make depend' then '$make'." ;; esac elif test -f [Mm]akefile; then echo " " echo "Now you must run a $make." else echo "Configure done." fi if $test -f Policy.sh; then $cat <&4 fi $rm -f kit*isdone ark*isdone $rm -rf UU : End of Configure dist_3.5-30.orig/Credits0000644000175000017500000001136610473316164015373 0ustar srivastasrivastaINTRO This version of dist has been written by Raphael Manfredi based on previous work from Larry Wall and Harlan Stenn. HISTORY I started working on this in September 1990 while I was still a student at the Ecole des Mines de Saint-Etienne, France. From then on, I worked during two years at ISE (building the Eiffel 3.0 compiler -- the run-time part and code generation). Since I chose to use metaconfig for the run-time library, which is written in plain C, I had the chance to continue improving the whole dist package. By the end of 1991, I contacted Harlan Stenn who had been working separately on his own dist version. I started the painful merge. At the same time, I started releasing alpha version of dist 3.0. In 1992, I started a parallel project: mailagent. The dist 2.0 release upon which this work is based included a simple perl script called mailagent, whose sole job was to filter out @SH commands to automatically mail patches to some people. I liked the idea of having a perl mail filter and so I extended mailagent up to the point where it became really big and only marginally dist-related. I released it on the net (comp.sources.misc) on July 1992, after 7 months of hard work. In March 1993, I left ISE and returned to France to join ACRI. The dist 3.0 package was "almost" finished by that time, but the documentation was no longer accurate and needed a lot of work. My new job does not give me enough free time, so things have been longer than I expected. In July 1993, under the pressure of many of my alpha testers, I decided to go into the final process, sacrifying nights and week ends to finish up what turns out to have been a 3 years process... CREDITS My first thanks will go to Larry Wall who wrote perl and dist 2.0 in the first place. I would never have dived into dist 2.0 if it had not been written in perl. During my work, I had the chance to benefit some useful comments and contributions from Craig Kolb who has been the very first user of metaconfig (with a rather pre-historic version). He used it on its rayshade 4.0 release (a ray tracing program). Then of course, many thanks are due to my co-worker, Harlan Stenn . Although I did the integration of his work all by myself, I have found many good ideas in his early work. For instance, he wrote the first implementation of the metalint program, something I could not live without today! His remarks, comments and encouragements have always been appreciated, even though we did not always agree on the same things at the same time... Then I would like to thank the many contributors to the metaconfig units. I hope I'm not forgetting anybody! Here they come, in alphabetical order: (sorted on the first name) Andy Dougherty Craig Kolb Graham Stoney Harlan Stenn Jan Djarv Larry Wall Ralf E. Stranzenbach Scott Grosch Syd Weinstein Thomas Neumann Wayne Davison If I forgot your name, please let me know, and accept my apologies (not necessarily in that order ;-). Finally, thank you Shigeya Suzuki for hosting the dist-users mailing list. Send mail to majordomo@foretune.co.jp to subscribe. Raphael Manfredi Lyon, France, August 1993 [This section added by subsequent patches] PATCHES I'm grateful to the following people for sending me patches and/or reporting bugs and giving me some suggestions (sorted on the first name): Andy Dougherty Graham Stoney Ilya Zakharevich Jarkko Hietaniemi Joseph H Buehler Keith Walker Scott Presnell Wayne Davison Due to a mistake of mine, changes from Wayne Davison were flagged 'WAD', but his middle initial being an 'E', new ones are now flagged as 'WED'. Sorry Wayne, I did not know. We don't use middle initials here in Europe. Special thanks to the perl5 Patch Pumpkin Holders (in chronological order): Andy Dougherty Chip Salzenberg for their wonderful creativity. Perl5 is by far the largest metaconfig customer with the widest audience, so Configure got run on a variety of new platforms requiring specific fixes... which they provided, thereby greatly enhancing the metaconfig "portability database". Raphael Manfredi Grenoble, France, February 1997 dist_3.5-30.orig/dist.man0000644000175000017500000002213410473666773015524 0ustar srivastasrivasta''' $Id: dist.man 3 2006-08-25 21:39:07Z rmanfredi $ ''' ''' Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ''' ''' You may redistribute only under the terms of the Artistic Licence, ''' as specified in the README file that comes with the distribution. ''' You may reuse parts of this distribution only within the terms of ''' that same Artistic Licence; a copy of which may be found at the root ''' of the source tree for dist 4.0. ''' ''' $Log: dist.man,v $ ''' Revision 3.0.1.6 1995/05/12 11:57:53 ram ''' patch54: updated my e-mail address ''' ''' Revision 3.0.1.5 1994/10/29 15:46:03 ram ''' patch36: mentions new patlog script and ChangeLog file ''' ''' Revision 3.0.1.4 1994/05/06 13:54:17 ram ''' patch23: extended copyright notice to 1994 ''' patch23: new script kitpost ''' ''' Revision 3.0.1.3 1994/01/24 13:55:41 ram ''' patch16: documents profile and its components ''' ''' Revision 3.0.1.2 1993/11/10 17:31:03 ram ''' patch14: added mention for new confmagic.h file ''' ''' Revision 3.0.1.1 1993/08/24 12:12:00 ram ''' patch3: added entries for patnotify and patsnap ''' ''' Revision 3.0 1993/08/18 12:04:07 ram ''' Baseline for dist 3.0 netwide release. ''' ''' .de Ex \" Start of Example .sp .in +5 .nf .. .de Ef \" End of Example .sp .in -5 .fi .. .TH DIST 1 ram .SH NAME dist \- introduction to dist .SH DESCRIPTION The \fIdist\fR package is a set of tools meant to ease the construction and maintenance of portable software. There are four distinct parts in \fIdist\fR, and it is also meant to be used with two external products, which are publicly available: \fImailagent\fR and \fIpatch\fR. .PP The first component is the \fIConfigure\fR script generator, which is a portability tool. It is automatically build up by \fImetaconfig\fR from your sources and a set of units. Ideally, the end-user receiving your source code will simply have to read your README file, run the \fIConfigure\fR script (which is self-documented), and then run \fImake\fR. Your package should then build cleanly on every UNIX platform. .PP The second component is the \fIMakefile.SH\fR generator, which is a generic configured Makefile, reusing some of the information figured out by .I Configure. Although you may write your own Makefile and then use \fImakeSH\fR to transform it into a \fIMakefile.SH\fR, it is better to write a generic \fIJmakefile\fR description, which does not rely on a particular position within the source tree, and then use \fIjmake\fR to recursively build your Makefiles. .PP The third component is the package generator, which is used when it's time to build up the shell archives used to distribute your program. Although you may use your own archiving mechanism, the one included here knows about RCS files and will properly check out the lattest revisions, leaving your working files alone. The \fImakedist\fR program will also perform Copyright expansion, an useful feature when you share source files among more than one program, placed under distinct Copyright information. .PP The fourth and latest component is the patch generator, used to make updates of your sources, which can later be applied on the original distribution by using the \fIpatch\fR program. .PP Before using any of the \fIdist\fR programs, you should probably identify your package by running the \fIpackinit\fR program, which will create a \fI.package\fR file in the top-level directory of your package. .SH COMMANDS The \fIdist\fR package implements the following commands (those tagged as \fIlibrary\fR commands are to be found in the dist library and should not be made publicly available in everyone's path): .TP 15 bindex builds the \fIIndex\fR file (library). .PD 0 .TP jmake a Makefile.SH generator. .TP jmkmf bootstraps top-level Makefile.SH file. .TP kitpost posts distribution kits made by \fImakedist\fR. .TP kitsend sends distribution kits made by \fImakedist\fR. .TP makeSH wraps existing scripts into a .SH file. .TP makedist builds up distribution kits. .TP makegloss builds the \fIGlossary\fR file (library). .TP manicheck checks MANIFEST.new accuracy .TP manifake makes MANIFEST.new out of an existing MANIFEST. .TP manilist builds MANIFEST.new reports. .TP metaconfig a Configure script generator. .TP metalint a metaconfig unit consistency checker. .TP metaxref a metaconfig cross-reference builder. .TP packinit initializes a package (creates a .package file). .TP pat main patch generator. .TP patbase resets patch base to current version. .TP patcil checks new version in. .TP patclean remove working version of up-to-date files. .TP patcol checks file out. .TP patdiff builds (contextual) diffs for the patch. .TP patftp copies patches to public ftp directory. .TP patindex builds a patch index. .TP patlog handles ChangeLog file updates. .TP patmake puts diffs together into a patch. .TP patnotify notifies users that new patches have been released. .TP patpost posts patch to some newsgroup. .TP patsend mails patch to some people. .TP patsnap builds a release snapshot with files and RCS revisions. .PD .SH PROFILE Commands having a set of meaningful options (other than \fB\-h\fR or \fB\-V\fR) can also take arguments from the \fI~/.dist_profile\fR file, or whatever file the \fIDIST\fR environment variable points to. Each line of the file is in the format: .Ex profile-component: \fIvalue\fR .Ef whith shell-style comments (#) allowed provided they start the line. .PP Each command looks for a profile component entry matching its name and loads the \fIvalue\fR as if it were arguments specified on the command line. Those arguments precede any other argument specified manually, in case order is meaningful. .PP Some commands may also be configured from within the profile, by setting a specific \fIvariable\fR attached to the command by a profile entry looking like this: .Ex cmdname-\fIvariable\fR: \fIvalue\fR .Ef For instance, assuming the variable \fIc-files\fR is recognized by the \fImetaconfig\fR program, its default value could be overwritten by this profile entry: .Ex metaconfig-c-files: \fIsuitable value\fR .Ef Only the first '-' after the command name is part of the syntax, the other one used in the variable name is pure convention. Please refer to the manual page of each command for a list of valid profile variables which may be set. .SH FILES .PD 0 .TP 15 \&.MT Temporary directory created by \fImetaconfig\fR and friends. .TP \&.newer A list of files newer than \fIpatchlevel.h\fR, used by the patching tools. .TP \&.package Main configuration file used by most of the dist tools to make them smart. .TP ChangeLog The file where changes are recorded. Its name may be configured by running \fIpackinit\fR, but this is the default "generic" name under which it is referred to within the documentation. .TP Configure The generated configuration script. .TP Glossary A list of all the known portability symbols known by \fImetaconfig\fR. This file is located in the dist library directory. .TP I.fui Cross-reference file generated by \fImetaxref\fR, sorted by file, unit, item. .TP I.uif Cross-reference file generated by \fImetaxref\fR, sorted by unit, item, file. .TP Index A list of all the rules known by \fIjmake\fR. This file is located in the dist library directory. .TP Jmakefile Generic makefile description used by \fIjmake\fR. .TP MANIFEST List of all the files to be included in the distribution. Usually a copy (not a link) of MANIFEST.new. .TP MANIFEST.new List of all the files to be taken into account by the dist tools. .TP Makefile.SH The generated configured makefile (via Jmakefile) or hand-generated Makefile making use of known metaconfig symbols. .TP Obsolete A list of obsolete symbol used and their new equivalents. .TP RCS Directory where RCS files are stored. .TP README Main file explaining how to build your package. .TP U Private unit directory. .TP Wanted File used by \fImetaconfig\fR, listing all the symbols used by the sources. .TP bugs Directory where patches are stored. .TP check.extra Extra files present in MANIFEST.new, generated by \fImanicheck\fR. .TP check.want Missing files from MANIFEST.new, generated by \fImanicheck\fR. .TP config_h.SH Generated config.h template. .TP confmagic.h Magic symbol remapping, activated via metaconfig's \fB\-M\fR option. .TP hints This directory lists all the configuration hints for your package. .TP patchlevel.h File recording your package patch level, should not be part of MANIFEST.new, but may be listed in MANIFEST, at your discretion. .TP users File recording the users of your package, generated by mailagent's \fIpackage\fR command (see the MailAuthor.U unit and mailagent 3.0). .PD .SH ENVIRONMENT The following environment variable is paid attention to: .TP 15 DIST Location of the dist profile, defaults to ~/.dist_profile. This variable is subject to ~name substitution, even if your shell does not support it. .SH AUTHORS By chronological order: .sp Larry Wall (dist 2.0 in 1988) .br Harlan Stenn (worked on dist 3.0 1990-1992) .br Raphael Manfredi (dist 3.0 and integration 1991-1995) .sp Please look at the \fICredits\fR file in the distribution source tree for a list of all the known contributors. .SH "SEE ALSO" jmake(1), metaconfig(1), pat(1). dist_3.5-30.orig/Known_bugs0000644000175000017500000000057010473316164016105 0ustar srivastasrivastaHere are some known bugs that I plan to fix soon. + Patname ought to ask for a log message for the symbolic number. + A unit name is always wanted by Configure. Hence in a unit d_waitpid, if you write: @if WAITPID || d_waitpid ..... @end then the <....> part of the code will always be loaded even if no shell script references d_waitpid or C code references WAITPID. dist_3.5-30.orig/mcon/0002755000175000017500000000000011272612640014776 5ustar srivastasrivastadist_3.5-30.orig/mcon/configure0000644000175000017500000000545310473316164016713 0ustar srivastasrivasta#! /bin/sh # # $Id: configure,v 3.0.1.2 1997/02/28 16:28:49 ram Exp ram $ # # GNU configure-like front end to metaconfig's Configure. # # Written by Andy Dougherty # Matthew Green and Tom Tromey . # # Reformatted and modified for inclusion in the dist-3.0 package by # Raphael Manfredi . # # This script belongs to the public domain and may be freely redistributed. # # The remaining of this leading shell comment may be removed if you # include this script in your own package. # # $Log: configure,v $ # Revision 3.0.1.2 1997/02/28 16:28:49 ram # patch61: added the srcdir support now that we have src.U # patch61: random cleanup for nicer help message # # Revision 3.0.1.1 1995/07/25 14:16:21 ram # patch56: created # (exit $?0) || exec sh $0 $argv:q opts='' verbose='' create='-e' srcdir='' while test $# -gt 0; do case $1 in --help) cat </dev/null 2>&1 shift ;; --verbose) verbose=true shift ;; --version) copt="$copt -V" shift ;; --host=*|--target=*|--cache-file=*|--enable-*|--with-*) shift ;; --*) opt=`echo $1 | sed 's/=.*//'` echo "This GNU configure front end does not understand $opt" exit 1 ;; *) opts="$opts $1" shift ;; esac done case "$CC" in '') ;; *) opts="$opts -Dcc='$CC'";; esac # Join DEFS and CFLAGS together. ccflags='' case "$DEFS" in '') ;; *) ccflags=$DEFS;; esac case "$CFLAGS" in '') ;; *) ccflags="$ccflags $CFLAGS";; esac case "$ccflags" in '') ;; *) opts="$opts -Dccflags='$ccflags'";; esac # Don't use -s if they want verbose mode case "$verbose" in '') copt="$copt -ds";; *) copt="$copt -d";; esac # Figure out srcdir if not set already case "$srcdir" in '') srcdir=`echo $0 | sed -e 's%/[^/][^/]*$%%'`;; esac case "$srcdir" in ".") ;; *) opts="$opts -Dsrc=$srcdir";; esac set X sh $srcdir/Configure $copt $create $opts shift echo "$@" exec "$@" dist_3.5-30.orig/mcon/INTRO0000644000175000017500000000750310473316164015623 0ustar srivastasrivastaThis is a quick introduction to metaconfig. Metaconfig is a combination of a methodology and a program that will help you write portable programs. It is well known that all UN*X systems are not the same. Instead of writing lots of #ifdef/#endif for each machine the program is ported on, it seems better to directly rely on the actual possibilities of the system, without having to consider whether it comes from HP or SUN. The idea is to write the program using some symbols, known by a "unit", for all the hardware- or kernel- specific parts of code. A metaconfig unit will automatically define the symbol or not, depending on the system. Source files are scanned by metaconfig and the necessary units are loaded and put into a shell script called Configure. Running the Configure script will automatically determine a suitable value for each symbol. How does a Configure script work ? It studies the environment it runs on by extracting names in the C library, by compiling some small sample C programs, and by asking questions when in doubt, always providing a computed default answer. Here is a small example. It is said in the glossary of the symbols that RENAME is defined if the rename routine is available to rename files. Without metaconfig, we could write (for each occurrence of a "rename" in the code): #if defined(HP-UX-7.0) || defined(SUN) || defined(BSD) rename(old, new); #else unlink(new); link(old, new); unlink(old); #endif With the help of metaconfig, we shall write (once !): #ifndef HAS_RENAME int rename(old, new) char *old, *new; { (void) unlink(new); if (-1 != link(old, new)) return unlink(old); else return -1; } #endif .... rename(old, new); And that's all. The Configure script will check whether `rename' is available on the target machine and accordingly define the RENAME symbol. It is even more powerful that it may appear on a first glance, because "rename" was not there on old SUNOS3 systems or HP-UX older than 6.5 (for series 800) and 7.0 (for series 300). You cannot rely on the fact that the target machine has the latest OS release ! Another problem is to determine whether a C program should include , or with KERNEL defined. With metaconfig, you simply write: #ifdef I_TIME # include #endif #ifdef I_SYS_TIME # include #endif #ifdef I_SYS_TIME_KERNEL # define KERNEL # include # undef KERNEL #endif and the Configure script will generate a small C program, compile it, and correctly define one of the three symbols I_TIME, I_SYS_TIME and I_SYS_TIME_KERNEL. Another kind of precious information can be collected by a Configure script. For instance, the symbol USE_STRUCT_COPY will be defined if the C compiler can copy structures. It is up to the programmer to use this information, of course. The symbol VOIDSIG will be defined if the system declares "void (*signal())()" instead of "int (*signal())()". Thus you can say: #ifdef VOIDSIG extern void (*signal())(); #else extern int (*signal())(); #endif and no suspicious warning will be emitted by the C compiler. Finally, Configure can help you in shell scripts or in makefile. By using a file called Makefile.SH, which will be run through a shell to produce a Makefile, you can use the variable substitution feature. The variable $ranlib will be set to 'ranlib' or to ': ' (null statement) in a makefile, which is useful for random libraries generation. Likewise, the variable $bin will hold the full path for installing binaries (a question will be issued by Configure). Needless to say, an initial amount of time must be spent before being able to use metaconfig. The proper symbols must be known, and the program must be prepared to deal with all the possible configurations. But likewise, it will adapt itself to a greater number of systems without any further source code modification. dist_3.5-30.orig/mcon/mconfig.SH0000755000175000017500000001344511017237675016674 0ustar srivastasrivastacase $CONFIG in '') if test -f config.sh; then TOP=.; elif test -f ../config.sh; then TOP=..; elif test -f ../../config.sh; then TOP=../..; elif test -f ../../../config.sh; then TOP=../../..; elif test -f ../../../../config.sh; then TOP=../../../..; else echo "Can't find config.sh."; exit 1 fi . $TOP/config.sh ;; esac case "$0" in */*) cd `expr X$0 : 'X\(.*\)/'` ;; esac echo "Extracting mcon/mconfig (with variable substitutions)" cat >mconfig < # Key Contributor: Harlan Stenn # # $Log: mconfig.SH,v $ # Revision 3.0.1.5 1995/07/25 14:19:05 ram # patch56: new -G option # # Revision 3.0.1.4 1994/06/20 07:11:04 ram # patch30: new -L option to override public library path for testing # # Revision 3.0.1.3 1994/01/24 14:20:53 ram # patch16: added ~/.dist_profile awareness # # Revision 3.0.1.2 1993/10/16 13:53:10 ram # patch12: new -M option for magic symbols and confmagic.h production # # Revision 3.0.1.1 1993/08/19 06:42:26 ram # patch1: leading config.sh searching was not aborting properly # # Revision 3.0 1993/08/18 12:10:17 ram # Baseline for dist 3.0 netwide release. # # Perload ON \$MC = '$privlib'; \$version = '$VERSION'; \$patchlevel = '$PATCHLEVEL'; \$revision = '$REVISION'; \$grep = '$grep'; !GROK!THIS! $spitshell >>mconfig <<'!NO!SUBS!' chop($date = `date`); &profile; # Read ~/.dist_profile require 'getopts.pl'; &usage unless &Getopts("dhkmostvwGMVL:"); $MC = $opt_L if $opt_L; # May override public library path $MC = &tilda_expand($MC); # ~name expansion chop($WD = `pwd`); # Working directory chdir $MC || die "Can't chdir to $MC: $!\n"; chop($MC = `pwd`); # Real metaconfig lib path (no symbolic links) chdir $WD || die "Can't chdir back to $WD: $!\n"; ++$opt_k if $opt_d; ++$opt_M if -f 'confmagic.h'; # Force -M if confmagic.h already there if ($opt_V) { print STDERR "metaconfig $version-$revision\n"; exit 0; } elsif ($opt_h) { &usage; } unlink 'Wanted' unless $opt_w; # Wanted rebuilt if no -w unlink 'Obsolete' unless $opt_w; # Obsolete file rebuilt if no -w &readpackage; # Merely get the package's name &init; # Various initializations `mkdir .MT 2>&1` unless -d '.MT'; # For private temporary files &locate_units; # Fill in @ARGV with a unit list &extract_dependencies; # Extract dependencies from units &extract_filenames; # Extract files to be scanned for &build_wanted; # Build a list of wanted symbols in file Wanted &build_makefile; # To do the transitive closure of dependencies &solve_dependencies; # Now run the makefile to close dependency graph &create_configure; # Create the Configure script and related files &cosmetic_update; # Update the manifests if ($opt_k) { print "Leaving subdirectory .MT unremoved so you can peruse it.\n" unless $opt_s; } else { `rm -rf .MT 2>&1`; } print "Done.\n" unless $opt_s; # General initializations sub init { &init_except; # Token which have upper-cased letters &init_keep; # The keep status for built-in interpreter &init_priority; # Priorities for diadic operators &init_constants; # Define global constants &init_depend; # The %Depend array records control line handling } sub init_constants { $NEWMANI = 'MANIFEST.new'; # List of files to be scanned $MANI = 'MANIFEST'; # For manifake # The distinction between MANIFEST.new and MANIFEST can make sense # when the "pat" tools are used, but if only metaconfig is used, then # we can very well leave without a MANIFEST.new. --RAM, 2006-08-25 $NEWMANI = $MANI if -f $MANI && ! -f $NEWMANI; } # Record the exceptions -- almost all symbols but these are lower case # We also use three symbols from Unix.U for default file suffixes. sub init_except { $Except{'Author'}++; $Except{'Date'}++; $Except{'Header'}++; $Except{'Id'}++; $Except{'Locker'}++; $Except{'Log'}++; $Except{'RCSfile'}++; $Except{'Revision'}++; $Except{'Source'}++; $Except{'State'}++; $Except{'_a'}++; $Except{'_o'}++; $Except{'_exe'}++; } # Print out metaconfig's usage and exits sub usage { print STDERR <<'EOH'; Usage: metaconfig [-dhkmostvwGMV] [-L dir] -d : debug mode. -h : print this help message and exits. -k : keep temporary directory. -m : assume lots of memory and swap space. -o : maps obsolete symbols on new ones. -s : silent mode. -t : trace symbols as they are found. -v : verbose mode. -w : trust Wanted file as being up-to-date. -G : also provide a GNU configure-like front end. -L : specify main units repository. -M : activate production of confmagic.h. -V : print version number and exits. EOH exit 1; } !NO!SUBS! $grep -v '^;#' pl/locate.pl >>mconfig $grep -v '^;#' pl/common.pl >>mconfig $grep -v '^;#' pl/depend.pl >>mconfig $grep -v '^;#' pl/init.pl >>mconfig $grep -v '^;#' pl/extract.pl >>mconfig $grep -v '^;#' pl/files.pl >>mconfig $grep -v '^;#' pl/wanted.pl >>mconfig $grep -v '^;#' pl/obsolete.pl >>mconfig $grep -v '^;#' pl/makefile.pl >>mconfig $grep -v '^;#' pl/order.pl >>mconfig $grep -v '^;#' pl/configure.pl >>mconfig $grep -v '^;#' pl/cosmetic.pl >>mconfig $grep -v '^;#' pl/eval.pl >>mconfig $grep -v '^;#' ../pl/package.pl >>mconfig $grep -v '^;#' ../pl/manifake.pl >>mconfig $grep -v '^;#' ../pl/tilde.pl >>mconfig $grep -v '^;#' ../pl/profile.pl >>mconfig chmod +x mconfig $eunicefix mconfig dist_3.5-30.orig/mcon/Jmakefile0000644000175000017500000000434510473675126016626 0ustar srivastasrivasta/* * Jmakefile for metaconfig */ ;# $Id: Jmakefile 9 2006-08-25 22:31:50Z rmanfredi $ ;# ;# Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ;# ;# You may redistribute only under the terms of the Artistic Licence, ;# as specified in the README file that comes with the distribution. ;# You may reuse parts of this distribution only within the terms of ;# that same Artistic Licence; a copy of which may be found at the root ;# of the source tree for dist 4.0. ;# ;# $Log: Jmakefile,v $ ;# Revision 3.0.1.4 1995/07/25 13:23:09 ram ;# patch56: installs the GNU configure-like front-end to Configure ;# ;# Revision 3.0.1.3 1994/01/24 13:42:29 ram ;# patch16: added dependency generation stage ;# ;# Revision 3.0.1.2 1993/11/02 10:40:01 ram ;# patch14: now invokes perload explicitely via perl executable ;# ;# Revision 3.0.1.1 1993/08/25 08:46:44 ram ;# patch6: split unit installation to avoid shell command line overflow ;# ;# Revision 3.0 1993/08/18 12:04:40 ram ;# Baseline for dist 3.0 netwide release. ;# SetSubdirs(man) AllTarget(Glossary) Glossary: makegloss chmod +x makegloss ./makegloss SimpleShellScriptTarget(makegloss) MakeInstallDirectories($(PRIVLIB) $(PRIVLIB)/U) InstallNonExec(Glossary,$(PRIVLIB)) InstallScript(makegloss,$(PRIVLIB)) InstallScript(configure,$(PRIVLIB)) /* Split install list to avoid make overflow */ InstallMultipleFlags(U/[a-d]*.U,$(PRIVLIB)/U,-m 444) InstallMultipleFlags(U/[A-Ze-z]*.U,$(PRIVLIB)/U,-m 444) /* * Build up dataloading versions of metalint, metaconfig and metaxref. */ #define SimpleDataloadTarget(file,datafile) @!\ ++BIN datafile @!\ AllTarget(datafile file) @!\ SimpleShellScriptTarget(file) @!\ datafile: file @@\ perl $(TOP)/bin/perload -o file > $@ @@\ chmod +rx $@ @!\ @!\ InstallScript(datafile,$(SCRIPTDIR)) SimpleDataloadTarget(mconfig,metaconfig) SimpleDataloadTarget(mlint,metalint) SimpleDataloadTarget(mxref,metaxref) BINFILES = \ |expand f!$(BIN)! !f:^meta=m \ -expand \\ BINSH = \ |expand f!$(BINFILES)! !f.SH \ -expand \\ depend:: ($(SED) '/^# DO NOT DELETE/q' Makefile && \ grep '^\$$grep' $(BINSH) | \ $(SED) -e "s/^.*' \([^ ]*\) >>\([^ ]*\)/\2: \1/" \ ) > Makefile.new cp Makefile Makefile.bak cp Makefile.new Makefile $(RM) Makefile.new dist_3.5-30.orig/mcon/makegloss.SH0000755000175000017500000001406211017210567017222 0ustar srivastasrivastacase $CONFIG in '') if test -f config.sh; then TOP=.; elif test -f ../config.sh; then TOP=..; elif test -f ../../config.sh; then TOP=../..; elif test -f ../../../config.sh; then TOP=../../..; elif test -f ../../../../config.sh; then TOP=../../../..; else echo "Can't find config.sh."; exit 1 fi . $TOP/config.sh ;; esac case "$0" in */*) cd `expr X$0 : 'X\(.*\)/'` ;; esac echo "Extracting mcon/makegloss (with variable substitutions)" $spitshell >makegloss <>makegloss <<'!NO!SUBS!' # $Id: makegloss.SH 22 2008-05-28 08:01:59Z rmanfredi $ # # Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi # # You may redistribute only under the terms of the Artistic Licence, # as specified in the README file that comes with the distribution. # You may reuse parts of this distribution only within the terms of # that same Artistic Licence; a copy of which may be found at the root # of the source tree for dist 4.0. # # Original Author: Larry Wall # # $Log: makegloss.SH,v $ # Revision 3.0.1.3 1994/01/24 14:17:49 ram # patch16: now understands internal-use only defined variables # # Revision 3.0.1.2 1993/10/16 13:50:39 ram # patch12: updated to support new ?M: lines # # Revision 3.0.1.1 1993/08/19 06:42:21 ram # patch1: leading config.sh searching was not aborting properly # # Revision 3.0 1993/08/18 12:10:12 ram # Baseline for dist 3.0 netwide release. # open(G,">Glossary") || die "Can't create Glossary.\n"; print G '[This Glossary is automatically generated from the Unit files. Do not edit this file or your changes will be lost. Edit the appropriate Unit instead.] This file contains a listing of all the C preprocessor symbols and shell variables whose value can be determined by a Configure script. For the most part, any symbol in UPPERCASE is a C preprocessor symbol, and will be defined in config.h. Symbols in lowercase are shell variables, and are defined in config.sh. If you write your shell scripts and C programs in terms of these symbols, metaconfig can automatically build you a Configure script that will determine the value of those symbols. See the README file for a description of how to use metaconfig. In the following listing, the Unit: line indicates the name of the unit where this symbol is defined, and the Wants: line indicates what other symbols must be determined in order to figure out the value of this one. If there is an "(Also defines ...)" entry, it indicates what other symbols are defined by the Unit other than the one corresponding to the unit name. Variable of the form d_* either have the value "define" or "/*define", and control whether some C preprocessor symbol gets defined or not. '; @ARGV = ; while (<>) { if (/^\?[\w\-]+:/) { # We may have found a control line # Long lines may be escaped with a final backslash $_ .= &complete_line if s/\\\s*$//; } if (/^\?MAKE:.*:/) { ($also, $wants) = /^\?MAKE:\s*(.*):\s*(.*)/; ($unit = $ARGV) =~ s|.*/(.*)\.U$|$1|; @Also = split(/ /, $also); $also = ''; $internal = ''; foreach (@Also) { if (s/^\+//) { $internal .= "$_ "; } else { $also .= "$_ "; } } $also =~ s/$unit\s//; chop($also); chop($internal); @Wants = split(/ /, $wants); $wants = ''; $option = ''; foreach (@Wants) { if (s/^\+//) { $option .= "$_ "; } else { $wants .= "$_ "; } } chop($option); chop($wants); $head = ''; $_ = "Unit: $unit"; $_ .= " (Also defines $also)" if $also; $_ .= " (With private $internal)" if $internal; $head .= &format($_); if ($wants) { $_ = "Wants: $wants"; $head .= &format($_); } if ($option) { $_ = "Optional: $option"; $head .= &format($_); } $head .= "\n"; } # Example of expression matched by the following pattern: # ?C:symbol ~ alias (obsolete list): # The main symbol (optionally aliased) can be followed by a list of # obsolete symbols (the list is space separated). if (/^\?[CS]:(\w+)(\s*~\s*\S+)?\s*(\(.*\))?:\s*$/) { $sym = $1; $obsoleted = $3; push(@syms, $sym); $header{$sym} .= $head; if ($obsoleted =~ s/^\((.*)\)$/$1/) { @obsoleted = split(' ', $obsoleted); foreach $obs (@obsoleted) { push(@syms, $obs); $header{$obs} = "\tObsoleted by $sym.\n\n"; } } } elsif (s/^\?[CS]://) { # Must be inside definition if (/^\.$/) { # Closing line $def{$sym} .= "\n"; $sym = ''; } else { s/^(\t| ? ? ? ? ? ? ?)//; $def{$sym} .= "\t" . $_; } } elsif (/^\?M:(\w+):\s*([\w\s]*)\n$/) { # Magic mapping introduction $sym = $1; $cdep = $2; push(@syms, $sym); $cdep =~ s/^\s*//; $cdep = ", needs: $cdep" if $cdep ne ''; $header{$sym} = "\tMagic symbol$cdep\n" . $head; } elsif (s/^\?M://) { # Must be a magic mapping definition if (/^\.$/) { # Closing line $def{$sym} .= "\n"; $sym = ''; } else { $def{$sym} .= "\t" . $_; } } } foreach $sym (sort @syms) { print G "$sym:\n"; print G $header{$sym}; print G $def{$sym}; } close G; # Format $_ to fit in 80 columns (70 + size of tabs) # Long lines are split, and the all but the first are indented # by two leading spaces. The whole thing is then indented by # one tab. sub format { local($tmp); local($head) = ''; local($_) = shift(@_); while (length($_) > 70) { $tmp = substr($_,0,70); $tmp =~ s/^(.*) .*/$1/; $head .= "\t$tmp\n"; $_ = ' ' . substr($_,length($tmp),9999); } $head .= "\t$_\n"; } # The first line was escaped with a final \ character. Every following line # is to be appended to it (until we found a real \n not escaped). Note that # the leading spaces of the continuation line are removed, so any space should # be added before the former \ if needed. sub complete_line { local($_); local($read) = ''; # Concatenation of all the continuation lines found while (<>) { s/^\s+//; # Remove leading spaces if (s/\\\s*$//) { # Still followed by a continuation line $read .= $_; } else { # We've reached the end of the continuation return $read . $_; } } } !NO!SUBS! chmod 755 makegloss $eunicefix makegloss dist_3.5-30.orig/mcon/files/0002755000175000017500000000000011272612640016100 5ustar srivastasrivastadist_3.5-30.orig/mcon/files/shell.U0000644000175000017500000000366610473316164017352 0ustar srivastasrivasta?RCS: $Id: shell.U 1 2006-08-24 12:32:52Z rmanfredi $ ?RCS: ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ?RCS: ?RCS: You may redistribute only under the terms of the Artistic Licence, ?RCS: as specified in the README file that comes with the distribution. ?RCS: You may reuse parts of this distribution only within the terms of ?RCS: that same Artistic Licence; a copy of which may be found at the root ?RCS: of the source tree for dist 4.0. ?RCS: ?RCS: $Log: shell.U,v $ ?RCS: Revision 3.0 1993/08/18 12:10:10 ram ?RCS: Baseline for dist 3.0 netwide release. ?RCS: ?MAKE:cc: cat contains sysman +large Mcc Myread Guess Oldconfig Loc ?MAKE: -pick add $@ %< ?DEF:cc=cc ?S:cc: ?S: This variable holds the name of a command to execute a C compiler which ?S: can resolve multiple global references that happen to have the same ?S: name. Usual values are "cc", "Mcc", "cc -M", and "gcc". ?S:. : see if we need a special compiler echo " " if usg; then case "$cc" in '') case "$Mcc" in /*) dflt='Mcc';; *) case "$large" in -M*) dflt='cc';; *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then dflt='cc' else dflt='cc -M' fi else dflt='cc' fi;; esac;; esac;; *) dflt="$cc";; esac $cat <<'EOM' On some systems the default C compiler will not resolve multiple global references that happen to have the same name. On some such systems the "Mcc" command may be used to force these to be resolved. On other systems a "cc -M" command is required. (Note that the -M flag on other systems indicates a memory model to use!) If you have the Gnu C compiler, you might wish to use that instead. EOM rp="What command will force resolution on this system?" . myread cc="$ans" else case "$cc" in '') dflt=cc;; *) dflt="$cc";; esac rp="Use which C compiler?" . myread cc="$ans" fi case "$cc" in gcc*) cpp=`loc gcc-cpp $cpp $pth`;; esac dist_3.5-30.orig/mcon/files/type.U0000644000175000017500000000274210473316164017216 0ustar srivastasrivasta?RCS: $Id: type.U 1 2006-08-24 12:32:52Z rmanfredi $ ?RCS: ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ?RCS: ?RCS: You may redistribute only under the terms of the Artistic Licence, ?RCS: as specified in the README file that comes with the distribution. ?RCS: You may reuse parts of this distribution only within the terms of ?RCS: that same Artistic Licence; a copy of which may be found at the root ?RCS: of the source tree for dist 4.0. ?RCS: ?RCS: $Log: type.U,v $ ?RCS: Revision 3.0 1993/08/18 12:10:11 ram ?RCS: Baseline for dist 3.0 netwide release. ?RCS: ?MAKE:uidtype: Myread Oldconfig contains usrinc ?MAKE: -pick add $@ %< ?S:uidtype: ?S: This variable defines UIDTYPE to be something like uid_t, int, ?S: ushort, or whatever type is used to declare user ids in the kernel. ?S:. ?C:Uid_t (UIDTYPE): ?C: This symbol holds the type used to declare user ids in the kernel. ?C: It can be int, ushort, uid_t, etc... It may be necessary to include ?C: to get any typedef'ed information. ?C:. ?H:#define Uid_t $uidtype /* UID type */ ?H:. : see what type uids are declared as in the kernel case "$uidtype" in '') if $contains 'uid_t;' $usrinc/sys/types.h >/dev/null 2>&1 ; then dflt='uid_t'; else set `grep '_ruid;' $usrinc/sys/user.h 2>/dev/null` unsigned short case $1 in unsigned) dflt="$1 $2" ;; *) dflt="$1" ;; esac fi ;; *) dflt="$uidtype";; esac echo " " rp="What type are user ids on this system declared as?" . myread uidtype="$ans" dist_3.5-30.orig/mcon/files/Internal.U0000644000175000017500000000126110473316164020004 0ustar srivastasrivasta?RCS: $Id: Internal.U 1 2006-08-24 12:32:52Z rmanfredi $ ?RCS: ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ?RCS: ?RCS: You may redistribute only under the terms of the Artistic Licence, ?RCS: as specified in the README file that comes with the distribution. ?RCS: You may reuse parts of this distribution only within the terms of ?RCS: that same Artistic Licence; a copy of which may be found at the root ?RCS: of the source tree for dist 4.0. ?RCS: ?RCS: $Log: Internal.U,v $ ?RCS: Revision 3.0 1993/08/18 12:10:04 ram ?RCS: Baseline for dist 3.0 netwide release. ?RCS: ?X: ?X: This unit does this and that. ?X: ?MAKE:<^INTERNAL>: Myinit ?MAKE: -pick add $@ %< dist_3.5-30.orig/mcon/files/file.U0000644000175000017500000000256410473316164017156 0ustar srivastasrivasta?RCS: $Id: file.U 1 2006-08-24 12:32:52Z rmanfredi $ ?RCS: ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ?RCS: ?RCS: You may redistribute only under the terms of the Artistic Licence, ?RCS: as specified in the README file that comes with the distribution. ?RCS: You may reuse parts of this distribution only within the terms of ?RCS: that same Artistic Licence; a copy of which may be found at the root ?RCS: of the source tree for dist 4.0. ?RCS: ?RCS: $Log: file.U,v $ ?RCS: Revision 3.0 1993/08/18 12:10:06 ram ?RCS: Baseline for dist 3.0 netwide release. ?RCS: ?MAKE: exp: Oldconfig Getfile ?MAKE: -pick add $@ %< ?S:: ?S: The name of the file. The name may have ~ on the front. ?S:. ?S:exp: ?S: This is the same as the variable, but is filename expanded ?S: so that later Configure units can look at the file if desired. ?S:. ?C:<%FILE>: ?C: The name of the file. The name may have ~ on the front so the ?C: program must be prepared to do filename expansion. ?C:. ?C:<%FILE>_EXP: ?C: The same as but ~name expansion has been done by Configure. ?C:. ?H:#define <%FILE> "$" /**/ ?H:#define <%FILE>_EXP "$exp" /**/ ?H:. : locate file echo " " case "$" in '') dflt= ;; *) dflt="$";; esac fn=f~ rp='Where is the file?' . getfile ="$ans" exp="$ansexp" dist_3.5-30.orig/mcon/files/d_function.U0000644000175000017500000000177710473316164020374 0ustar srivastasrivasta?RCS: $Id: d_function.U 1 2006-08-24 12:32:52Z rmanfredi $ ?RCS: ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ?RCS: ?RCS: You may redistribute only under the terms of the Artistic Licence, ?RCS: as specified in the README file that comes with the distribution. ?RCS: You may reuse parts of this distribution only within the terms of ?RCS: that same Artistic Licence; a copy of which may be found at the root ?RCS: of the source tree for dist 4.0. ?RCS: ?RCS: $Log: d_function.U,v $ ?RCS: Revision 3.0 1993/08/18 12:10:05 ram ?RCS: Baseline for dist 3.0 netwide release. ?RCS: ?MAKE:d_: Inlibc ?MAKE: -pick add $@ %< ?S:d_: ?S: This variable conditionally defines HAS_<%FUNCTION> if () is ?S: available to ... ?S:. ?C:HAS_<%FUNCTION>: ?C: This symbol, if defined, indicates that the () routine is ?C: available to ... ?C:. ?H:#$d_ HAS_<%FUNCTION> /**/ ?H:. ?LINT:set d_ : see if exists set d_ eval $inlibc dist_3.5-30.orig/mcon/files/question.U0000644000175000017500000000351310473316164020101 0ustar srivastasrivasta?RCS: $Id: question.U 1 2006-08-24 12:32:52Z rmanfredi $ ?RCS: ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ?RCS: ?RCS: You may redistribute only under the terms of the Artistic Licence, ?RCS: as specified in the README file that comes with the distribution. ?RCS: You may reuse parts of this distribution only within the terms of ?RCS: that same Artistic Licence; a copy of which may be found at the root ?RCS: of the source tree for dist 4.0. ?RCS: ?RCS: $Log: question.U,v $ ?RCS: Revision 3.0 1993/08/18 12:10:09 ram ?RCS: Baseline for dist 3.0 netwide release. ?RCS: ?MAKE:d_scorfl: cat Myread Oldconfig nametype Setvar ?MAKE: -pick add $@ %< ?S:d_scorfl: ?S: This variable conditionally defines the SCOREFULL symbol, which ?S: indicates to the C program that any scoreboard kept by the program ?S: should be kept on the basis of the user's full name as opposed to ?S: the user's login name. ?S:. ?C:SCOREFULL: ?C: This symbol, if defined, indicates that any scoreboard kept by the ?C: program should be kept on the basis of the user's full name as opposed ?C: to the user's login name. If the user can change his full name he ?C: can enter multiple scores if this is defined. ?C:. ?H:#$d_scorfl SCOREFULL /**/ ?H:. ?LINT:set d_scorfl : see how they want the scoreboard kept case "$d_scorfl" in "$define") dflt=y ;; *) dflt=n ;; esac case "$nametype" in other) val="$undef" ;; *) $cat <<'EOM' The scoreboard can be kept with one score per login name, or one score per full name. If users can change their full name, or if there is more than one person on your system with the same full name, you should keep the score by login name (the full name is still printed). EOM rp='Do you want the scoreboard kept by full name?' . myread case "$ans" in y*) val="$define" ;; *) val="$undef" ;; esac ;; esac set d_scorfl eval $setvar dist_3.5-30.orig/mcon/files/rcshead.U0000644000175000017500000000112410473316164017637 0ustar srivastasrivasta?RCS: $Id: rcshead.U 1 2006-08-24 12:32:52Z rmanfredi $ ?RCS: ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ?RCS: ?RCS: You may redistribute only under the terms of the Artistic Licence, ?RCS: as specified in the README file that comes with the distribution. ?RCS: You may reuse parts of this distribution only within the terms of ?RCS: that same Artistic Licence; a copy of which may be found at the root ?RCS: of the source tree for dist 4.0. ?RCS: ?RCS: $Log: rcshead.U,v $ ?RCS: Revision 3.0 1993/08/18 12:10:10 ram ?RCS: Baseline for dist 3.0 netwide release. ?RCS: dist_3.5-30.orig/mcon/files/i_include.U0000644000175000017500000000207110473316164020163 0ustar srivastasrivasta?RCS: $Id: i_include.U 1 2006-08-24 12:32:52Z rmanfredi $ ?RCS: ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ?RCS: ?RCS: You may redistribute only under the terms of the Artistic Licence, ?RCS: as specified in the README file that comes with the distribution. ?RCS: You may reuse parts of this distribution only within the terms of ?RCS: that same Artistic Licence; a copy of which may be found at the root ?RCS: of the source tree for dist 4.0. ?RCS: ?RCS: $Log: i_include.U,v $ ?RCS: Revision 3.0 1993/08/18 12:10:07 ram ?RCS: Baseline for dist 3.0 netwide release. ?RCS: ?MAKE:i_: Inhdr ?MAKE: -pick add $@ %< ?S:i_: ?S: This variable conditionally defines the I_<%INCLUDE> symbol, which ?S: indicates to the C program that <.h> exists and should ?S: be included. ?S:. ?C:I_<%INCLUDE>: ?C: This symbol, if defined, indicates that <.h> exists and should ?C: be included. ?C:. ?H:#$i_ I_<%INCLUDE> /**/ ?H:. ?LINT:set i_ : see if .h is available set .h i_ eval $inhdr dist_3.5-30.orig/mcon/files/dir.U0000644000175000017500000000257410473316164017016 0ustar srivastasrivasta?RCS: $Id: dir.U 1 2006-08-24 12:32:52Z rmanfredi $ ?RCS: ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ?RCS: ?RCS: You may redistribute only under the terms of the Artistic Licence, ?RCS: as specified in the README file that comes with the distribution. ?RCS: You may reuse parts of this distribution only within the terms of ?RCS: that same Artistic Licence; a copy of which may be found at the root ?RCS: of the source tree for dist 4.0. ?RCS: ?RCS: $Log: dir.U,v $ ?RCS: Revision 3.0 1993/08/18 12:10:06 ram ?RCS: Baseline for dist 3.0 netwide release. ?RCS: ?MAKE: exp: Oldconfig Getfile ?MAKE: -pick add $@ %< ?S:: ?S: Where files are located. The name may have ~ on the front. ?S:. ?S:exp: ?S: This is the same as the variable, but is filename expanded ?S: so that later Configure units can look at the directory if desired. ?S:. ?C:<%DIR>: ?C: The directory where files are located. The name may have ~ on ?C: the front so the C program must be prepared to do ~ expansion. ?C:. ?C:<%DIR>_EXP: ?C: The same as , but ~name expantion has been done by Configure. ?C:. ?H:#define <%DIR> "$" /**/ ?H:#define <%DIR>_EXP "$exp" /**/ ?H:. : locate directory echo " " case "$" in '') dflt= ;; *) dflt="$";; esac fn=d~ rp='Where is the directory?' . getfile ="$ans" exp="$ansexp" dist_3.5-30.orig/mcon/files/README0000644000175000017500000000027510473316164016766 0ustar srivastasrivastaThis directory contains unit templates. It is hoped metaconfig will have a tool to generate "standard" units based on some well-known templates. For now, it has a documentary-only value. dist_3.5-30.orig/mcon/files/keyword.U0000644000175000017500000000302010473316164017707 0ustar srivastasrivasta?RCS: $Id: keyword.U 1 2006-08-24 12:32:52Z rmanfredi $ ?RCS: ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ?RCS: ?RCS: You may redistribute only under the terms of the Artistic Licence, ?RCS: as specified in the README file that comes with the distribution. ?RCS: You may reuse parts of this distribution only within the terms of ?RCS: that same Artistic Licence; a copy of which may be found at the root ?RCS: of the source tree for dist 4.0. ?RCS: ?RCS: $Log: keyword.U,v $ ?RCS: Revision 3.0 1993/08/18 12:10:08 ram ?RCS: Baseline for dist 3.0 netwide release. ?RCS: ?MAKE:d_const: cat cc ccflags Setvar ?MAKE: -pick add $@ %< ?S:d_: ?S: This variable conditionally defines the HASCONST symbol, which ?S: indicates to the C program that this C compiler knows about the ?S: type. ?S:. ?C:HAS<%KEY> ~ %<: ?C: This symbol, if defined, indicates that this C compiler knows about ?C: the type. There is no need to actually test for that symbol ?C: within your programs. The mere use of the "" keyword will ?C: trigger the necessary tests. ?C:. ?H:?%<:#$d_ HAS<%KEY> /**/ ?H:?%<:#ifndef HAS<%KEY> ?H:?%<:#define ?H:?%<:#endif ?H:. ?W:%<: ?LINT:set d_ ?LINT:known : check for keyword echo " " echo 'Checking to see if your C compiler knows about ""...' $cat >.c <<'EOCP' main() { char *foo; } EOCP if $cc -c $ccflags .c >/dev/null 2>&1 ; then val="$define" echo "Yup, it does." else val="$undef" echo "Nope, it doesn't." fi set d_ eval $setvar dist_3.5-30.orig/mcon/files/locate.U0000644000175000017500000000257710473316164017512 0ustar srivastasrivasta?RCS: $Id: locate.U 1 2006-08-24 12:32:52Z rmanfredi $ ?RCS: ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ?RCS: ?RCS: You may redistribute only under the terms of the Artistic Licence, ?RCS: as specified in the README file that comes with the distribution. ?RCS: You may reuse parts of this distribution only within the terms of ?RCS: that same Artistic Licence; a copy of which may be found at the root ?RCS: of the source tree for dist 4.0. ?RCS: ?RCS: $Log: locate.U,v $ ?RCS: Revision 3.0 1993/08/18 12:10:08 ram ?RCS: Baseline for dist 3.0 netwide release. ?RCS: ?MAKE: exp: Oldconfig Getfile ?MAKE: -pick add $@ %< ?S:: ?S: The name of the file. The name may have ~ on the front. ?S:. ?S:exp: ?S: This is the same as the variable, but is filename expanded ?S: so that later Configure units can look at the file if desired. ?S:. ?C:<%FILE>: ?C: The name of the file. The name may have ~ on the front so the ?C: program must be prepared to do filename expansion. ?C:. ?C:<%FILE>_EXP: ?C: The same as but ~name expansion has been done by Configure. ?C:. ?H:#define <%FILE> "$" /**/ ?H:#define <%FILE>_EXP "$exp" /**/ ?H:. : locate file echo " " case "$" in '') dflt= ;; *) dflt="$";; esac fn=l~: rp='Where is the file?' . getfile ="$ans" exp="$ansexp" dist_3.5-30.orig/mcon/mlint.SH0000755000175000017500000000722211017237675016371 0ustar srivastasrivastacase $CONFIG in '') if test -f config.sh; then TOP=.; elif test -f ../config.sh; then TOP=..; elif test -f ../../config.sh; then TOP=../..; elif test -f ../../../config.sh; then TOP=../../..; elif test -f ../../../../config.sh; then TOP=../../../..; else echo "Can't find config.sh."; exit 1 fi . $TOP/config.sh ;; esac case "$0" in */*) cd `expr X$0 : 'X\(.*\)/'` ;; esac echo "Extracting mcon/mlint (with variable substitutions)" cat >mlint < # # $Log: mlint.SH,v $ # Revision 3.0.1.3 1994/05/06 15:20:42 ram # patch23: added -L switch to override public unit repository path # # Revision 3.0.1.2 1994/01/24 14:21:00 ram # patch16: added ~/.dist_profile awareness # # Revision 3.0.1.1 1993/08/19 06:42:27 ram # patch1: leading config.sh searching was not aborting properly # # Revision 3.0 1993/08/18 12:10:17 ram # Baseline for dist 3.0 netwide release. # # Perload ON \$MC = '$privlib'; \$version = '$VERSION'; \$patchlevel = '$PATCHLEVEL'; \$revision = '$REVISION'; \$grep = '$grep'; !GROK!THIS! $spitshell >>mlint <<'!NO!SUBS!' &profile; # Read ~/.dist_profile require 'getopts.pl'; &usage unless &Getopts("hklVL:"); if ($opt_V) { print STDERR "metalint $version-$revision\n"; exit 0; } elsif ($opt_h) { &usage; } chop($date = `date`); $MC = $opt_L if $opt_L; # May override library path $MC = &tilda_expand($MC); # ~name expansion chop($WD = `pwd`); # Working directory chdir $MC || die "Can't chdir to $MC: $!\n"; chop($MC = `pwd`); # Real metalint lib path (no symbolic links) chdir $WD || die "Can't chdir back to $WD: $!\n"; &init; # Various initializations `mkdir .MT 2>&1` unless -d '.MT'; # For private temporary files &locate_units; # Fill in @ARGV with a unit list &extract_dependencies; # Extract dependencies from units &sanity_checks; # Perform sanity checks if ($opt_k) { print "Leaving subdirectory .MT unremoved so you can peruse it.\n" unless $opt_s; } else { `rm -rf .MT 2>&1`; } print "Done.\n" unless $opt_s; # General initializations sub init { &init_except; # Token which have upper-cased letters &init_depend; # The %Depend array records control line handling } # Record the exceptions -- all symbols but these are lower case sub init_except { $Except{'Author'}++; $Except{'Date'}++; $Except{'Header'}++; $Except{'Id'}++; $Except{'Locker'}++; $Except{'Log'}++; $Except{'RCSfile'}++; $Except{'Revision'}++; $Except{'Source'}++; $Except{'State'}++; } # Print out metalint's usage and exits sub usage { print STDERR <>mlint $grep -v '^;#' pl/lint.pl >>mlint $grep -v '^;#' pl/init.pl >>mlint $grep -v '^;#' pl/extract.pl >>mlint $grep -v '^;#' pl/obsolete.pl >>mlint $grep -v '^;#' pl/tsort.pl >>mlint $grep -v '^;#' ../pl/tilde.pl >>mlint $grep -v '^;#' ../pl/profile.pl >>mlint chmod +x mlint $eunicefix mlint dist_3.5-30.orig/mcon/pl/0002755000175000017500000000000011272612640015411 5ustar srivastasrivastadist_3.5-30.orig/mcon/pl/lint.pl0000644000175000017500000014147611017237675016737 0ustar srivastasrivasta;# $Id: lint.pl 25 2008-05-28 11:19:25Z rmanfredi $ ;# ;# Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ;# ;# You may redistribute only under the terms of the Artistic Licence, ;# as specified in the README file that comes with the distribution. ;# You may reuse parts of this distribution only within the terms of ;# that same Artistic Licence; a copy of which may be found at the root ;# of the source tree for dist 4.0. ;# ;# $Log: lint.pl,v $ ;# Revision 3.0.1.10 1997/02/28 16:31:53 ram ;# patch61: added support for ?F: lines to monitor file usage ;# patch61: now honours "create" and "empty" lint directives ;# ;# Revision 3.0.1.9 1995/09/25 09:19:15 ram ;# patch59: new ?Y: directive to change unit layout ;# ;# Revision 3.0.1.8 1995/07/25 14:19:47 ram ;# patch56: will now check : comments line for potential danger ;# ;# Revision 3.0.1.7 1994/10/29 16:36:14 ram ;# patch36: now extensively checks created files thanks to new ?F: lines ;# ;# Revision 3.0.1.6 1994/05/13 15:29:09 ram ;# patch27: now understands macro definitions in ?H: lines ;# ;# Revision 3.0.1.5 1994/05/06 15:27:48 ram ;# patch23: now warns for units ending with non-blank line ;# patch23: warn for units where last line is not new-line terminated ;# ;# Revision 3.0.1.4 1994/01/24 14:28:40 ram ;# patch16: now knows about "internal use only" variables on ?MAKE: lines ;# patch16: now suppress "read-only var set" message when change hint ;# ;# Revision 3.0.1.3 1993/11/10 17:39:39 ram ;# patch14: now spots stale ?M: dependencies ;# ;# Revision 3.0.1.2 1993/10/16 13:55:26 ram ;# patch12: now checks ?M: lines also ;# ;# Revision 3.0.1.1 1993/08/25 14:03:40 ram ;# patch6: now correctly signals conditional dependencies with no default ;# ;# Revision 3.0 1993/08/18 12:10:25 ram ;# Baseline for dist 3.0 netwide release. ;# ;# The list of all available units is held in @ARGV. We shall parse them and ;# extract the dependencies. A lot of global data structures are filled in ;# during this phase. ;# # Initialize the extraction process by setting some variables. # We return a string to be eval'ed to do more customized initializations. sub init_extraction { $c_symbol = ''; # Current symbol seen in ?C: lines $s_symbol = ''; # Current symbol seen in ?S: lines $m_symbol = ''; # Current symbol seen in ?M: lines $h_section = 0; # 0 = no ?H: yet, 1 = in ?H:, 2 = ?H:. seen $h_section_warned = 0; # Whether we warned about terminated ?H: section $heredoc = ''; # Last "here" document symbol seen $heredoc_nosubst = 0; # True for <<'EOM' here docs $heredoc_line = 0; # Line were last "here" document started $last_interpreted = 0; # True when last line was an '@' one $past_first_line = 0; # True when first body line was already seen $wiped_unit = 0; # True if unit will be "wiped" for macro subst %csym = (); # C symbols described %ssym = (); # Shell symbols described %hcsym = (); # C symbols used by ?H: lines %hssym = (); # Shell symbols used by ?H: lines %msym = (); # Magic symbols defined by ?M: lines %mdep = (); # C symbol dependencies introduced by ?M: %symset = (); # Records all the shell symbol set %symused = (); # Records all the shell symbol used %tempseen = (); # Temporary shell variable seen %fileseen = (); # Produced files seen %fileused = (); # Files used, by unit (private UU files) %filemisused = (); # Files not used as ./file or ...UU/file %filetmp = (); # Local temporary files in ?F: directives %filesetin = (); # Lists units defining a temporary file %filecreated = (); # Records files created in this unit %prodfile = (); # Unit where a given file is said to be created %defseen = (); # Symbol defintions claimed %lintset = (); # Symbols declared set by a ?LINT: line %lintsdesc = (); # Symbols declared described by a ?LINT: line %lintcdesc = (); # Symbols declared described by a ?LINT: line %lintseen = (); # Symbols declared known by a ?LINT: line %lintchange = (); # Symbols declared changed by a ?LINT: line %lintuse = (); # Symbols declared used by unit %lintextern = (); # Symbols known to be externally defined %lintcreated = (); # Files declared as created by a ?LINT: line %linthere = (); # Unclosed here document from ?LINT: line %lintnothere = (); # False here document names, from ?LINT: line %lintfused = (); # Records files markedas used in ?LINT: line %lintchange_used = (); # Tracks symbols for which %lintchange was used %lintuse_used = (); # Tracks symbols for which %lintuse was used %lintseen_used = (); # Tracks symbols for which %lintseen was used %lintcdesc_used = (); # Tracks symbols for which %lintcdesc was used %lintsdesc_used = (); # Tracks symbols for which %lintsdesc was used %lintset_used = (); # Tracks symbols for which %lintset was used %lintnocomment = (); # Signals it's OK for unit to lack a : comment %condsym = (); # Records all the conditional symbols %condseen = (); # Records conditional dependencies %depseen = (); # Records full dependencies %shvisible = (); # Records units making a symbol visible %shspecial = (); # Records special units listed as wanted %shdepend = (); # Records units listed in one's dependency list %shmaster = (); # List of units defining a shell symbol %cmaster = (); # List of units defining a C symbol %symdep = (); # Records units where symbol is a dependency @make = (); # Records make dependency lines $body = 'p_body'; # Procedure to handle body $ending = 'p_end'; # Called at the end of each unit @wiping = qw( # The keywords we recognize for "wiped" units PACKAGENAME MAINTLOC VERSION PATCHLEVEL REVISION DATE BASEREV ); } # End the extraction process sub end_extraction { } # Process the ?MAKE: line sub p_make { local($_) = @_; local(@ary); # Locally defined symbols local(@dep); # Dependencies local($where) = "\"$file\", line $. (?MAKE:)"; unless (/^[\w+ ]*:/) { $wiped_unit++ if /^\t+-pick\s+wipe\b/; return; # We only want the main dependency rule } warn "$where: ignoring duplicate dependency listing line.\n" if $makeseen{$unit}++; return if $makeseen{$unit} > 1; # Reset those once for every unit # (assuming there is only one depend line) $h_section = 0; # 0 = no ?H: yet, 1 = in ?H:, 2 = ?H:. seen $h_section_warned = 0; # Whether we warned about terminated ?H: section $wiped_unit = 0; # Whether macros like " will be wiped undef %condseen; undef %depseen; undef %defseen; undef %tempseen; undef %symset; undef %symused; undef %csym; undef %ssym; undef %hcsym; undef %hssym; undef %lintuse; undef %lintuse_used; undef %lintseen; undef %lintchange; undef %lintchange_used; undef %lintextern; undef %lintcreated; undef %fileseen; undef %lintseen_used; undef %filetmp; undef %filecreated; undef %linthere; undef %lintnothere; undef %lintfused; undef %lintsdesc; undef %lintsdesc_used; undef %lintcdesc; undef %lintcdesc_used; undef %lintset; undef %lintset_used; s|^\s*||; # Remove leading spaces chop; s/:(.*)//; @dep = split(' ', $1); # Dependencies @ary = split(' '); # Locally defined symbols local($nowarn); # True when +Special is seen foreach $sym (@ary) { # Ignore "internal use only" symbols as far as metalint goes. # Actually, we record the presence of a '+' in front of a special # unit name and use that as a hint to suppress the presence of that # special unit in the defined symbol section. $nowarn = ($sym =~ s/^\+//); # We record for each shell symbol the list of units which claim to make # it, so as to report duplicates. if ($sym =~ /^[_a-z]/ || $Except{$sym}) { $shmaster{"\$$sym"} .= "$unit "; ++$defseen{$sym}; } else { warn "$where: special unit '$sym' should not be listed as made.\n" unless $sym eq $unit || $nowarn; } } # Record dependencies for later perusal push(@make, join(' ', @ary) . ':' . join(' ', @dep)); foreach $sym (@dep) { if ($sym =~ /^\+[_A-Za-z]/) { $sym =~ s|^\+||; ++$condseen{$sym}; # Conditional symbol wanted ++$condsym{$sym}; # %condsym has a greater lifetime } else { ++$depseen{$sym}; # Full dependency } # Each 'wanted' special unit (i.e. one starting with a capital letter) # is remembered, so as to prevent exported symbols from being reported # as "undefined". For instance, Myread exports $dflt, $ans and $rp. $shspecial{$unit} .= "$sym " if substr($sym, 0, 1) =~ /^[A-Z]/; # Record all known dependencies (special or not) for this unit $shdepend{$unit} .= "$sym "; # Remember where wanted symbol is defined, so that we can report # stale dependencies later on (i.e. dependencies which refer to non- # existent symbols). $symdep{$sym} .= "$unit "; # This symbol is wanted here } # Make sure we do not want a symbol twice, nor do we want it once as a full # dependency and once as a conditional dependency. foreach $sym (@dep) { if ($sym =~ /^\+[_A-Za-z]/) { $sym =~ s|^\+||; warn "$where: '+$sym' is listed $condseen{$sym} times.\n" if $condseen{$sym} > 1; $condseen{$sym} = 1 if $condseen{$sym}; # Avoid multiple messages } else { warn "$where: '$sym' is listed $depseen{$sym} times.\n" if $depseen{$sym} > 1; $depseen{$sym} = 1 if $depseen{$sym}; # Avoid multiple messages } warn "$where: '$sym' listed as both conditional and full dependency.\n" if $condseen{$sym} && $depseen{$sym}; } # Make sure every unit "inherits" from the symbols exported by 'Init'. $shspecial{$unit} .= 'Init ' unless $shspecial{$unit} =~ /Init\b/; } # Process the ?O: line sub p_obsolete { local($_) = @_; chop; $Obsolete{"$unit.U"} = $_; # Message to print if unit is used } # Process the ?S: lines sub p_shell { local($_) = @_; local($where) = "\"$file\", line $. (?S:)"; warn "$where: directive should come after ?MAKE declarations.\n" unless $makeseen{$unit}; if (/^(\w+)\s*(\(.*\))*\s*:/) { &check_last_declaration; $s_symbol = $1; print " ?S: $s_symbol\n" if $opt_d; # Make sure we do not define symbol twice and that the symbol is indeed # listed in the ?MAKE: line. warn "$where: duplicate description for variable '\$$s_symbol'.\n" if $ssym{$s_symbol}++; unless ($defseen{$s_symbol}) { warn "$where: variable '\$$s_symbol' is not listed " . "on ?MAKE: line.\n" unless $lintseen{$s_symbol}; $lintseen_used{$s_symbol}++ if $lintseen{$s_symbol}; } # Deal with obsolete symbol list (enclosed between parenthesis) &record_obsolete("\$$_") if /\(/; } else { unless ($s_symbol) { warn "$where: syntax error in ?S: construct.\n"; return; } } m|^\.\s*$| && ($s_symbol = ''); # End of comment } # Process the ?C: lines sub p_c { local($_) = @_; local($where) = "\"$file\", line $. (?C:)"; warn "$where: directive should come after ?MAKE declarations.\n" unless $makeseen{$unit}; # The previous ?H: section, if present, must have been closed if ($h_section && $h_section != 2) { warn "$where: unclosed ?H: section.\n"; } $h_section = 0; if (s/^(\w+)\s*~\s*(\S+)\s*(.*):/$1 $3:/) { &check_last_declaration; $c_symbol = $2; # Alias for definition in config.h # Record symbol definition for further duplicate spotting $cmaster{$1} .= "$unit " unless $csym{$1}; print " ?C: $1 ~ $c_symbol\n" if $opt_d; # Make sure we do not define symbol twice warn "$where: duplicate description for symbol '$1'.\n" if $csym{$1}++; # Deal with obsolete symbol list (enclosed between parenthesis) &record_obsolete("$_") if /\(/; } elsif (/^(\w+)\s*(\(.*\))*\s*:/) { &check_last_declaration; $c_symbol = $1; # Record symbol definition for further duplicate spotting $cmaster{$c_symbol} .= "$unit " unless $csym{$c_symbol}; print " ?C: $c_symbol\n" if $opt_d; # Make sure we do not define symbol twice warn "$where: duplicate description for symbol '$c_symbol'.\n" if $csym{$c_symbol}++; # Deal with obsolete symbol list (enclosed between parenthesis) &record_obsolete("$_") if /\(/; } else { unless ($c_symbol) { warn "$where: syntax error in ?C: construct.\n"; return; } } s|^(\w+)|?$c_symbol:/* $1| || # Start of comment (s|^\.\s*$|?$c_symbol: */\n| && ($c_symbol = '', 1)) || # End of comment s|^(.*)|?$c_symbol: *$1|; # Middle of comment } # Process the ?H: lines sub p_config { local($_) = @_; local($where) = "\"$file\", line $. (?H)" unless $where; warn "$where: directive should come after ?MAKE declarations.\n" unless $makeseen{$unit}; unless ($h_section){ # Entering ?H: section $h_section = 1; $h_section_warned = 0; } if ($h_section == 2) { warn "$where: section was already terminated by '?H:.'.\n" unless $h_section_warned++; return; } if ($_ eq ".\n") { $h_section = 2; # Marks terminated ?H: section return; } (my $constraint) = m/^\?(\w+):/; s/^\?\w+://; # Remove leading '?var:' constraint if (m|^#\$(\w+)\s+(\w+).*\$(\w+)|) { # Case: #$d_var VAR "$var" warn "$where: symbol '$2' was already defined.\n" if $hcsym{$2}++; &check_definition("$1"); &check_definition("$3"); } elsif (m|^#define\s+(\w+)\((.*)\)\s+\$(\w+)|) { # Case: #define VAR(x) $var warn "$where: symbol '$1' was already defined.\n" if $hcsym{$1}++; &check_definition("$3"); } elsif (m|^#\$define\s+(\w+)|) { # Case: #$define VAR warn "$where: symbol '$1' was already defined.\n" if $hcsym{$1}++; } elsif (m|^#\$(\w+)\s+(\w+)|) { # Case: #$d_var VAR warn "$where: symbol '$2' was already defined.\n" if $hcsym{$2}++; &check_definition("$1"); } elsif (m|^#define\s+(\w+).*\$(\w+)|) { # Case: #define VAR "$var" warn "$where: symbol '$1' was already defined.\n" if $hcsym{$1}++; &check_definition("$2"); } elsif (m|^#define\s+(\w+)|) { # Case: #define VAR $hcsym{$1}++; # Multiple occurrences may be legitimate } else { if (/^#/) { warn "$where: uncommon cpp line should be protected with '?%<:'.\n" if $constraint eq ''; } elsif (!/^\@(if|elsif|else|end)\b/) { warn "$where: line should not be listed here but in '?C:'.\n"; } } # Ensure the constraint is either %< (unit base name) or a known symbol. if ($constraint ne '' && $constraint ne $unit) { warn "$where: constraint '$constraint' is an unknown symbol.\n" unless $csym{$constraint} || $ssym{$constraint}; } } # Process the ?M: lines sub p_magic { local($_) = @_; local($where) = "\"$file\", line $. (?M)"; warn "$where: directive should come after ?MAKE declarations.\n" unless $makeseen{$unit}; if (/^(\w+):\s*([\w\s]*)\n$/) { &check_last_declaration; $m_symbol = $1; $msym{$1} = "$unit"; # p_wanted ensure we do not define symbol twice $mdep{$1} = $2; # Save C symbol dependencies &p_wanted("$unit:$m_symbol"); } else { unless ($m_symbol) { warn "$where: syntax error in ?M: construct.\n"; return; } } m|^\.\s*$| && ($m_symbol = ''); # End of comment } # Process the ?INIT: lines sub p_init { local($_) = @_; local($where) = "\"$file\", line $. (?INIT)"; warn "$where: directive should come after ?MAKE declarations.\n" unless $makeseen{$unit}; &p_body($_, 1); # Pass it along as a body line (leading ?INIT: removed) } # Process the ?D: lines sub p_default { local($_) = @_; local($where) = "\"$file\", line $. (?D)"; warn "$where: directive should come after ?MAKE declarations.\n" unless $makeseen{$unit}; local($sym) = /^(\w+)=/; $hasdefault{$sym}++; unless ($defseen{$sym}) { warn "$where: variable '\$$sym' is not listed " . "on ?MAKE: line.\n" unless $lintseen{$sym}; $lintseen_used{$sym}++ if $lintseen{$sym}; } s/^\w+=//; # So that p_body does not consider variable as being set &p_body($_, 1); # Pass it along as a body line (leading ?D: + var removed) } # Process the ?V: lines sub p_visible { local($where) = "\"$file\", line $. (?V)"; warn "$where: directive should come after ?MAKE declarations.\n" unless $makeseen{$unit}; # A visible symbol can freely be manipulated by any unit which includes the # current unit in its dependencies. Symbols before ':' may be only used for # reading while symbols after ':' may be used for both reading and writing. # The array %shvisible records symbols as keys. Read-only symbols have a # leading '$' while read-write symbols are recorded as-is. unless (substr($unit, 0, 1) =~ /^[A-Z]/) { warn "$where: visible declaration in non-special unit ignored.\n"; return; } local($read_only) = $_[0] =~ /^([^:]*):?/; local($read_write) = $_[0] =~ /:(.*)/; local(@rsym) = split(' ', $read_only); local(@rwsym) = split(' ', $read_write); local($w); foreach (@rsym) { # Read only symbols warn "$where: wanted variable '\$$_' made visible.\n" if &wanted($_); warn "$where: defined variable '\$$_' made visible.\n" if &defined($_) && !$lintseen{$_}; $w = $shvisible{"\$$_"}; warn "$where: variable '\$$_' already made visible by unit $w.\n" if $w; $w = $shvisible{$_}; warn "$where: variable '\$$_' already read-write visible in $w.\n" if $w; $shvisible{"\$$_"} = $unit unless $w; } foreach (@rwsym) { # Read/write symbols warn "$where: wanted variable '\$$_' made visible.\n" if &wanted($_); warn "$where: defined variable '\$$_' made visible.\n" if &defined($_) && !$lintseen{$_}; $w = $shvisible{$_}; warn "$where: variable '\$$_' already made visible by unit $w.\n" if $w; $w = $shvisible{"\$$_"}; warn "$where: variable '\$$_' already read-only visible in $w.\n" if $w; $shvisible{$_} = $unit unless $w; } } # Process the ?W: lines sub p_wanted { local($where) = "\"$file\", line $. (?W)" unless $where; warn "$where: directive should come after ?MAKE declarations.\n" unless $makeseen{$unit}; # Somehow, we should check that none of the symbols to activate are stale # ones, i.e. they all finally resolve to some known target -- FIXME local($active) = $_[0] =~ /^([^:]*):/; # Symbols to activate local($look_symbols) = $_[0] =~ /:(.*)/; # When those are used local(@symbols) = split(' ', $look_symbols); # A "?W:symbol" line asks metaconfig to define 'symbol' in the wanted file # as a C target iff that word is found within the sources. This is mainly # intended for the built-in interpreter to check for definedness. local($w); foreach (@symbols) { warn "$where: variable '\$$_' already wanted.\n" if &wanted($_); warn "$where: variable '\$$_' also locally defined.\n" if &defined($_); $w = $cwanted{$_}; if ($msym{$_} ne '') { warn "$where: symbol '$_' already listed on a ?M: line in '$w'.\n" if $w; } else { warn "$where: variable '\$$_' already listed on a ?W: line in '$w'.\n" if $w; } $cwanted{$_} = $unit unless $w; } } # Process the ?Y: lines sub p_layout { local($where) = "\"$file\", line $. (?Y)"; warn "$where: directive should come after ?MAKE declarations.\n" unless $makeseen{$unit}; local($_) = @_; chop; s/^\s+//; tr/A-Z/a-z/; # Layouts are record in lowercase warn "$where: unknown layout directive '$_'.\n" unless defined $Lcmp{$_}; } # Process the ?P: lines sub p_public { # FIXME } # Process the ?L: lines sub p_library { # There should not be any '-l' in front of the library name # FIXME } # Process the ?I: lines sub p_include { # FIXME } # Process the ?T: lines sub p_temp { local($where) = "\"$file\", line $. (?T:)"; warn "$where: directive should come after ?MAKE declarations.\n" unless $makeseen{$unit}; local($_) = @_; local(@sym) = split(' ', $_); foreach $sym (@sym) { warn "$where: temporary symbol '\$$sym' multiply declared.\n" if $tempseen{$sym}++ == 1; $tempmaster{$sym} .= "$unit " if $tempseen{$sym} == 1; } } # Process the ?F: lines sub p_file { local($where) = "\"$file\", line $. (?F:)"; warn "$where: directive should come after ?MAKE declarations.\n" unless $makeseen{$unit}; local($_) = @_; local(@files) = split(' ', $_); local($uufile); # Name of file produced in the UU directory local($tmpfile); # Name of a temporary file # We care only about UU files, i.e. files produced in the UU directory # and which are identified by the convention ./filename. Files !filename # are not produced, i.e. they are temporary or externally provided. # The %prodfile table records all the files produced, so we may detect # inconsistencies between units, while %filemaster records the (first) unit # defining a given UU file to make sure that (special) unit is named in the # dependency line when that UU file if used. Duplicates will be caught in # the sanity check phase thanks to %prodfile. # Temporary files are recorded in %filesetin, so that we may later compare # the list with the UU files to detect possible overwrites. my $is_special = substr($unit, 0, 1) =~ /^[A-Z]/; foreach $file (@files) { warn "$where: produced file '$file' multiply declared.\n" if $fileseen{$file}++ == 1; if (($tmpfile = $file) =~ s/^!//) { $filetmp{$tmpfile} = 'x '; $filesetin{$tmpfile} .= "$unit " if $fileseen{$file} == 1; next; # Is not a UU file for sure, so skip } $prodfile{$file} .= "$unit " if $fileseen{$file} == 1; ($uufile = $file) =~ s|^\./(\S+)$|$1|; next if $file eq $uufile; # Don't care about non-UU files unless ($is_special || $lintcreated{$uufile}) { warn "$where: UU file '$uufile' in non-special unit ignored.\n"; delete $lintcreated{$uufile}; # Detect spurious LINT next; } delete $lintcreated{$uufile} if !$is_special; # Detect spurious LINT $filemaster{$uufile} = $unit unless defined $filemaster{$uufile}; $filecreated{$uufile} = 'a'; # Will be automagically incremented } } # Process the ?LINT: lines sub p_lint { local($_) = @_; local(@sym); local($where) = "\"$file\", line $. (?LINT:)"; s/^\s+//; # Strip leading spaces unless ($makeseen{$unit}) { warn "$where: directive should come after ?MAKE declarations.\n" unless m/^empty/; } if (s/^set//) { # Listed variables are set @sym = split(' ', $_); # Spurious ones will be flagged foreach (@sym) { $lintset{$_}++; # Shell variable set } } elsif (s/^desc\w+//) { # Listed shell variables are described @sym = split(' ', $_); # Spurious ones will be flagged foreach (@sym) { $lintsdesc{$_}++; # Shell variable described } } elsif (s/^creat\w+//) { # Listed created files in regular units @sym = split(' ', $_); foreach (@sym) { $lintcreated{$_}++; # Persistent UU file created } } elsif (s/^known//) { # Listed C variables are described @sym = split(' ', $_); # Spurious ones will be flagged foreach (@sym) { $lintcdesc{$_}++; # C symbol described } } elsif (s/^change//) { # Shell variable ok to be changed @sym = split(' ', $_); # Spurious ones will be flagged foreach (@sym) { $lintchange{$_}++; # Do not complain if changed } } elsif (s/^extern//) { # Variables known to be externally defined @sym = split(' ', $_); foreach (@sym) { $lintextern{$_}++; # Do not complain if used in a ?H: line } } elsif (s/^usefile//) { # Files marked as being used @sym = split(' ', $_); foreach (@sym) { $lintfused{$_}++; } } elsif (s/^use//) { # Variables declared as used by unit @sym = split(' ', $_); # Spurious ones will be flagged foreach (@sym) { $lintuse{$_}++; # Do not complain if on ?MAKE and not used } } elsif (s/^def\w+//) { # Listed variables are defined @sym = split(' ', $_); # Spurious ones will be flagged foreach (@sym) { $lintseen{$_}++; # Shell variable defined in this unit } } elsif (m/^empty/) { # Empty unit file $lintempty{$unit}++; } elsif (m/^unclosed/) { # Unclosed here-documents @sym = split(' ', $_); foreach (@sym) { $linthere{$_}++; } } elsif (s/^nothere//) { # Not a here-document name @sym = split(' ', $_); foreach (@sym) { $lintnothere{$_}++; } } elsif (s/^nocomment//) { # OK if leading unit ': comment' missing $lintnocomment{$unit}++; } else { local($where) = "\"$file\", line $." unless $where; local($word) = /^(\w+)/; warn "$where: unknown LINT request '$word' ignored.\n"; } } # Process the body of the unit sub p_body { return unless $makeseen{$unit}; local($_, $special) = @_; local($where) = "\"$file\", line $." unless $where; # Ensure there is no control line in the body of the unit local($control) = /^\?([\w\-]+):/; local($known) = $control ? $Depend{$control} : ""; warn "$where: control sequence '?$control:' ignored within body.\n" if $known && !/^\?X:|^\?LINT:/; if (s/^\?LINT://) { # ?LINT directives allowed within body $_ .= &complete_line(FILE) if s/\\\s*$//; &p_lint($_); } return if $known; # First non-special line should be a ': description' line unless ($special || /^\?/ || /^@/) { warn "$where: first body line should be a general ': description'.\n" unless $past_first_line++ || $lintnocomment{$unit} || /^:\s+\w+/; } # Ensure ': comment' lines do not hold any meta-character # We assume ":)" introduces a case statement. if (/^\s*:/ && !/^\s*:\)/) { warn "$where: missing space after ':' to make it a comment.\n" unless /^\s*:\s/; s/\\.//g; # simplistic ignoring of "escaped" chars s/".*?"//g; s/'.*?'//g; if ($wiped_unit) { s/<\$\w+>//g; foreach my $wipe (@wiping) { s/<$wipe>//g; } } warn "$where: found unquoted meta-character $1 on comment line.\n" while s/([`()<>;&\{\}\|])//g; warn "$where: found dangling quote on ':' comment line.\n" if /['"]/; return; } # Ingnore interpreted lines and their continuations if ($last_interpreted) { return if /\\$/; # Still part of the interpreted line $last_interpreted = 0; # End of interpreted lines return; # This line was the last interpreted } # Look for interpreted lines and ignore them if (/^@/) { $last_interpreted = /\\$/; # Set flag if line is continued return; # And skip this line } # Detect ending of "here" documents if ($heredoc ne '' && $_ eq "$heredoc\n") { $heredoc = ''; # Close here-document $heredoc_nosubst = 0; return; } # Detect beginning of "here" document my $began_here = 0; if ($heredoc eq '') { if (/<<\s*''/) { # Discourage it, because we're not processing those... warn "$where: empty here-document name discouraged.\n"; } elsif (/<<\s*'([^']+)'/ && !$lintnothere{$1}) { $heredoc = $1; $heredoc_nosubst = 1; $began_here++; } elsif (/<<\s*(\S+)/ && !$lintnothere{$1}) { $heredoc = $1; $began_here++; } # Continue, as we need to look for possible ">file" on the same line # as a possible here document, as in "cat <file". } else { return if $heredoc_nosubst; # Completely opaque to interpretation } $heredoc_line = $. if $began_here; # If we've just entered a here document and we're generating a file # that is exported by the unit, then we need to monitor the variables # used to make sure there's no missing dependency. $heredoc_nosubst = 0 if $began_here && />>?\s*(\S+)/ && $filemaster{$1} eq $unit; # From now on, do all substitutes with ':' since it would be dangerous # to remove things plain and simple. It could yields false matches # afterwards... my $check_vars = 1; $chek_vars = 0 if $heredoc_nosubst && !$began_here; # Record any attempt made to set a shell variable local($sym); while ($check_vars && s/(\W?)(\w+)=/$1:/) { my $before = $1; $sym = $2; next unless $before eq '' || $before =~ /["'` \t]/; next if $sym =~ /^\d+/; # Ignore $1 and friends $symset{$sym}++; # Shell variable set # Not part of a $cc -DWHATEVER line and not made nor temporary unless ($sym =~ /^D/ || &defined($sym)) { if (&wanted($sym)) { warn "$where: variable '\$$sym' is changed.\n" unless $lintchange{$sym}; $lintchange_used{$sym}++ if $lintchange{$sym}; } else { # Record that the variable is set but not listed locally. if ($shset{$unit} !~ /\b$sym\b/) { $shset{$unit} .= "$sym " unless $lintchange{$sym}; $lintchange_used{$sym}++ if $lintchange{$sym}; } } } } # Now look at the shell variables used: can be $var or ${var} local($var); local($line) = $_; while ($check_vars && s/\$\{?(\w+)\}?/$1/) { $var = $1; next if $var =~ /^\d+/; # Ignore $1 and friends # Record variable as undeclared but do not issue a message right now. # That variable could be exported via ?V: (as $dflt in Myread) or be # defined by a special unit (like $inlibc by unit Inlibc). $shunknown{$unit} .= "$var " unless $lintextern{$var} || &declared($var) || $shunknown{$unit} =~ /\b$var\b/; $shused{$unit} .= "\$$var " unless $shused{$unit} =~ /\$$var\b/; } return if $heredoc ne '' && !$began_here; # Still in here-document # Now look at private files used by the unit (./file or ..../UU/file) # We look at things like '. ./myread' and `./loc ...` as well as "< file" local($file); $_ = $line; s/<\S+?>//g; # would set-off our >file or >file while (s!>>?\s*([^\$/`\s;]+)\s*!: !) { $file = $1; next if $file =~ /&\d+/; # skip >&4 and friends $filecreated{$file}++; } # Look for mentions of known temporary files to avoid complaining # that they were not used. while (s!\s+(\S+)!!) { $file = $1; $filetmp{$file} .= ' used' if defined $filetmp{$file} && $filetmp{$file} !~ /\bused/; } } # Called at the end of each unit sub p_end { local($last) = @_; # Last processed line local($where) = "\"$file\""; # The ?H: section, if present, must have been closed if ($h_section && $h_section != 2) { warn "$where: unclosed ?H: section.\n"; } $h_section = 0; # For next unit, which may be empty # All opened here-documents must be closed. if ($heredoc ne '') { my $q = $heredoc_nosubst ? "'" : ""; warn "$where: unclosed here-document $q$heredoc$q " . "started line $heredoc_line.\n" unless $linthere{$heredoc}; } # Reinitialize for next unit. $heredoc = ''; $heredoc_nosubst = 0; $past_first_line = 0; $last_interpreted = 0; unless ($makeseen{$unit}) { warn "$where: no ?MAKE: line describing dependencies.\n" unless $lintempty{$unit}; return; } # Each unit should end with a blank line. Unfortunately, some units # may also end with an '@end' request and have the blank line above it. # Currently, we do not have enough information to correctly diagnose # whether it is valid or not so just skip it. # Same thing for U/Obsol_sh.U which ends with a shell comment. warn "$where: not ending with a blank line.\n" unless $last =~ /^\s*$/ || $last =~ /^\@end/ || $last =~ /^#|\?/; # For EMACS users. It would be fatal to the Configure script... warn "$where: last line not ending with a new-line character.\n" unless $last =~ /\n$/; # Make sure every shell symbol described in ?MAKE had a description foreach $sym (sort keys %defseen) { unless ($ssym{$sym}) { warn "$where: symbol '\$$sym' was not described.\n" unless $lintsdesc{$sym}; $lintsdesc_used{$sym}++ if $lintsdesc{$sym}; } } # Ensure all the C symbols defined by ?H: lines have a description foreach $sym (sort keys %hcsym) { unless ($csym{$sym}) { warn "$where: C symbol '$sym' was not described.\n" unless $lintcdesc{$sym}; $lintcdesc_used{$sym}++ if $lintcdesc{$sym}; } } # Ensure all the C symbols described by ?C: lines are defined in ?H: foreach $sym (sort keys %csym) { warn "$where: C symbol '$sym' was not defined by any ?H: line.\n" unless $hcsym{$sym}; } # Make sure each defined symbol was set, unless it starts with an # upper-case letter in which case it is not a "true" shell symbol. # I don't care about the special symbols defined in %Except as I know # they are handled correctly. foreach $sym (sort keys %defseen) { unless ($symset{$sym} || substr($sym, 0, 1) =~ /^[A-Z]/) { warn "$where: variable '\$$sym' should have been set.\n" unless $lintset{$sym}; $lintset_used{$sym}++ if $lintset{$sym}; } } # Make sure every non-special unit declared as wanted is indeed needed foreach $sym (sort keys %depseen) { if ($shused{$unit} !~ /\$$sym\b/ && substr($sym, 0, 1) !~ /^[A-Z]/) { warn "$where: unused dependency variable '\$$sym'.\n" unless $lintchange{$sym} || $lintuse{$sym}; $lintchange_used{$sym}++ if $lintchange{$sym}; $lintuse_used{$sym}++ if $lintuse{$sym}; } } # Idem for conditionally wanted symbols foreach $sym (sort keys %condseen) { if ($shused{$unit} !~ /\$$sym\b/ && substr($sym, 0, 1) !~ /^[A-Z]/) { warn "$where: unused conditional variable '\$$sym'.\n" unless $lintchange{$sym} || $lintuse{$sym}; $lintchange_used{$sym}++ if $lintchange{$sym}; $lintuse_used{$sym}++ if $lintuse{$sym}; } } # Idem for temporary symbols foreach $sym (sort keys %tempseen) { if ($shused{$unit} !~ /\$$sym\b/ && !$symset{$sym}) { warn "$where: unused temporary variable '\$$sym'.\n" unless $lintuse{$sym}; $lintuse_used{$sym}++ if $lintuse{$sym}; } } # Idem for local files foreach $file (sort keys %filetmp) { warn "$where: mis-used temporary file '$file'.\n" if $filetmp{$file} =~ /\bmisused/; warn "$where: unused temporary file '$file'.\n" unless $lintfused{$file} || $filetmp{$file} =~ /\bused/ || $filetmp{$file} =~ /\bmisused/; } # Make sure each private file listed as created on ?F: is really created. # When found, a private UU file is entered in the %filecreated array # with value 'a'. Each time a file creation occurs in the unit, an # increment is done on that value. Since 'a'++ -> 'b', a numeric value # in %filecreated means a non-local file, which is skipped. An 'a' means # the file was not created... local($value); foreach $file (sort keys %filecreated) { $value = $filecreated{$file}; next if $value > 0; # Skip non UU-files. warn "$where: file '$file' was not created.\n" if $value eq 'a'; } # Check whether some of the LINT directives were useful foreach my $sym (sort keys %lintcreated) { warn "$where: spurious 'LINT create $sym' directive.\n"; } foreach my $sym (sort keys %lintuse) { warn "$where: spurious 'LINT use $sym' directive.\n" unless $lintuse_used{$sym}; } foreach my $sym (sort keys %lintchange) { warn "$where: spurious 'LINT change $sym' directive.\n" unless $lintchange_used{$sym}; } foreach my $sym (sort keys %lintseen) { warn "$where: spurious 'LINT define $sym' directive.\n" unless $lintseen_used{$sym}; } foreach my $sym (sort keys %lintsdesc) { warn "$where: spurious 'LINT describe $sym' directive.\n" unless $lintsdesc_used{$sym}; } foreach my $sym (sort keys %lintcdesc) { warn "$where: spurious 'LINT known $sym' directive.\n" unless $lintcdesc_used{$sym}; } foreach my $sym (sort keys %lintset) { warn "$where: spurious 'LINT set $sym' directive.\n" unless $lintset_used{$sym}; } } # An unknown control line sequence was found (held in $proc) sub p_unknown { warn "\"$file\", line $.: unknown control sequence '?$proc:'.\n"; } # Run sanity checks, to make sure every conditional symbol has a suitable # default value. Also ensure every symbol was defined once. sub sanity_checks { print "Sanity checks...\n"; local($key, $value); local($w); local(%message); # Record messages on a per-unit basis local(%said); # Avoid duplicate messages # Warn about symbols ever used in conditional dependency with no default while (($key, $value) = each(%condsym)) { unless ($hasdefault{$key}) { $w = (split(' ', $shmaster{"\$$key"}))[0]; $message{$w} .= "#$key "; } } # Warn about any undeclared variables. They are all listed in %shunknown, # being the values while the unit where they appear is the key. If the # symbol is defined by any of the special units included or made visible, # then no warning is issued. local($defined); # True if symbol is defined in one unit local($where); # List of units where symbol is defined local($myself); # The name of the current unit if itself special local($visible); # Symbol made visible via a ?V: line foreach $unit (sort keys %shunknown) { foreach $sym (split(' ', $shunknown{$unit})) { $defined = 0; $where = $shmaster{"\$$sym"}; $defined = 1 if $tempmaster{"\$$sym"} =~ /$unit\b/; $myself = substr($unit, 0, 1) =~ /^[A-Z]/ ? $unit : ''; # Symbol has to be either defined within one of the special units # listed in the dependencies or exported via a ?V: line. unless ($defined) { $defined = &visible($sym, $unit); $spneeded{$unit}++ if $defined; } $message{$unit} .= "\$$sym " unless $defined; } } # Warn about any undeclared files. Files used in one unit are all within # the %fileused table, indexed by unit. If a file is used, it must either # be in the unit that declared it (relying on %filemaster for that) or # the unit listed in %filemaster must be part of our dependency. %said = (); foreach $unit (sort keys %fileused) { foreach $file (split(' ', $fileused{$unit})) { $defined = 0; $where = $filemaster{$file}; # Where file is created $defined = 1 if $unit eq $where; # We're in the unit defining it # Private UU files may be only be created by special units foreach $special (split(' ', $shspecial{$unit})) { last if $defined; $defined = 1 if $where eq $special; } # Exceptions to above rule possible via a ?LINT:create hint, # so parse all known dependencies for the unit... foreach $depend (split(' ', $shdepend{$unit})) { last if $defined; $defined = 1 if $where eq $depend; } $message{$unit} .= "\@$file " unless $defined || $said{"$unit/$file"}++; # Unknown file } } undef %fileused; # Warn about any misused files, kept in %filemisused foreach $unit (sort keys %filemisused) { foreach $file (split(' ', $filemisused{$unit})) { next unless defined $filemaster{$file}; # Skip non UU-files $message{$unit} .= "\@\@$file "; # Misused file } } undef %filemisused; # Warn about temporary files which could be created and inadvertently # override a private UU file (listed in %filemaster). foreach $tmpfile (keys %filesetin) { next unless defined $filemaster{$tmpfile}; $where = $filemaster{$tmpfile}; foreach $unit (split(' ', $filesetin{$tmpfile})) { $message{$unit} .= "\@\@\@$where:$tmpfile "; } } undef %filesetin; # Warn about any set variable which was not listed. foreach $unit (sort keys %shset) { symbol: foreach $sym (split(' ', $shset{$unit})) { next if $shvisible{$sym}; $defined = 0; # Symbol has to be either defined within one of the special units # listed in the dependencies or exported read-write via a ?V: line. # If symbol is exported read-only, report the attempt to set it. $where = $shmaster{"\$$sym"}; study $where; foreach $special (split(' ', $shspecial{$unit})) { $defined = 1 if $where =~ /\b$special\b/; last if $defined; } $visible = 0; $defined = $visible = &visible($sym, $unit) unless $defined; if ($visible && $shvisible{"\$$sym"} ne '') { # We are allowed to set a read-only symbol in the unit which # declared it... next symbol if $shvisible{"\$$sym"} eq $unit; $message{$unit} .= "\&$sym "; # Read-only symbol set next symbol; } $message{$unit} .= "$sym " unless $defined; } } # Warn about any obsolete variable which may be used foreach $unit (sort keys %shused) { foreach $sym (split(' ', $shused{$unit})) { $message{$unit} .= "!$sym " if $Obsolete{$sym} ne ''; } } # Warn about stale dependencies, and prepare successor and predecessor # tables for later topological sort. local($targets, $deps); local(%Succ); # Successors local(%Prec); # Predecessors # Split dependencies and build successors array. foreach $make (@make) { ($targets, $deps) = $make =~ m|(.*):\s*(.*)|; $deps =~ s/\+(\w)/$1/g; # Remove conditional targets foreach $target (split(' ', $targets)) { $Succ{$target} .= $deps . ' '; } } # Special setup for the End target, which normally has a $W dependency for # wanted symbols. In order to detect all the possible cycles, we forge a # huge dependency by making ALL the regular symbols (i.e. those whose first # letter is not uppercased) wanted. local($allwant) = ''; { local($sym, $val); while (($sym, $val) = each %shmaster) { $sym =~ s/^\$//; $allwant .= "$sym " if $val ne ''; } } $Succ{'End'} =~ s/\$W/$allwant/; # Initialize precursors, and spot symbols impossible to 'make', i.e. those # symbols listed in the successors and with no 'make' target. The data # structures %Prec and %Succ will also be used by the cycle lookup code, # in other words, the topological sort. foreach $target (keys %Succ) { $Prec{$target} += 0; # Ensure key is recorded without disturbing. foreach $succ (split(' ', $Succ{$target})) { $Prec{$succ}++; # Successor has one more precursor unless (defined $Succ{$succ} || $said{$succ}++) { foreach $unit (split(' ', $symdep{$succ})) { $message{$unit} .= "?$succ "; # Stale ?MAKE: dependency } } } } undef %symdep; # Check all ?M: dependencies to spot stale ones %said = (); while (($key, $value) = each(%msym)) { next if $value eq ''; # Value is unit name where ?M: occurred foreach $sym (split(' ', $mdep{$key})) { # Loop on C dependencies next if $cmaster{$sym} || $said{$sym}; $message{$value} .= "??$sym "; # Stale ?M: dependency $said{$sym}++; } } undef %said; undef %mdep; undef %msym; # Now actually emit all the warnings local($uv); # Unit defining visible symbol or private file local($w); # Were we are signaling an error foreach $unit (sort keys %message) { undef %said; $w = "\"$unit.U\""; foreach (split(' ', $message{$unit})) { if (s/^#//) { warn "$w: symbol '\$$_' has no default value.\n"; } elsif (s/^\?\?//) { warn "$w: stale ?M: dependency '$_'.\n"; } elsif (s/^\?//) { warn "$w: stale ?MAKE: dependency '$_'.\n"; } elsif (s/^\$//) { if ($shmaster{"\$$_"} ne '') { warn "$w: symbol '\$$_' missing from ?MAKE.\n"; } elsif (($uv = $shvisible{$_}) ne '') { warn "$w: missing $uv from ?MAKE for visible '\$$_'.\n"; } elsif (($uv = $shvisible{"\$$_"}) ne '') { warn "$w: missing $uv from ?MAKE for visible '\$$_'.\n"; } else { warn "\"$unit.U\": unknown symbol '\$$_'.\n"; } ++$said{$_}; } elsif (s/^\&//) { warn "\"$unit.U\": read-only symbol '\$$_' is set.\n"; ++$said{$_}; } elsif (s/^!//) { warn "\"$unit.U\": obsolete symbol '$_' is used.\n"; ++$said{$_}; } elsif (s/^\@\@\@//) { $uv = '?'; # To spot format errors s/^(\w+):// && ($uv = $1); warn "$w: local file '$_' may override the one set by $uv.U.\n"; } elsif (s/^\@\@//) { $uv = $filemaster{$_}; warn "$w: you might not always get file '$_' from $uv.U.\n"; } elsif (s/^\@//) { if ($uv = $filemaster{$_}) { warn "$w: missing $uv from ?MAKE for private file '$_'.\n"; } else { warn "$w: unknown private file '$_'.\n"; } ++$said{"\@$_"}; } else { warn "\"$unit.U\": undeclared symbol '\$$_' is set.\n" unless $said{$_}; } } } # Memory cleanup undef %message; undef %said; undef %shused; undef %shset; undef %shspecial; undef %shvisible; undef %filemaster; # Spot multiply defined C symbols foreach $sym (keys %cmaster) { @sym = split(' ', $cmaster{$sym}); if (@sym > 1) { warn "C symbol '$sym' is defined in the following units:\n"; foreach (@sym) { print STDERR "\t$_.U\n"; } } } undef %cmaster; # Memory cleanup # Warn about multiply defined symbols. There are three kind of symbols: # target symbols, obsolete symbols and temporary symbols. # For each of these sets, we make sure the intersection with the other sets # is empty. Besides, we make sure target symbols are only defined once. local(@sym); foreach $sym (keys %shmaster) { @sym = split(' ', $shmaster{$sym}); if (@sym > 1) { warn "Shell symbol '$sym' is defined in the following units:\n"; foreach (@sym) { print STDERR "\t$_.U\n"; } } $message{$sym} .= 'so ' if $Obsolete{$sym}; $message{$sym} .= 'st ' if $tempmaster{$sym}; } foreach $sym (keys %tempmaster) { $message{$sym} .= 'ot ' if $Obsolete{$sym}; } local($_); while (($sym, $_) = each %message) { if (/so/) { if (/ot/) { warn "Shell symbol '$sym' is altogether:\n"; @sym = split(' ', $shmaster{$sym}); @sym = grep(s/$/.U/, @sym); print STDERR "...defined in: ", join(', ', @sym), "\n"; print STDERR "...obsoleted by $Obsolete{$sym}.\n"; @sym = split(' ', $tempmaster{$sym}); @sym = grep(s/$/.U/, @sym); print STDERR "...used as temporary in:", join(', ', @sym), "\n"; } else { warn "Shell symbol '$sym' is both defined and obsoleted:\n"; @sym = split(' ', $shmaster{$sym}); @sym = grep(s/$/.U/, @sym); print STDERR "...defined in: ", join(', ', @sym), "\n"; print STDERR "...obsoleted by $Obsolete{$sym}.\n"; } } elsif (/st/) { # Cannot be ot as it would imply so warn "Shell symbol '$sym' is both defined and used as temporary:\n"; @sym = split(' ', $shmaster{$sym}); @sym = grep(s/$/.U/, @sym); print STDERR "...defined in: ", join(', ', @sym), "\n"; @sym = split(' ', $tempmaster{$sym}); @sym = grep(s/$/.U/, @sym); print STDERR "...used as temporary in:", join(', ', @sym), "\n"; } elsif (/ot/) { warn "Shell symbol '$sym' obsoleted also used as temporary:\n"; print STDERR "...obsoleted by $Obsolete{$sym}.\n"; @sym = split(' ', $tempmaster{$sym}); @sym = grep(s/$/.U/, @sym); print STDERR "...used as temporary in:", join(', ', @sym), "\n"; } } # Spot multiply defined files, either private or public ones foreach $file (keys %prodfile) { @sym = split(' ', $prodfile{$file}); if (@sym > 1) { warn "File '$file' is defined in the following units:\n"; foreach (@sym) { print STDERR "\t$_\n"; } } } undef %prodfile; # Memory cleanup (we still need %shmaster for tsort) undef %message; undef %tempmaster; undef %Obsolete; # Make sure there is no dependency cycle print "Looking for dependency cycles...\n"; &tsort(*Succ, *Prec); # Destroys info from %Prec } # Make sure last declaration ended correctly with a ?S:. or ?C:. line. # The variable '$where' was correctly positionned by the calling routine. sub check_last_declaration { warn "$where: definition of '\$$s_symbol' not closed by '?S:.'.\n" if $s_symbol ne ''; warn "$where: definition of '$c_symbol' not closed by '?C:.'.\n" if $c_symbol ne ''; warn "$where: magic definition of '$m_symbol' not closed by '?M:.'.\n" if $m_symbol ne ''; $s_symbol = $c_symbol = $m_symbol = ''; } # Make sure the variable is mentionned on the ?MAKE line, if possible in the # definition section. # The variable '$where' was correctly positionned by the calling routine. sub check_definition { local($var) = @_; warn "$where: variable '\$$var' not even listed on ?MAKE: line.\n" unless $defseen{$var} || $condseen{$var} || $depseen{$var}; warn "$where: variable '\$$var' is defined externally.\n" if !$lintextern{$var} && !$defseen{$var} && &wanted($var); } # Is symbol declared somewhere? sub declared { &defined($_[0]) || &wanted($_[0]); } # Is symbol defined by unit? sub defined { $tempseen{$_[0]} || $defseen{$_[0]} || $lintseen{$_[0]}; } # Is symbol wanted by unit? sub wanted { $depseen{$_[0]} || $condseen{$_[0]}; } # Is symbol visible from the unit? # Locate visible symbols throughout the special units. Each unit having # some special dependencies (special units wanted) have an entry in the # %shspecial array, listing all those special dependencies. And each # symbol made visible by ONE special unit has an entry in the %shvisible # array. sub visible { local($symbol, $unit) = @_; local(%explored); # Special units we've already explored &explore($symbol, $unit); # Perform recursive search } # Recursively explore the dependencies to locate a visible symbol sub explore { local($symbol, $unit) = @_; # If unit was already explored, we know it has not been found by following # that path. return 0 if defined $explored{$unit}; $explored{$unit} = 0; # Assume nothing found in this unit local($specials) = $shspecial{$unit}; # Don't waste any time if unit does not have any special units listed # in its dependencies. return 0 unless $specials; foreach $special (split(' ', $specials)) { return 1 if ( $shvisible{"\$$symbol"} eq $unit || $shvisible{$symbol} eq $unit || &explore($symbol, $special) ); } 0; } dist_3.5-30.orig/mcon/pl/configure.pl0000644000175000017500000001655611017237675017752 0ustar srivastasrivasta;# $Id: configure.pl 25 2008-05-28 11:19:25Z rmanfredi $ ;# ;# Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ;# ;# You may redistribute only under the terms of the Artistic Licence, ;# as specified in the README file that comes with the distribution. ;# You may reuse parts of this distribution only within the terms of ;# that same Artistic Licence; a copy of which may be found at the root ;# of the source tree for dist 4.0. ;# ;# $Log: configure.pl,v $ ;# Revision 3.0.1.5 1995/01/30 14:47:15 ram ;# patch49: removed old "do name()" routine call constructs ;# ;# Revision 3.0.1.4 1995/01/11 15:40:02 ram ;# patch45: now allows @if statements for the add.Config_sh unit inclusion ;# ;# Revision 3.0.1.3 1994/05/06 15:21:23 ram ;# patch23: cleaned up the 'prepend' command ;# ;# Revision 3.0.1.2 1994/01/24 14:23:21 ram ;# patch16: new general <\$variable> macro substitutions in wiped units ;# ;# Revision 3.0.1.1 1993/10/16 13:54:02 ram ;# patch12: added support for ?M: lines and confmagic.h production ;# patch12: new Makefile command cm_h_weed ;# ;# Revision 3.0 1993/08/18 12:10:20 ram ;# Baseline for dist 3.0 netwide release. ;# ;# ;# This file is the heart of metaconfig. We generate a Configure script using ;# the informations gathered in the @cmdwanted array. A unit is expected to have ;# its path written in the %Unit array (indexing is done with the unit's name ;# without the .U extension). ;# ;# The units are run through a built-in interpreter before being written to ;# the Configure script. ;# # Create the Configure script sub create_configure { print "Creating Configure...\n" unless $opt_s; open(CONFIGURE,">Configure") || die "Can't create Configure: $!\n"; open(CONF_H,">config_h.SH") || die "Can't create config_h.SH: $!\n"; if ($opt_M) { open(MAGIC_H,">confmagic.h") || die "Can't create confmagic.h: $!\n"; } chdir('.MT') || die "Can't cd to .MT: $!\n"; for (@cmdwanted) { &process_command($_); # Run the makefile command } chdir($WD) || die "Can't cd back to $WD\n"; close CONFIGURE; print CONF_H "#endif\n"; # Close the opened #ifdef (see Config_h.U) print CONF_H "!GROK!THIS!\n"; close CONF_H; if ($opt_M) { print MAGIC_H "#endif\n"; # Close the opened #ifdef (see Magic_h.U) close MAGIC_H; } `chmod +x Configure`; } # Process a Makefile 'pick' command sub process_command { local($cmd, $target, $unit_name) = split(' ', $_[0]); local($name) = $unit_name . '.U'; # Restore missing .U local($file) = $name; # Where unit is located unless ($file =~ m|^\./|) { # Unit produced earlier by metaconfig $file = $Unit{$unit_name}; # Fetch unit from U directory } if (defined $Obsolete{$name}) { # Signal use of an obsolete unit warn "\tObsolete unit $name is used:\n"; local(@msg) = split(/\n/, $Obsolete{$name}); foreach $msg (@msg) { warn "\t $msg\n"; } } die "Can't open $file.\n" unless open(UNIT, $file); print "\t$cmd $file\n" if $opt_v; &init_interp; # Initializes the interpreter # The 'add' command adds the unit to Configure. if ($cmd eq 'add') { while () { print CONFIGURE unless &skipped || !&interpret($_); } } # The 'weed' command adds the unit to Configure, but # makes some tests for the lines starting with '?' or '%'. # These lines are kept only if the symbol is wanted. elsif ($cmd eq 'weed') { while () { if (/^\?(\w+):/) { s/^\?\w+:// if $symwanted{$1}; } if (/^%(\w+):/) { s/^%\w+:// if $condwanted{$1}; } print CONFIGURE unless &skipped || !&interpret($_); } } # The 'wipe' command adds the unit to Configure, but # also substitues some hardwired macros. elsif ($cmd eq 'wipe') { while () { s//$package/g; s//$maintloc/g; s//$version/g; # This is metaconfig's version s//$revision/g; # And revision information warn "\"$file\": usage of is deprecated\n" if s//$patchlevel/g; s//$date/g; s//$baserev/g; s/<\$(\w+)>/eval("\$$1")/ge; # <$var> -> $var substitution print CONFIGURE unless &skipped || !&interpret($_); } } # The 'add.Null' command adds empty initializations # to Configure for all the shell variable used. elsif ($cmd eq 'add.Null') { for (sort @Master) { if (/^\?(\w+):/) { s/^\?\w+:// if $symwanted{$1}; } print CONFIGURE unless &skipped; } for (sort @Cond) { print CONFIGURE "$_=''\n" unless $symwanted{$_} || $hasdefault{$_}; } while () { print CONFIGURE unless &skipped || !&interpret($_); } print CONFIGURE "CONFIG=''\n\n"; } # The 'add.Config_sh' command fills in the production of # the config.sh script within Configure. Only the used # variable are added, the conditional ones are skipped. elsif ($cmd eq 'add.Config_sh') { while () { print CONFIGURE unless &skipped || !&interpret($_); } for (sort @Master) { if (/^\?(\w+):/) { # Can't use $shmaster, because config.sh must # also contain some internal defaults used by # Configure (e.g. nm_opt, libc, etc...). s/^\?\w+:// if $symwanted{$1}; } s/^(\w+)=''/$1='\$$1'/; print CONFIGURE unless &skipped; } } # The 'close.Config_sh' command adds the final EOT line at # the end of the here-document construct which produces the # config.sh file within Configure. elsif ($cmd eq 'close.Config_sh') { print CONFIGURE "EOT\n\n"; # Ends up file } # The 'c_h_weed' command produces the config_h.SH file. # Only the necessary lines are kept. If no conditional line is # ever printed, then the file is useless and will be removed. elsif ($cmd eq 'c_h_weed') { $printed = 0; while () { if (/^\?(\w+):/) { s/^\?\w+:// if $cmaster{$1} || $symwanted{$1}; } unless (&skipped || !&interpret($_)) { if (/^$/) { print CONF_H "\n" if $printed; $printed = 0; } else { print CONF_H; ++$printed; } } } } # The 'cm_h_weed' command produces the confmagic.h file. # Only the necessary lines are kept. If no conditional line is # ever printed, then the file is useless and will be removed. elsif ($cmd eq 'cm_h_weed') { if ($opt_M) { $printed = 0; while () { if (/^\?(\w+):/) { s/^\?\w+:// if $cmaster{$1} || $symwanted{$1}; } unless (&skipped || !&interpret($_)) { if (/^$/) { print MAGIC_H "\n" if $printed; $printed = 0; } else { print MAGIC_H; ++$printed; } } } } } # The 'prepend' command will add the content of the target to # the current file (held in $file, the one which UNIT refers to), # if the file is not empty. elsif ($cmd eq 'prepend') { if (-s $file) { open(PREPEND, ">.prepend") || die "Can't create .MT/.prepend.\n"; open(TARGET, $Unit{$target}) || die "Can't open $Unit{$target}.\n"; while () { print PREPEND unless &skipped; } print PREPEND ; # Now add original file contents close PREPEND; close TARGET; rename('.prepend', $file) || die "Can't rename .prepend into $file.\n"; } } # Command not found else { die "Unrecognized command from Makefile: $cmd\n"; } &check_state; # Make sure there are no pending statements close UNIT; } # Skip lines starting with ? or %, including all the following continuation # lines, if any. Return 0 if the line was not to be skipped, 1 otherwise. sub skipped { return 0 unless /^\?|^%/; &complete_line(UNIT) if /\\\s*$/; # Swallow continuation lines 1; } dist_3.5-30.orig/mcon/pl/common.pl0000644000175000017500000002564110473316164017250 0ustar srivastasrivasta;# $Id: common.pl 1 2006-08-24 12:32:52Z rmanfredi $ ;# ;# Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ;# ;# You may redistribute only under the terms of the Artistic Licence, ;# as specified in the README file that comes with the distribution. ;# You may reuse parts of this distribution only within the terms of ;# that same Artistic Licence; a copy of which may be found at the root ;# of the source tree for dist 4.0. ;# ;# $Log: common.pl,v $ ;# Revision 3.0.1.4 1994/10/29 16:35:01 ram ;# patch36: metaconfig and metaxref ignore ?F: lines from now on ;# ;# Revision 3.0.1.3 1994/05/13 15:29:04 ram ;# patch27: now understands macro definitions in ?H: lines ;# ;# Revision 3.0.1.2 1994/01/24 14:22:54 ram ;# patch16: can now define "internal use only" variables on ?MAKE: lines ;# ;# Revision 3.0.1.1 1993/10/16 13:53:29 ram ;# patch12: added support for ?M: lines and confmagic.h production ;# ;# Revision 3.0 1993/08/18 12:10:19 ram ;# Baseline for dist 3.0 netwide release. ;# ;# The list of all available units is held in @ARGV. We shall parse them and ;# extract the dependencies. A lot of global data structures are filled in ;# during this phase. ;# ;# The following two H tables are used to record each know symbol (i.e. a ;# symbol known by at least one unit), and also how many times this symbol is ;# found in the sources. If an entry for a given key is positive, then the ;# associated symbol (i.e. the key) is wanted and it will be written in the ;# Wanted file. ;# %shmaster{'$sym'} records how many times '$sym' is found in a .SH file ;# %cmaster{'SYM'} records how many times 'SYM' is found in a .c file ;# %cwanted{'SYM'} records the set of necessary shell symbols needed for SYM ;# %mwanted{'sym'} is set of C symbols needed when sym is found in .c file ;# ;# This data structure records the initializations which are requires at the ;# beginning of a Configure script. The initialization only occurs when the ;# symbol is needed. Those symbols will appear in the produced config.sh file, ;# hence the name of "master" symbols. ;# @Master records shell configuration symbols which will appear in config.sh ;# ;# The @Cond array records the conditional shell symbols, i.e. those whose ;# value may be defaulted. They will appear in the initialization section of ;# the Configure script with the default value if they are not otherwise used ;# but Configure needs a suitable value internally. ;# @Cond records symbols which are flagged as conditional in the dependencies ;# %hasdefault{'sym'} is true when the conditional 'sym' has a default value ;# ;# The %Obsolete array records the obsolecence for units or symbols. The key ;# ends with .U for units, otherwise it is a symbol. Unit's obsolescence is ;# flagged with a ?O: line (the line being the message which will be issued ;# when the unit is used) while symbol obsolecence is indicated on the leading ;# ?C: or ?S: line, between parenthesis. In that case, the value stored is the ;# new symbol which should be used insted. ;# %Obsolete{'unit.U'} is a message to be printed when obsolete unit is used ;# %Obsolete{'sym'} is the symbol to be used in place of the obsoleted 'sym' ;# ;# The $dependencies variable is used to record the dependencies extracted ;# from the units (?MAKE: line). ;# ;# During the dependency extraction. some files are produced in the .MT dir. ;# Init.U records the initialization wanted ;# Config_h.U records the informations which could go in config.h.SH ;# Extern.U records the libraries and includes wanted by each symbol ;# ;# This file is shared by both metaconfig and metaxref ;# # Initialize the extraction process by setting some variables. # We return a string to be eval to do more customized initializations. sub init_extraction { open(INIT, ">$WD/.MT/Init.U") || die "Can't create .MT/Init.U\n"; open(CONF_H, ">$WD/.MT/Config_h.U") || die "Can't create .MT/Config_h.U\n"; open(EXTERN, ">$WD/.MT/Extern.U") || die "Can't create .MT/Extern.U\n"; open(MAGIC_H, ">$WD/.MT/Magic_h.U") || die "Can't create .MT/Magic_h.U\n"; $c_symbol = ''; # Current symbol seen in ?C: lines $s_symbol = ''; # Current symbol seen in ?S: lines $m_symbol = ''; # Current symbol seen in ?M: lines $heredoc = ''; # Last "here" document symbol seen $heredoc_nosubst = 0; # True for <<'EOM' here docs $condlist = ''; # List of conditional symbols $defined = ''; # List of defined symbols in the unit $body = ''; # No procedure to handle body $ending = ''; # No procedure to clean-up } # End the extraction process sub end_extraction { close EXTERN; # External dependencies (libraries, includes...) close CONF_H; # C symbol definition template close INIT; # Required initializations close MAGIC; # Magic C symbol redefinition templates print $dependencies if $opt_v; # Print extracted dependencies } # Process the ?MAKE: line sub p_make { local($_) = @_; local(@ary); # Locally defined symbols local(@dep); # Dependencies if (/^[\w+ ]*:/) { # Main dependency rule s|^\s*||; # Remove leading spaces chop; s/:(.*)//; @dep = split(' ', $1); # Dependencies @ary = split(' '); # Locally defined symbols foreach $sym (@ary) { # Symbols starting with a '+' are meant for internal use only. next if $sym =~ s/^\+//; # Only sumbols starting with a lowercase letter are to # appear in config.sh, excepted the ones listed in Except. if ($sym =~ /^[_a-z]/ || $Except{$sym}) { $shmaster{"\$$sym"} = undef; push(@Master,"?$unit:$sym=''\n"); # Initializations } } $condlist = ''; # List of conditional symbols local($sym); # Symbol copy, avoid @dep alteration foreach $dep (@dep) { if ($dep =~ /^\+[A-Za-z]/) { ($sym = $dep) =~ s|^\+||; $condlist .= "$sym "; push(@Cond, $sym) unless $condseen{$sym}; $condseen{$sym}++; # Conditionally wanted } } # Append to already existing dependencies. The 'defined' variable # is set for &write_out, used to implement ?L: and ?I: canvas. It is # reset each time a new unit is parsed. # NB: leading '+' for defined symbols (internal use only) have been # removed at this point, but conditional dependencies still bear it. $defined = join(' ', @ary); # Symbols defined by this unit $dependencies .= $defined . ':' . join(' ', @dep) . "\n"; $dependencies .= " -cond $condlist\n" if $condlist; } else { $dependencies .= $_; # Building rules } } # Process the ?O: line sub p_obsolete { local($_) = @_; $Obsolete{"$unit.U"} .= $_; # Message(s) to print if unit is used } # Process the ?S: lines sub p_shell { local($_) = @_; unless ($s_symbol) { if (/^(\w+).*:/) { $s_symbol = $1; print " ?S: $s_symbol\n" if $opt_d; } else { warn "\"$file\", line $.: syntax error in ?S: construct.\n"; $s_symbol = $unit; return; } # Deal with obsolete symbol list (enclosed between parenthesis) &record_obsolete("\$$_") if /\(/; } m|^\.\s*$| && ($s_symbol = ''); # End of comment } # Process the ?C: lines sub p_c { local($_) = @_; unless ($c_symbol) { if (s/^(\w+)\s*~\s*(\S+)\s*(.*):/$1 $3:/) { # The ~ operator aliases the main C symbol to another symbol which # is to be used instead for definition in config.h. That is to say, # the line '?C:SYM ~ other:' would look for symbol 'other' instead, # and the documentation for symbol SYM would only be included in # config.h if 'other' were actually wanted. $c_symbol = $2; # Alias for definition in config.h print " ?C: $1 ~ $c_symbol\n" if $opt_d; } elsif (/^(\w+).*:/) { # Default behaviour. Include in config.h if symbol is needed. $c_symbol = $1; print " ?C: $c_symbol\n" if $opt_d; } else { warn "\"$file\", line $.: syntax error in ?C: construct.\n"; $c_symbol = $unit; return; } # Deal with obsolete symbol list (enclosed between parenthesis) and # make sure that list do not appear in config.h.SH by removing it. &record_obsolete("$_") if /\(/; s/\s*\(.*\)//; # Get rid of obsolete symbol list } s|^(\w+)\s*|?$c_symbol:/* $1| || # Start of comment (s|^\.\s*$|?$c_symbol: */\n| && ($c_symbol = '', 1)) || # End of comment s|^(.*)|?$c_symbol: *$1|; # Middle of comment &p_config("$_"); # Add comments to config.h.SH } # Process the ?H: lines sub p_config { local($_) = @_; local($constraint); # Constraint to be used for inclusion ++$old_version if s/^\?%1://; # Old version if (s/^\?(\w+)://) { # Remove leading '?var:' $constraint = $1; # Constraint is leading '?var' } else { $constraint = ''; # No constraint } if (/^#.*\$/) { # Look only for cpp lines if (m|^#\$(\w+)\s+(\w+).*\$(\w+)|) { # Case: #$d_var VAR "$var" $constraint = $2 unless $constraint; print " ?H: ($constraint) #\$$1 $2 \"\$$3\"\n" if $opt_d; $cmaster{$2} = undef; $cwanted{$2} = "$1\n$3"; } elsif (m|^#define\s+(\w+)\((.*)\)\s+\$(\w+)|) { # Case: #define VAR(x) $var $constraint = $1 unless $constraint; print " ?H: ($constraint) #define $1($2) \$$3\n" if $opt_d; $cmaster{$1} = undef; $cwanted{$1} = $3; } elsif (m|^#\$define\s+(\w+)|) { # Case: #$define VAR $constraint = $1 unless $constraint; print " ?H: ($constraint) #define $1\n" if $opt_d; $cmaster{$1} = undef; $cwanted{$1} = "define\n$unit"; } elsif (m|^#\$(\w+)\s+(\w+)|) { # Case: #$d_var VAR $constraint = $2 unless $constraint; print " ?H: ($constraint) #\$$1 $2\n" if $opt_d; $cmaster{$2} = undef; $cwanted{$2} = $1; } elsif (m|^#define\s+(\w+).*\$(\w+)|) { # Case: #define VAR "$var" $constraint = $1 unless $constraint; print " ?H: ($constraint) #define $1 \"\$$2\"\n" if $opt_d; $cmaster{$1} = undef; $cwanted{$1} = $2; } else { $constraint = $unit unless $constraint; print " ?H: ($constraint) $_" if $opt_d; } } else { print " ?H: ($constraint) $_" if $opt_d; } # If not a single ?H:. line, add the leading constraint s/^\.// || s/^/?$constraint:/; print CONF_H; } # Process the ?M: lines sub p_magic { local($_) = @_; unless ($m_symbol) { if (/^(\w+):\s*([\w\s]*)\n$/) { # A '?M:sym:' line implies a '?W:%<:sym' since we'll need to know # about the wantedness of sym later on when building confmagic.h. # Buf is sym is wanted, then the C symbol dependencies have to # be triggered. That is done by introducing sym in the mwanted # array, known by the Wanted file construction process... $m_symbol = $1; print " ?M: $m_symbol\n" if $opt_d; $mwanted{$m_symbol} = $2; # Record C dependencies &p_wanted("$unit:$m_symbol"); # Build fake ?W: line } else { warn "\"$file\", line $.: syntax error in ?M: construct.\n"; } return; } (s/^\.\s*$/?$m_symbol:\n/ && ($m_symbol = '', 1)) || # End of block s/^/?$m_symbol:/; print MAGIC_H; # Definition goes to confmagic.h print " ?M: $_" if $opt_d; } sub p_ignore {} # Ignore comment line sub p_lint {} # Ignore lint directives sub p_visible {} # No visible checking in metaconfig sub p_temp {} # No temporary variable control sub p_file {} # Ignore produced file directives (for now) dist_3.5-30.orig/mcon/pl/extract.pl0000644000175000017500000000774110473316164017433 0ustar srivastasrivasta;# $Id: extract.pl 1 2006-08-24 12:32:52Z rmanfredi $ ;# ;# Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ;# ;# You may redistribute only under the terms of the Artistic Licence, ;# as specified in the README file that comes with the distribution. ;# You may reuse parts of this distribution only within the terms of ;# that same Artistic Licence; a copy of which may be found at the root ;# of the source tree for dist 4.0. ;# ;# $Log: extract.pl,v $ ;# Revision 3.0.1.1 1994/05/06 15:21:43 ram ;# patch23: now saves the last unit line value for metalint ;# ;# Revision 3.0 1993/08/18 12:10:22 ram ;# Baseline for dist 3.0 netwide release. ;# ;# ;# This is the heart of the dependency extractor. Each control line is ;# processed. The dependencies are stored in $dependencies. ;# # Extract dependencies from units held in @ARGV sub extract_dependencies { local($proc); # Procedure used to handle a ctrl line local($file); # Current file scanned local($dir, $unit); # Directory and unit's name local($old_version) = 0; # True when old-version unit detected local($mc) = "$MC/U"; # Public metaconfig directory local($line); # Last processed line for metalint printf "Extracting dependency lists from %d units...\n", $#ARGV+1 unless $opt_s; chdir $WD; # Back to working directory &init_extraction; # Initialize extraction files $dependencies = ' ' x (50 * @ARGV); # Pre-extend $dependencies = ''; # We do not want to use the <> construct here, because we need the # name of the opened files (to get the unit's name) and we want to # reset the line number for each files, and do some pre-processing. file: while ($file = shift(@ARGV)) { close FILE; # Reset line number $old_version = 0; # True if unit is an old version if (open(FILE, $file)) { ($dir, $unit) = ('', $file) unless ($dir, $unit) = ($file =~ m|(.*)/(.*)|); $unit =~ s|\.U$||; # Remove extension } else { warn("Can't open $file.\n"); } # If unit is in the standard public directory, keep only the unit name $file = "$unit.U" if $dir eq $mc; print "$dir/$unit.U:\n" if $opt_d; line: while () { $line = $_; # Save last processed unit line if (s/^\?([\w\-]+)://) { # We may have found a control line $proc = $Depend{$1}; # Look for a procedure to handle it unless ($proc) { # Unknown control line $proc = $1; # p_unknown expects symbol in '$proc' eval '&p_unknown'; # Signal error (metalint only) next line; # And go on next line } # Long lines may be escaped with a final backslash $_ .= &complete_line(FILE) if s/\\\s*$//; # Run macros substitutions s/%)); next file; } } } continue { warn(" Warning: $file is a pre-3.0 version.\n") if $old_version; &$ending($line) if $ending; # Post-processing for metalint } &end_extraction; # End the extraction process } # The first line was escaped with a final \ character. Every following line # is to be appended to it (until we found a real \n not escaped). Note that # the leading spaces of the continuation line are removed, so any space should # be added before the former \ if needed. sub complete_line { local($file) = @_; # File where lines come from local($_); local($read) = ''; # Concatenation of all the continuation lines found while (<$file>) { s/^\s+//; # Remove leading spaces if (s/\\\s*$//) { # Still followed by a continuation line $read .= $_; } else { # We've reached the end of the continuation return $read . $_; } } } dist_3.5-30.orig/mcon/pl/cosmetic.pl0000644000175000017500000000672610737536670017602 0ustar srivastasrivasta;# $Id: cosmetic.pl 20 2008-01-04 23:14:00Z rmanfredi $ ;# ;# Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ;# ;# You may redistribute only under the terms of the Artistic Licence, ;# as specified in the README file that comes with the distribution. ;# You may reuse parts of this distribution only within the terms of ;# that same Artistic Licence; a copy of which may be found at the root ;# of the source tree for dist 4.0. ;# ;# $Log: cosmetic.pl,v $ ;# Revision 3.0.1.3 1995/07/25 14:19:16 ram ;# patch56: added support for new -G option ;# ;# Revision 3.0.1.2 1995/01/30 14:47:52 ram ;# patch49: forgot to localize the spaces variable ;# ;# Revision 3.0.1.1 1993/11/10 17:39:10 ram ;# patch14: now also adds confmagic.h if not in MANIFEST.new already ;# patch14: new functions mani_add and mani_remove to factorize code ;# ;# Revision 3.0 1993/08/18 12:10:20 ram ;# Baseline for dist 3.0 netwide release. ;# ;# # Update the MANIFEST.new file if necessary sub cosmetic_update { # Check for an "empty" config_h.SH (2 blank lines only). This test relies # on the actual text held in Config_h.U. If the unit is modified, then the # following might need adjustments. local($blank_lines) = 0; local($spaces) = 0; open(CONF_H, 'config_h.SH') || die "Can't open config_h.SH\n"; while() { ++$blank_lines if /^$/; } unlink 'config_h.SH' unless $blank_lines > 3; open(NEWMANI,$NEWMANI); $_ = ; /(\S+\s+)\S+/ && ($spaces = length($1)); # Spaces wanted close NEWMANI; $spaces = 29 if ($spaces < 12); # Default value open(NEWMANI,$NEWMANI); $/ = "\001"; # Swallow the whole file $_ = ; $/ = "\n"; close NEWMANI; &mani_add('Configure', 'Portability tool', $spaces) unless /^Configure\b/m; &mani_add('config_h.SH', 'Produces config.h', $spaces) unless /^config_h\.SH\b/m || !-f 'config_h.SH'; &mani_add('confmagic.h', 'Magic symbol remapping', $spaces) if $opt_M && !/^confmagic\.h\b/m; &mani_remove('config_h.SH') if /^config_h\.SH\b/m && !-f 'config_h.SH'; &mani_remove('confmagic.h') if /^confmagic.h\b/m && !$opt_M; if ($opt_G) { # Want a GNU-like configure wrapper &add_configure; &mani_add('configure', 'GNU configure-like wrapper', $spaces) if !/^configure\s/m && -f 'configure'; } else { &mani_remove('configure') if /^configure\s/m && !-f 'configure'; } } # Add file to MANIFEST.new, with properly indented comment sub mani_add { local($file, $comment, $spaces) = @_; print "Adding $file to your $NEWMANI file...\n" unless $opt_s; open(NEWMANI, ">>$NEWMANI") || warn "Can't add $file to $NEWMANI: $!\n"; local($blank) = ' ' x ($spaces - length($file)); print NEWMANI "${file}${blank}${comment}\n"; close NEWMANI; } # Remove file from MANIFEST.new sub mani_remove { local($file) = @_; print "Removing $file from $NEWMANI...\n" unless $opt_s; unless (open(NEWMANI, ">$NEWMANI.x")) { warn "Can't create backup $NEWMANI copy: $!\n"; return; } unless (open(OLDMANI, $NEWMANI)) { warn "Can't open $NEWMANI: $!\n"; return; } local($_); while () { print NEWMANI unless /^$file\b/ } close OLDMANI; close NEWMANI; rename("$NEWMANI.x", $NEWMANI) || warn "Couldn't restore $NEWMANI from $NEWMANI.x\n"; } # Copy GNU-like configure wrapper to the package root directory sub add_configure { if (-f "$MC/configure") { print "Copying GNU configure-like front end...\n" unless $opt_s; system "cp $MC/configure ./configure"; `chmod +x configure`; } else { warn "Can't locate $MC/configure: $!\n"; } } dist_3.5-30.orig/mcon/pl/order.pl0000644000175000017500000000272410473316164017070 0ustar srivastasrivasta;# $Id: order.pl 1 2006-08-24 12:32:52Z rmanfredi $ ;# ;# Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ;# ;# You may redistribute only under the terms of the Artistic Licence, ;# as specified in the README file that comes with the distribution. ;# You may reuse parts of this distribution only within the terms of ;# that same Artistic Licence; a copy of which may be found at the root ;# of the source tree for dist 4.0. ;# ;# $Log: order.pl,v $ ;# Revision 3.0 1993/08/18 12:10:28 ram ;# Baseline for dist 3.0 netwide release. ;# ;# ;# The @cmdwanted array records the output of the makefile (pick commands only). ;# The shell commands are executed right away. ;# @cmdwanted records the output of the make process (solving dependencies) # Solve dependencies by saving the 'pick' command in @cmdwanted sub solve_dependencies { local(%unitseen); # Record already picked units (avoid duplicates) print "Determining the correct order for the units...\n" unless $opt_s; chdir('.MT') || die "Can't chdir to .MT: $!.\n"; open(MAKE, "make -n |") || die "Can't run make"; while () { s|^\s+||; # Some make print tabs before command print "\t$_" if $opt_v; if (/^pick/) { ($pick,$cmd,$symbol,$unit) = split(' '); push(@cmdwanted,"$cmd $symbol $unit") unless $unitseen{"$cmd:$unit"}++; } elsif (/^cond/) { # Ignore conditional symbol request } else { chop; system; } } chdir($WD) || die "Can't chdir to $WD: $!.\n"; close MAKE; } dist_3.5-30.orig/mcon/pl/files.pl0000644000175000017500000000675611017211070017051 0ustar srivastasrivasta;# $Id: files.pl 23 2008-05-28 08:05:12Z rmanfredi $ ;# ;# Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ;# ;# You may redistribute only under the terms of the Artistic Licence, ;# as specified in the README file that comes with the distribution. ;# You may reuse parts of this distribution only within the terms of ;# that same Artistic Licence; a copy of which may be found at the root ;# of the source tree for dist 4.0. ;# ;# $Log: files.pl,v $ ;# Revision 3.0.1.2 1994/10/29 16:35:48 ram ;# patch36: added user-defined file extension support for lookups ;# ;# Revision 3.0.1.1 1993/10/16 13:54:55 ram ;# patch12: now skip confmagic.h when -M option is used ;# ;# Revision 3.0 1993/08/18 12:10:23 ram ;# Baseline for dist 3.0 netwide release. ;# ;# ;# These two arrays record the file names of the files which may (or may not) ;# contain shell or C symbols known by metaconfig. ;# @SHlist records the .SH files ;# @clist records the C-like files (i.e. .[chyl]) ;# ;# The extensions are actually computed dynamically from the definitions held ;# in the $cext and $shext variables from .package so that people can add new ;# extensions to their packages. For instance, perl5 adds .xs files holding ;# some C symbols. ;# # Extract filenames from manifest sub extract_filenames { &build_filext; # Construct &is_cfile and &is_shfile print "Extracting filenames (C and SH files) from $NEWMANI...\n" unless $opt_s; open(NEWMANI,$NEWMANI) || die "Can't open $NEWMANI.\n"; local($file); while () { ($file) = split(' '); next if $file eq 'config_h.SH'; # skip config_h.SH next if $file eq 'Configure'; # also skip Configure next if $file eq 'confmagic.h' && $opt_M; push(@SHlist, $file) if &is_shfile($file); push(@clist, $file) if &is_cfile($file); } } # Construct two file identifiers based on the file suffix: one for C files, # and one for SH files (using the $cext and $shext variables) defined in # the .package file. # The &is_cfile and &is_shfile routine may then be called to known whether # a given file is a candidate for holding C or SH symbols. sub build_filext { &build_extfun('is_cfile', $cext, '.c .h .y .l'); &build_extfun('is_shfile', $shext, '.SH'); } # Build routine $name to identify extensions listed in $exts, ensuring # that $minimum is at least matched (both to be backward compatible with # older .package and because it is really the minimum requirred). sub build_extfun { local($name, $exts, $minimum) = @_; local(@single); # Single letter dot extensions (may be grouped) local(@others); # Other extensions local(%seen); # Avoid duplicate extensions foreach $ext (split(' ', "$exts $minimum")) { next if $seen{$ext}++; if ($ext =~ s/^\.(\w)$/$1/) { push(@single, $ext); } else { # Convert into perl's regexp $ext =~ s/\./\\./g; # Escape . $ext =~ s/\?/./g; # ? turns into . $ext =~ s/\*/.*/g; # * turns into .* push(@others, $ext); } } local($fn) = &q(<' (because they are ;# not true targets for Makefile). We thus extract all these keys and ;# set the cmaster array accordingly. ;# ;# Obsolete symbols, if any found, are also part of the Wanted file, written on ;# a line starting with a '!', eventually followed by a '>' if the obsolete ;# symbol is a C one. ;# ;# These three data structures record wanted things like commands or symbols. ;# %symwanted{'sym'} is true when the symbol is wanted (transitive closure) ;# %condwanted{'sym'} when the default value of a symbol is requested ;# $wanted records the set of wanted shell symbols (as opposed to C ones) ;# # Build the private makefile we use to compute the transitive closure of the # previously determined dependencies. sub build_makefile { print "Computing optimal dependency graph...\n" unless $opt_s; chdir('.MT') || die "Can't chdir to .MT\n"; local($wanted); # Wanted shell symbols &build_private; # Build a first makefile from dependencies &compute_loadable; # Compute loadable units &update_makefile; # Update makefile using feedback from first pass chdir($WD) || die "Can't chdir back to $WD\n"; # Free memory by removing useless data structures undef $dependencies; undef $saved_dependencies; } # First pass: build a private makefile from the extracted dependency, changing # conditional units to truly wanted ones if the symbol is used, removing the # dependency otherwise. The original dependencies are saved. sub build_private { print " Building private make file...\n" unless $opt_s; open(WANTED,"../Wanted") || die "Can't reopen Wanted.\n"; $wanted = ' ' x 2000; # Pre-extend string $wanted = ''; while () { chop; next if /^!/; # Skip obsolete symbols if (s/^>//) { $cmaster{$_}++; } else { $wanted .= "$_ "; } } close WANTED; # The wanted symbols are sorted so that d_* (checking for C library symbol) # come first and i_* (checking for includes) comes at the end. Grouping the # d_* symbols together has good chances of improving the locality of the # other questions and i_* symbols must come last since some depend on h_* # values which prevent incompatible headers inclusions. $wanted = join(' ', sort symbols split(' ', $wanted)); # Now generate the first makefile, which will be used to determine which # symbols we really need, so that conditional dependencies may be solved. open(MAKEFILE,">Makefile") || die "Can't create .MT/Makefile.\n"; print MAKEFILE "SHELL = /bin/sh\n"; print MAKEFILE "W = $wanted\n"; $saved_dependencies = $dependencies; foreach $sym (@Cond) { if ($symwanted{$sym}) { $dependencies =~ s/\+($sym\s)/$1/gm; } else { $dependencies =~ s/\+$sym(\s)/$1/gm; } } print MAKEFILE $dependencies; close MAKEFILE; } # Ordering for symbols. Give higher priority to d_* ones and lower to i_* ones. # If any layout priority is defined in %Layout, it is used to order the # symbols. sub symbols { local($r) = $Layout{$a} <=> $Layout{$b}; return $r if $r; # If we come here, both symbols have the same layout priority. if ($a =~ /^d_/) { return -1 unless $b =~ /^d_/; } elsif ($b =~ /^d_/) { return 1; } elsif ($a =~ /^i_/) { return 1 unless $b =~ /^i_/; } elsif ($b =~ /^i_/) { return -1; } $a cmp $b; } # Run the makefile produced in the first pass to find the whole set of units we # have to load, filling in the %symwanted and %condwanted structures. sub compute_loadable { print " Determining loadable units...\n" unless $opt_s; open(MAKE, "make -n |") || die "Can't run make"; while () { s|^\s+||; # Some make print tabs before command if (/^pick/) { print "\t$_" if $opt_v; ($pick,$cmd,$symbol,$unit) = split(' '); $symwanted{$symbol}++; $symwanted{$unit}++; } elsif (/^cond/) { print "\t$_" if $opt_v; ($pick,@symbol) = split(' '); for (@symbol) { $condwanted{$_}++; # Default value is requested } } } close MAKE; } # Now that we know all the desirable symbols, we have to rebuild # another makefile, in order to have the units in a more optimal # way. # Actually, if we have both ?MAKE:a:+b and ?MAKE:d:b and 'd' is # wanted; then 'b' will be loaded. However, 'b' is a conditional # dependency for 'a', and it would be better if 'b' were loaded # before 'a' is, though this is not necessary. # It is hard to know that 'b' will be loaded *before* the first make. # Back to the original dependencies, make loadable units truly wanted ones and # remove optional ones. sub update_makefile { print " Updating make file...\n" unless $opt_s; open(MAKEFILE,">Makefile") || die "Can't create .MT/Makefile.\n"; print MAKEFILE "SHELL = /bin/sh\n"; print MAKEFILE "W = $wanted\n"; foreach $sym (@Cond) { if ($symwanted{$sym}) { $saved_dependencies =~ s/\+($sym\s)/$1/gm; } else { $saved_dependencies =~ s/\+$sym(\s)/$1/gm; } } print MAKEFILE $saved_dependencies; close MAKEFILE; } dist_3.5-30.orig/mcon/pl/eval.pl0000644000175000017500000001776610473316164016720 0ustar srivastasrivasta;# $Id: eval.pl 1 2006-08-24 12:32:52Z rmanfredi $ ;# ;# Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ;# ;# You may redistribute only under the terms of the Artistic Licence, ;# as specified in the README file that comes with the distribution. ;# You may reuse parts of this distribution only within the terms of ;# that same Artistic Licence; a copy of which may be found at the root ;# of the source tree for dist 4.0. ;# ;# $Log: eval.pl,v $ ;# Revision 3.0.1.1 1995/01/30 14:48:37 ram ;# patch49: removed old "do name()" routine call constructs ;# ;# Revision 3.0 1993/08/18 12:10:22 ram ;# Baseline for dist 3.0 netwide release. ;# ;# ;# The built-in interpreter ;# package interpreter; # States used by our interpeter -- in sync with @Keep sub main'init_keep { # Status in which we keep lines -- $Keep[$status] @Keep = (0, 1, 1, 0, 1); # Available status ($status) $SKIP = 0; $IF = 1; $ELSE = 2; $NOT = 3; $OUT = 4; } # Priorities for operators -- magic numbers :-) sub main'init_priority { $Priority{'&&'} = 4; $Priority{'||'} = 3; } # Initializes the state stack of the interpreter sub main'init_interp { @state = (); push(@state, $OUT); } # Print error messages -- asssumes $unit and $. correctly set. sub error { warn "\"$main'file\", line $.: @_.\n"; } # If some states are still in the stack, warn the user sub main'check_state { &error("one statement pending") if $#state == 1; &error("$#state statements pending") if $#state > 1; } # Add a value on the stack, modified by all the monadic operators. # We use the locals @val and @mono from eval_expr. sub push_val { local($val) = shift(@_); while ($#mono >= 0) { # Cheat... the only monadic operator is '!'. pop(@mono); $val = !$val; } push(@val, $val); } # Execute a stacked operation, leave result in stack. # We use the locals @val and @op from eval_expr. # If the value stack holds only one operand, do nothing. sub execute { return unless $#val > 0; local($op) = pop(@op); local($val1) = pop(@val); local($val2) = pop(@val); push(@val, eval("$val1 $op $val2") ? 1: 0); } # Given an operator, either we add it in the stack @op, because its # priority is lower than the one on top of the stack, or we first execute # the stacked operations until we reach the end of stack or an operand # whose priority is lower than ours. # We use the locals @val and @op from eval_expr. sub update_stack { local($op) = shift(@_); # Operator if (!$Priority{$op}) { &error("illegal operator $op"); return; } else { if ($#val < 0) { &error("missing first operand for '$op' (diadic operator)"); return; } # Because of the special behaviour of do-SUBR with the while modifier, # I'm using a while-BLOCK construct. I consider this to be a bug of perl # 4.0 PL19, although it is clearly documented in the man page. while ( $Priority{$op[$#op]} > $Priority{$op} # Higher priority op && $#val > 0 # At least 2 values ) { &execute; # Execute an higher priority stacked operation } push(@op, $op); # Everything at higher priority has been executed } } # This is the heart of our little interpreter. Here, we evaluate # a logical expression and return its value. sub eval_expr { local(*expr) = shift(@_); # Expression to parse local(@val) = (); # Stack of values local(@op) = (); # Stack of diadic operators local(@mono) =(); # Stack of monadic operators local($tmp); $_ = $expr; while (1) { s/^\s+//; # Remove spaces between words # The '(' construct if (s/^\(//) { &push_val(&eval_expr(*_)); # A final '\' indicates an end of line &error("missing final parenthesis") if !s/^\\//; } # Found a ')' or end of line elsif (/^\)/ || /^$/) { s/^\)/\\/; # Signals: left parenthesis found $expr = $_; # Remove interpreted stuff &execute() while $#val > 0; # Executed stacked operations while ($#op >= 0) { $_ = pop(@op); &error("missing second operand for '$_' (diadic operator)"); } return $val[0]; } # A perl statement '{{' elsif (s/^\{\{//) { if (s/^(.*)\}\}//) { &push_val((system ('perl','-e', "if ($1) {exit 0;} else {exit 1;}" ))? 0 : 1); } else { &error("incomplete perl statement"); } } # A shell statement '{' elsif (s/^\{//) { if (s/^(.*)\}//) { &push_val((system ("if $1 >/dev/null 2>&1; then exit 0; else exit 1; fi" ))? 0 : 1); } else { &error("incomplete shell statement"); } } # Operator '||' and '&&' elsif (s/^(\|\||&&)//) { $tmp = $1; # Save for perl5 (Dataloaded update_stack) &update_stack($tmp); } # Unary operator '!' elsif (s/^!//) { push(@mono,'!'); } # Everything else is a test for a defined value elsif (s/^([\?%]?\w+)//) { $tmp = $1; # Test for wanted if ($tmp =~ s/^\?//) { &push_val(($main'symwanted{$tmp})? 1 : 0); } # Test for conditionally wanted elsif ($tmp =~ s/^%//) { &push_val(($main'condwanted{$tmp})? 1 : 0); } # Default: test for definition (see op @define) else { &push_val(( $main'symwanted{$tmp} || $main'cmaster{$tmp} || $main'userdef{$tmp}) ? 1 : 0); } } # An error occured -- we did not recognize the expression else { s/^([^\s\(\)\{\|&!]+)//; # Skip until next meaningful char } } } # Given an expression in a '@' command, returns a boolean which is # the result of the evaluation. Evaluate is collecting all the lines # in the expression into a single string, and then calls eval_expr to # really evaluate it. sub evaluate { local($val); # Value returned local($expr) = ""; # Expression to be parsed chop; while (s/\\$//) { # While end of line escaped $expr .= $_; $_ = ; # Fetch next line unless ($_) { &error("EOF in expression"); last; } chop; } $expr .= $_; while ($expr ne '') { $val = &eval_expr(*expr); # Expression will be modified # We return from eval_expr either when a closing parenthisis # is found, or when the expression has been fully analysed. &error("extra closing parenthesis ignored") if $expr ne ''; } $val; } # Given a line, we search for commands (lines starting with '@'). # If there is no command in the line, then we return the boolean state. # Otherwise, the command is analysed and a new state is computed. # The returned value of interpret is 1 if the line is to be printed. sub main'interpret { local($value); local($status) = $state[$#state]; # Current status if (s|^\s*@\s*(\w+)\s*(.*)|$2|) { local($cmd) = $1; $cmd =~ y/A-Z/a-z/; # Canonicalize to lower case # The 'define' command if ($cmd eq 'define') { chop; $userdef{$_}++ if $Keep[$status]; return 0; } # The 'if' command elsif ($cmd eq 'if') { # We always evaluate, in order to find possible errors $value = &evaluate($_); if (!$Keep[$status]) { # We have to skip until next 'end' push(@state, $SKIP); # Record structure return 0; } if ($value) { # True push(@state, $IF); return 0; } else { # False push(@state, $NOT); return 0; } } # The 'else' command elsif ($cmd eq 'else') { &error("expression after 'else' ignored") if /\S/; $state[$#state] = $SKIP if $state[$#state] == $IF; return 0 if $state[$#state] == $SKIP; if ($state[$#state] == $OUT) { &error("unexpected 'else'"); return 0; } $state[$#state] = $ELSE; return 0; } # The 'elsif' command elsif ($cmd eq 'elsif') { # We always evaluate, in order to find possible errors $value = &evaluate($_); $state[$#state] = $SKIP if $state[$#state] == $IF; return 0 if $state[$#state] == $SKIP; if ($state[$#state] == $OUT) { &error("unexpected 'elsif'"); return 0; } if ($value) { # True $state[$#state] = $IF; return 0; } else { # False $state[$#state] = $NOT; return 0; } } # The 'end' command elsif ($cmd eq 'end') { &error("expression after 'end' ignored") if /\S/; pop(@state); &error("unexpected 'end'") if $#state < 0; return 0; } # Unknown command else { &error("unknown command '$cmd'"); return 0; } } $Keep[$status]; } package main; dist_3.5-30.orig/mcon/pl/wanted.pl0000644000175000017500000002146110473316164017236 0ustar srivastasrivasta;# $Id: wanted.pl 1 2006-08-24 12:32:52Z rmanfredi $ ;# ;# Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ;# ;# You may redistribute only under the terms of the Artistic Licence, ;# as specified in the README file that comes with the distribution. ;# You may reuse parts of this distribution only within the terms of ;# that same Artistic Licence; a copy of which may be found at the root ;# of the source tree for dist 4.0. ;# ;# $Log: wanted.pl,v $ ;# Revision 3.0.1.2 1995/01/11 15:42:37 ram ;# patch45: added % in front of hash table names for perl5's each() (ADO) ;# patch45: tell users about possible extra file-extension lookups ;# ;# Revision 3.0.1.1 1993/10/16 13:56:05 ram ;# patch12: modified to handle ?M: lines ;# patch12: added warning when magic symbols used without proper config ;# ;# Revision 3.0 1993/08/18 12:10:29 ram ;# Baseline for dist 3.0 netwide release. ;# ;# ;# These two arrays record the file names of the files which may (or may not) ;# contain shell or C symbols known by metaconfig. ;# @SHlist records the .SH files ;# @clist records the C-like files (i.e. .[chyl]) ;# ;# These files are scanned in turn to see how many symbols known by metaconfig ;# they have. Those symbols are gathered in a Wanted file. As C symbols are ;# not true targets for the forthcoming Makefile, a ">" sign is prepended. ;# Finally, the obsolete symbols are preceded by a "!". ;# ;# When obsolete symbols are found, they are dumped in file 'Obsolete'. Two ;# files are created anyway in the .MT directory. Obsol_h.U and Obsol_sh.U which ;# respectively list the obsoleted symbols (C and shell ones). ;# Obsol_h.U records obsolete C symbols ;# Obsol_sh.U records obsolete shell symbols ;# ;# The manifake() routine has to be provided externally. ;# # Build a wanted file from the files held in @SHlist and @clist arrays sub build_wanted { # If wanted file is already there, parse it to map obsolete if -o option # was used. Otherwise, build a new one. if (-f 'Wanted') { &map_obsolete if $opt_o; # Build Obsol*.U files &dump_obsolete; # Dump obsolete symbols if any return; } &parse_files; } sub parse_files { print "Building a Wanted file...\n" unless $opt_s; open(WANTED,"| sort | uniq >Wanted") || die "Can't create Wanted.\n"; unless (-f $NEWMANI) { &manifake; die "No $NEWMANI--can't build a Wanted file.\n" unless -f $NEWMANI; } local($search); # Where to-be-evaled script is held local($_) = ' ' x 50000 if $opt_m; # Pre-extend pattern search space local(%visited); # Records visited files local(%lastfound); # Where last occurence of key was # Now we are a little clever, and build a loop to eval so that we don't # have to recompile our patterns on every file. We also use "study" since # we are searching the same string for many different things. Hauls! if (@clist) { local($others) = $cext ? " $cext" : ''; print " Scanning .[chyl]$others files for symbols...\n" unless $opt_s; $search = ' ' x (40 * (@cmaster + @ocmaster)); # Pre-extend $search = "while (<>) {study;\n"; # Init loop over ARGV foreach $key (keys(%cmaster)) { $search .= "&cmaster('$key') if /\\b$key\\b/;\n"; } foreach $key (grep(!/^\$/, keys %Obsolete)) { $search .= "&ofound('$key') if /\\b$key\\b/;\n"; } $search .= "}\n"; # terminate loop print $search if $opt_d; @ARGV = @clist; # Swallow each file as a whole, if memory is available undef $/ if $opt_m; eval $search; eval ''; $/ = "\n"; while (($key,$value) = each(%cmaster)) { print WANTED $cwanted{$key}, "\n", ">$key", "\n" if $value; } } # If they don't use magic but use magically guarded symbols without # their corresponding C symbol dependency, warn them, since they might # not know about that portability issue. if (@clist && !$opt_M) { local($nused); # list of non-used symbols local($warning) = 0; # true when one warning issued foreach $cmag (keys %mwanted) { # loop over all used magic symbols next unless $cmaster{$cmag}; $nused = ''; foreach $cdep (split(' ', $mwanted{$cmag})) { $nused .= " $cdep" unless $cmaster{$cdep}; } $nused =~ s/^ //; $nused = "one of " . $nused if $nused =~ s/ /, /g; if ($nused ne '') { print " Warning: $cmag is used without $nused.\n"; $warning++; } } if ($warning) { local($those) = $warning == 1 ? 'that' : 'those'; local($s) = $warning == 1 ? '' : 's'; print "Note: $those previous warning$s may be suppressed by -M.\n"; } } # Cannot remove $cmaster as it is used later on when building Configure undef @clist; undef %cwanted; undef %mwanted; %visited = (); %lastfound = (); if (@SHlist) { local($others) = $shext ? " $shext" : ''; print " Scanning .SH$others files for symbols...\n" unless $opt_s; $search = ' ' x (40 * (@shmaster + @oshmaster)); # Pre-extend $search = "while (<>) {study;\n"; # All the keys already have a leading '$' foreach $key (keys(%shmaster)) { $search .= "&shmaster('$key') if /\\$key\\b/;\n"; } foreach $key (grep (/^\$/, keys %Obsolete)) { $search .= "&ofound('$key') if /\\$key\\b/;\n"; } $search .= "}\n"; print $search if $opt_d; @ARGV = @SHlist; # Swallow each file as a whole, if memory is available undef $/ if $opt_m; eval $search; eval ''; $/ = "\n"; while (($key,$value) = each(%shmaster)) { if ($value) { $key =~ s/^\$//; print WANTED $key, "\n"; } } } # Obsolete symbols, if any, are written in the Wanted file preceded by a # '!' character. In case -w is used, we'll thus be able to correctly build # the Obsol_h.U and Obsol_sh.U files. &add_obsolete; # Add obsolete symbols in Wanted file close WANTED; # If obsolete symbols where found, write an Obsolete file which lists where # each of them appear and the new symbol to be used. Also write Obsol_h.U # and Obsol_sh.U in .MT for later perusal. &dump_obsolete; # Dump obsolete symbols if any die "No desirable symbols found--aborting.\n" unless -s 'Wanted'; # Clean-up memory by freeing useless data structures undef @SHlist; undef %shmaster; } # This routine records matches of C master keys sub cmaster { local($key) = @_; $cmaster{$key}++; # This symbol is wanted return unless $opt_t || $opt_M; # Return if neither -t nor -M if ($opt_t && $lastfound{$key} ne $ARGV # Never mentionned for this file ? ) { $visited{$ARGV}++ || print $ARGV,":\n"; print "\t$key\n"; $lastfound{$key} = $ARGV; } if ($opt_M && defined($mwanted{$key}) # Found a ?M: symbol ) { foreach $csym (split(' ', $mwanted{$key})) { $cmaster{$csym}++; # Activate C symbol dependencies } } } # This routine records matches of obsolete keys (C or shell) sub ofound { local($key) = @_; local($_) = $Obsolete{$key}; # Value of new symbol $ofound{"$ARGV $key $_"}++; # Record obsolete match $cmaster{$_}++ unless /^\$/; # A C hit $shmaster{$_}++ if /^\$/; # Or a shell one return unless $opt_t; # Continue if trace option on if ($lastfound{$key} ne $ARGV) { # Never mentionned for this file ? $visited{$ARGV}++ || print $ARGV,":\n"; print "\t$key (obsolete, use $_)\n"; $lastfound{$key} = $ARGV; } } # This routine records matches of shell master keys sub shmaster { local($key) = @_; $shmaster{$key}++; # This symbol is wanted return unless $opt_t; # Continue if trace option on if ($lastfound{$key} ne $ARGV) { # Never mentionned for this file ? $visited{$ARGV}++ || print $ARGV,":\n"; print "\t$key\n"; $lastfound{$key} = $ARGV; } } # Write obsolete symbols into the Wanted file for later perusal by -w. sub add_obsolete { local($file); # File where obsolete symbol was found local($old); # Name of this old symbol local($new); # Value of the new symbol to be used foreach $key (sort keys %ofound) { ($file, $old, $new) = ($key =~ /^(\S+)\s+(\S+)\s+(\S+)/); if ($new =~ s/^\$//) { # We found an obsolete shell symbol print WANTED "!$old\n"; } else { # We found an obsolete C symbol print WANTED "!>$old\n"; } } } # Map obsolete symbols from Wanted file into %Obsolete and call dump_obsolete # to actually build the Obsol_sh.U and Obsol_h.U files. Those will be needed # during the Configure building phase to actually do the remaping. # The obsolete symbols found are entered in the %ofound array, tagged as from # file 'XXX', which is specially recognized by dump_obsolete. sub map_obsolete { open(WANTED, 'Wanted') || die "Can't open Wanted file.\n"; local($new); # New symbol to be used instead of obsolete one while () { chop; next unless s/^!//; # Skip non-obsolete symbols if (s/^>//) { # C symbol $new = $Obsolete{$_}; # Fetch new symbol $ofound{"XXX $_ $new"}++; # Record obsolete match (XXX = no file) } else { # Shell symbol $new = $Obsolete{"\$$_"}; # Fetch new symbol $ofound{"XXX \$$_ $new"}++; # Record obsolete match (XXX = no file) } } close WANTED; } dist_3.5-30.orig/mcon/pl/tsort.pl0000644000175000017500000001324710473316164017132 0ustar srivastasrivasta;# $Id: tsort.pl 1 2006-08-24 12:32:52Z rmanfredi $ ;# ;# Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ;# ;# You may redistribute only under the terms of the Artistic Licence, ;# as specified in the README file that comes with the distribution. ;# You may reuse parts of this distribution only within the terms of ;# that same Artistic Licence; a copy of which may be found at the root ;# of the source tree for dist 4.0. ;# ;# $Log: tsort.pl,v $ ;# Revision 3.0 1993/08/18 12:10:28 ram ;# Baseline for dist 3.0 netwide release. ;# ;# ;# The topological sort is performed using the following algorithm: ;# ;# We have a list of successors for each item; makefile dependencies of ;# the form 'a b: c d' means successors(a) = successors(b) = { c, d }. ;# From that input, we derive a number of precursors for each item. ;# In our simple example above, c and d both have two precursors and ;# a and b have none. Items with no precursors are called outsiders ;# and are left in a pool. The sort is then initiated and will continue ;# until all the items have been sorted or a cycle is found... ;# ;# Outsiders are ready to be sorted; since the topological sort is a partial ;# order, an external criterion is needed to choose one item among the ones ;# in the pool. That item is assigned a number, and the number of precursors ;# for the remaining items is updated (by following the successors of the ;# sorted item and decrementing the value for each successor). Among those, ;# if any item reaches a precursor count of zero, it becomes an outsider. ;# ;# The algorithm ends when the outsider pool is empty. If it becomes empty and ;# some items remain unsorted, then there is one or more cycles among them. ;# One way to outline that cycle first extract all those items whose precursor ;# count is minimal then visit their dependency graph to find the cycle, ;# extract only those items belonging to the cycle into the outsiders set and ;# resume the main processing stream. ;# # # Topological sort of Makefile dependencies with cycle enhancing. # package tsort; # Perform the topological sort of the items and outline cycles. sub main'tsort { local(*Succ, *Prec) = @_; # Tables of succesors and predecessors local(@Out); # The outsider set local(@keys); # Current active precursors local($item); # Item to sort for (@keys = keys %Prec; @keys || @Out; @keys = keys %Prec) { &resync; # Resynchronize outsiders if (@Out == 0) { # Cycle detected &extract_cycle(*Prec, *Succ); next; } $item = shift(@Out); # Sort current item (don't care which one) &sort($item); # Update internal structures } } # Resynchronize the outsiders stack (those items that have no more precursors). # If the outsiders stack becomes empty, then there is a cycle. sub resync { foreach $target (keys %Prec) { if ($Prec{$target} == 0) { delete $Prec{$target}; # We're done with this item push(@Out, $target); # Ready to be sorted } } } # Sort item sub sort { local($item) = @_; print "(ok) $item\n" if $main'opt_d && !$Cycle; print "(fx) $item\n" if $main'opt_d && $Cycle; foreach $succ (split(' ', $Succ{$item})) { # The test for definedness is necessary, since when a cycle is found, # one item is forced out of %Prec. If we had the guarantee of no # cycle, the the test would not be necessary and no decrementation # could go past 0. $Prec{$succ}-- if defined $Prec{$succ}; } } # Extract cycle... We look through the %Prec array and find all those items # with the same lowest value. Those are a cycle, so we dump them, and make # them new outsiders by resetting their count to 0. sub extract_cycle { local(*Prec, *Succ) = @_; local($item) = (&sort_by_value(*Prec))[0]; local($min) = $Prec{$item}; # Minimum value local($key, $value); local(%candidate); # Superset of the cycle we found warn " Cycle found for:\n"; $Cycle++; while (($key, $value) = each %Prec) { $candidate{$key}++ if $value == $min; } local(%state); # State of visited nodes (1 = cycle, -1 = dead) local($CYCLE) = 1; # Possible member of a cycle local($DEAD) = -1; # Dead end, no cycling possible foreach $key (keys %candidate) { last if $CYCLE == &visit($key, $Succ{$key}); } while (($key, $value) = each %candidate) { next unless $state{$key} == $CYCLE; $Prec{$key} = 0; # Members of cycle are new outsiders warn "\t(#$Cycle) $key\n"; } local(%involved); # Items involved in the cycle... while (($key, $value) = each %state) { $involved{$key}++ if $state{$key} == $CYCLE; } &outline_cycle(*Succ, *involved); } sub outline_cycle { local(*Succ, *member) = @_; local($key, $value); local($depends); local($unit); warn " Cycle involves:\n"; while (($key, $value) = each %Succ) { next unless $member{$key}; $depends = ''; foreach $item (split(' ', $value)) { $depends .= "$item " if $member{$item}; } $unit = $main'shmaster{"\$$key"}; $unit =~ s/\s+$//; $unit = '?' if $unit eq ''; warn "\t($unit) $key: $depends\n"; } } # Visit a tree node, following all its successors, until we find a cycle. # Return $CYCLE if the exploration of the node leaded to a cycle, $DEAD # otherwise. sub visit { local($node, $children) = @_; # A node and its children # If we have already visited the node, return the status value attached # to it. return $state{$node} if $state{$node}; $state{$node} = $CYCLE; # Assume member of cycle local($all_dead) = 1; # Set to 0 if at least one cycle found foreach $child (split(' ', $children)) { $all_dead = 0 if $CYCLE == &visit($child, $Succ{$child}); } $state{$node} = $DEAD if $all_dead; $state{$node}; } # Sort associative array by value sub sort_by_value { local(*x) = @_; sub _by_value { $x{$a} <=> $x{$b}; } sort _by_value keys %x; } package main; 1; dist_3.5-30.orig/mcon/pl/xref.pl0000644000175000017500000000417110473316164016717 0ustar srivastasrivasta;# $Id: xref.pl 1 2006-08-24 12:32:52Z rmanfredi $ ;# ;# Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ;# ;# You may redistribute only under the terms of the Artistic Licence, ;# as specified in the README file that comes with the distribution. ;# You may reuse parts of this distribution only within the terms of ;# that same Artistic Licence; a copy of which may be found at the root ;# of the source tree for dist 4.0. ;# ;# $Log: xref.pl,v $ ;# Revision 3.0.1.2 1995/09/25 09:20:05 ram ;# patch59: added empty p_layout stub for new ?Y: directives ;# ;# Revision 3.0.1.1 1993/10/16 13:56:23 ram ;# patch12: declared p_public for ?P: lines ;# ;# Revision 3.0 1993/08/18 12:10:31 ram ;# Baseline for dist 3.0 netwide release. ;# ;# Metaxref-dependent part of the dependency extranction. ;# # Process the ?W: lines sub p_wanted { # Syntax is ?W:: local($active) = $_[0] =~ /^([^:]*):/; # Symbols to activate local($look_symbols) = $_[0] =~ /:(.*)/; # When those are used local(@syms) = split(/ /, $look_symbols); # Keep original spacing info $active =~ s/\s+/\n/g; # One symbol per line # Concatenate quoted strings, so saying something like 'two words' will # be introduced as one single symbol "two words". local(@symbols); # Concatenated symbols to look for local($concat) = ''; # Concatenation buffer foreach (@syms) { if (s/^\'//) { $concat = $_; } elsif (s/\'$//) { push(@symbols, $concat . ' ' . $_); $concat = ''; } else { push(@symbols, $_) unless $concat; $concat .= ' ' . $_ if $concat; } } local($fake); # Fake unique shell symbol to reparent C symbol # Now record symbols in master and wanted tables foreach (@symbols) { $cmaster{$_} = undef; # Asks for look-up in C files # Make a fake C symbol and associate that with the wanted symbol # so that later we know were it comes from $fake = &gensym; $cwanted{$_} = "$fake"; # Attached to this symbol push(@Master, "?$unit:$fake=''"); # Fake initialization } } # Ingnore the following: sub p_init {} sub p_default {} sub p_library {} sub p_include {} sub p_public {} sub p_layout {} dist_3.5-30.orig/mcon/pl/locate.pl0000644000175000017500000001343510473316164017225 0ustar srivastasrivasta;# $Id: locate.pl 1 2006-08-24 12:32:52Z rmanfredi $ ;# ;# Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ;# ;# You may redistribute only under the terms of the Artistic Licence, ;# as specified in the README file that comes with the distribution. ;# You may reuse parts of this distribution only within the terms of ;# that same Artistic Licence; a copy of which may be found at the root ;# of the source tree for dist 4.0. ;# ;# $Log: locate.pl,v $ ;# Revision 3.0.1.1 1994/10/29 16:36:52 ram ;# patch36: misspelled a 'closedir' as a 'close' statement ;# ;# Revision 3.0 1993/08/18 12:10:25 ram ;# Baseline for dist 3.0 netwide release. ;# ;# ;# Locate units and put them in the @ARGV array, for later perusal. We first ;# look in the private U directory, then in the public U library. In each U ;# directory, units may be gathered in clusters (directories). These clusters ;# should not have a name ending with .U, as those will never be stat()'ed. ;# ;# NB: Currently, the clusters are only a practical way of grouping a set of ;# closely related units. There must not be any name conflicts. ;# ;# The following variables are used: ;# $WD is assumed to be the working directory (where the process was spawned) ;# $MC is the location of metaconfig's public library ;# @ARGV is the list of all the units full path ;# %Unit maps an unit name (without final .U) to a path ;# @myUlist lists the user's units, which will be appended at the end of @ARGV ;# %myUseen lists the user's units which overwrite public ones ;# package locate; # Locate the units and push their path in @ARGV (sorted alphabetically) sub main'locate_units { print "Locating units...\n" unless $main'opt_s; local(*WD) = *main'WD; # Current working directory local(*MC) = *main'MC; # Public metaconfig library undef %myUlist; # Records private units paths undef %myUseen; # Records private/public conflicts &private_units; # Locate private units in @myUlist &public_units; # Locate public units in @ARGV @ARGV = sort @ARGV; # Sort it alphabetically push(@ARGV, sort @myUlist); # Append user's units sorted &dump_list if $main'opt_v; # Dump the list of units } # Dump the list of units on stdout sub dump_list { print "\t"; $, = "\n\t"; print @ARGV; $, = ''; print "\n"; } # Scan private units sub private_units { return unless -d 'U'; # Nothing to be done if no 'U' entry local(*ARGV) = *myUlist; # Really fill in @myUlist local($MC) = $WD; # We are really in the working directory &units_path("U"); # Locate units in the U directory local($unit_name); # Unit's name (without .U) local(@kept); # Array of kept units # Loop over the units and remove duplicates (the first one seen is the one # we keep). Also set the %myUseen H table to record private units seen. foreach (@ARGV) { ($unit_name) = m|^.*/(.*)\.U$|; # Get unit's name from path next if $myUseen{$unit_name}; # Already recorded $myUseen{$unit_name} = 1; # Record pirvate unit push(@kept, $_); # Keep this unit } @ARGV = @kept; } # Scan public units sub public_units { chdir($MC) || die "Can't find directory $MC.\n"; &units_path("U"); # Locate units in public U directory chdir($WD) || die "Can't go back to directory $WD.\n"; local($path); # Relative path from $WD local($unit_name); # Unit's name (without .U) local(*Unit) = *main'Unit; # Unit is a global from main package local(@kept); # Units kept local(%warned); # Units which have already issued a message # Loop over all the units and keep only the ones that were not found in # the user's U directory. As it is possible two or more units with the same # name be found in foreach (@ARGV) { ($unit_name) = m|^.*/(.*)\.U$|; # Get unit's name from path next if $warned{$unit_name}; # We have already seen this unit $warned{$unit_name} = 1; # Remember we have warned the user if ($myUseen{$unit_name}) { # User already has a private unit $path = $Unit{$unit_name}; # Extract user's unit path next if $path eq $_; # Same path, we must be in mcon/ $path =~ s|^$WD/||o; # Weed out leading working dir path print " Your private $path overrides the public one.\n" unless $main'opt_s; } else { push(@kept, $_); # We may keep this one } } @ARGV = @kept; } # Recursively locate units in the directory. Each file ending with .U has to be # a unit. Others are stat()'ed, and if they are a directory, they are also # scanned through. The $MC and @ARGV variable are dynamically set by the caller. sub units_path { local($dir) = @_; # Directory where units are to be found local(@contents); # Contents of the directory local($unit_name); # Unit's name, without final .U local($path); # Full path of a unit local(*Unit) = *main'Unit; # Unit is a global from main package unless (opendir(DIR, $dir)) { warn("Cannot open directory $dir.\n"); return; } print "Locating in $MC/$dir...\n" if $main'opt_v; @contents = readdir DIR; # Slurp the whole thing closedir DIR; # And close dir, ready for recursion foreach (@contents) { next if $_ eq '.' || $_ eq '..'; if (/\.U$/) { # A unit, definitely ($unit_name) = /^(.*)\.U$/; $path = "$MC/$dir/$_"; # Full path of unit push(@ARGV, $path); # Record its path if (defined $Unit{$unit_name}) { # Already seen this unit if ($main'opt_v) { ($path) = $Unit{$unit_name} =~ m|^(.*)/.*|; print " We've already seen $unit_name.U in $path.\n"; } } else { $Unit{$unit_name} = $path; # Map name to path } next; } # We have found a file which does not look like a unit. If it is a # directory, then scan it. Otherwise skip the file. unless (-d "$dir/$_") { print " Skipping file $_ in $dir.\n" if $main'opt_v; next; } &units_path("$dir/$_"); print "Back to $MC/$dir...\n" if $main'opt_v; } } package main; dist_3.5-30.orig/mcon/pl/gensym.pl0000644000175000017500000000133310473316164017252 0ustar srivastasrivasta;# $Id: gensym.pl 1 2006-08-24 12:32:52Z rmanfredi $ ;# ;# Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ;# ;# You may redistribute only under the terms of the Artistic Licence, ;# as specified in the README file that comes with the distribution. ;# You may reuse parts of this distribution only within the terms of ;# that same Artistic Licence; a copy of which may be found at the root ;# of the source tree for dist 4.0. ;# ;# $Log: gensym.pl,v $ ;# Revision 3.0 1993/08/18 12:10:24 ram ;# Baseline for dist 3.0 netwide release. ;# ;# # Create a new symbol name each time it is invoked. That name is suitable for # usage as a perl variable name. sub gensym { $Gensym = 'AAAAA' unless $Gensym; $Gensym++; } dist_3.5-30.orig/mcon/pl/obsolete.pl0000644000175000017500000000727710473316164017601 0ustar srivastasrivasta;# $Id: obsolete.pl 1 2006-08-24 12:32:52Z rmanfredi $ ;# ;# Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ;# ;# You may redistribute only under the terms of the Artistic Licence, ;# as specified in the README file that comes with the distribution. ;# You may reuse parts of this distribution only within the terms of ;# that same Artistic Licence; a copy of which may be found at the root ;# of the source tree for dist 4.0. ;# ;# $Log: obsolete.pl,v $ ;# Revision 3.0.1.1 1995/01/30 14:49:22 ram ;# patch49: random clean-up in &record_obsolete ;# ;# Revision 3.0 1993/08/18 12:10:27 ram ;# Baseline for dist 3.0 netwide release. ;# ;# ;# Deal with obsolete symbols. They are recorded in the %Obsolete array. ;# Optionally, the obsolete symbols may be remaped onto the new ones (option ;# -o), which enables smooth evolution from 2.0. ;# # Record obsolete symbols association (new versus old), that is to say for a # given old symbol, $Obsolete{'old'} = new symbol to be used. A '$' is prepended # for all shell variables sub record_obsolete { local($_) = @_; local(@obsoleted); # List of obsolete symbols local($symbol); # New symbol which must be used local($dollar) = s/^\$// ? '$':''; # The '$' or a null string # Syntax for obsolete symbols specification is # list of symbols (obsolete ones): if (/^(\w+)\s*\((.*)\)\s*:$/) { $symbol = "$dollar$1"; @obsoleted = split(' ', $2); # List of obsolete symbols } else { if (/^(\w+)\s*\((.*):$/) { warn "\"$file\", line $.: final ')' before ':' missing.\n"; $symbol = "$dollar$1"; @obsoleted = split(' ', $2); } else { warn "\"$file\", line $.: syntax error.\n"; return; } } foreach $val (@obsoleted) { $_ = $dollar . $val; if (defined $Obsolete{$_}) { warn "\"$file\", line $.: '$_' already obsoleted by '$Obsolete{$_}'.\n"; } else { $Obsolete{$_} = $symbol; # Record (old, new) tuple } } } # Dump obsolete symbols used in file 'Obsolete'. Also write Obsol_h.U and # Obsol_sh.U to record old versus new mappings if the -o option was used. sub dump_obsolete { unless (-f 'Obsolete') { open(OBSOLETE, ">Obsolete") || die "Can't create Obsolete.\n"; } open(OBSOL_H, ">.MT/Obsol_h.U") || die "Can't create .MT/Obsol_h.U.\n"; open(OBSOL_SH, ">.MT/Obsol_sh.U") || die "Can't create .MT/Obsol_sh.U.\n"; local($file); # File where obsolete symbol was found local($old); # Name of this old symbol local($new); # Value of the new symbol to be used # Leave a blank line at the top so that anny added ^L will stand on a line # by itself (the formatting process adds a ^L when a new page is needed). format OBSOLETE_TOP = File | Old symbol | New symbol -----------------------------------+----------------------+--------------------- . format OBSOLETE = @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< | @<<<<<<<<<<<<<<<<<<< | @<<<<<<<<<<<<<<<<<<< $file, $old, $new . local(%seen); foreach $key (sort keys %ofound) { ($file, $old, $new) = ($key =~ /^(\S+)\s+(\S+)\s+(\S+)/); write(OBSOLETE) unless $file eq 'XXX'; next unless $opt_o; # Obsolete mapping done only with -o next if $seen{$old}++; # Already remapped, thank you if ($new =~ s/^\$//) { # We found an obsolete shell symbol $old =~ s/^\$//; print OBSOL_SH "$old=\"\$$new\"\n"; } else { # We found an obsolete C symbol print OBSOL_H "#ifdef $new\n"; print OBSOL_H "#define $old $new\n"; print OBSOL_H "#endif\n\n"; } } close OBSOLETE; close OBSOL_H; close OBSOL_SH; if (-s 'Obsolete') { print "*** Obsolete symbols found -- see file 'Obsolete' for a list.\n"; } else { unlink 'Obsolete'; } undef %ofound; # Not needed any more } dist_3.5-30.orig/mcon/pl/xwant.pl0000644000175000017500000001117210473316164017113 0ustar srivastasrivasta;# $Id: xwant.pl 1 2006-08-24 12:32:52Z rmanfredi $ ;# ;# Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ;# ;# You may redistribute only under the terms of the Artistic Licence, ;# as specified in the README file that comes with the distribution. ;# You may reuse parts of this distribution only within the terms of ;# that same Artistic Licence; a copy of which may be found at the root ;# of the source tree for dist 4.0. ;# ;# $Log: xwant.pl,v $ ;# Revision 3.0 1993/08/18 12:10:32 ram ;# Baseline for dist 3.0 netwide release. ;# ;# ;# These two arrays record the file names of the files which may (or may not) ;# contain shell or C symbols known by metaconfig. ;# @SHlist records the .SH files ;# @clist records the C-like files (i.e. .[chyl]) ;# # Parse files and build cross references sub build_xref { print "Building cross-reference files...\n" unless $opt_s; unless (-f $NEWMANI) { &manifake; die "No $NEWMANI--don't know who to scan.\n" unless -f $NEWMANI; } open(FUI, "|sort | uniq >I.fui") || die "Can't create I.fui.\n"; open(UIF, "|sort | uniq >I.uif") || die "Can't create I.uif.\n"; local($search); # Where to-be-evaled script is held local($_) = ' ' x 50000 if $opt_m; # Pre-extend pattern search space local(%visited); # Records visited files local(%lastfound); # Where last occurence of key was # Map shell symbol names to units by reverse engineering the @Master array # which records all the known shell symbols and the units where they # are defined. foreach $init (@Master) { $init =~ /^\?(.*):(.*)=''/ && ($shwanted{"\$$2"} = $1); } # Now we are a little clever, and build a loop to eval so that we don't # have to recompile our patterns on every file. We also use "study" since # we are searching the same string for many different things. Hauls! if (@clist) { print " Scanning .[chyl] files for symbols...\n" unless $opt_s; $search = ' ' x (40 * (@cmaster + @ocmaster)); # Pre-extend $search = "while (<>) {study;\n"; # Init loop over ARGV foreach $key (keys(cmaster)) { $search .= "\$cmaster{'$key'} .= \"\$ARGV#\" if /\\b$key\\b/;\n"; } foreach $key (grep(!/^\$/, keys %Obsolete)) { $search .= "&ofound('$key') if /\\b$key\\b/;\n"; } $search .= "}\n"; # terminate loop print $search if $opt_d; @ARGV = @clist; # Swallow each file as a whole, if memory is available undef $/ if $opt_m; eval $search; eval ''; $/ = "\n"; while (($key,$value) = each(cmaster)) { next if $value eq ''; foreach $file (sort(split(/#/, $value))) { next if $file eq ''; # %cwanted may contain value separated by \n -- take last one @sym = split(/\n/, $cwanted{$key}); $sym = pop(@sym); $shell = "\$$sym"; print FUI pack("A35", $file), pack("A20", "$shwanted{$shell}.U"), $key, "\n"; print UIF pack("A20", "$shwanted{$shell}.U"), pack("A25", $key), $file, "\n"; } } } undef @clist; undef %cwanted; undef %cmaster; # We're not building Configure, we may delete this %visited = (); %lastfound = (); if (@SHlist) { print " Scanning .SH files for symbols...\n" unless $opt_s; $search = ' ' x (40 * (@shmaster + @oshmaster)); # Pre-extend $search = "while (<>) {study;\n"; # All the keys already have a leading '$' foreach $key (keys(shmaster)) { $search .= "\$shmaster{'$key'} .= \"\$ARGV#\" if /\\$key\\b/;\n"; } foreach $key (grep (/^\$/, keys %Obsolete)) { $search .= "&ofound('$key') if /\\$key\\b/;\n"; } $search .= "}\n"; print $search if $opt_d; @ARGV = @SHlist; # Swallow each file as a whole, if memory is available undef $/ if $opt_m; eval $search; eval ''; $/ = "\n"; while (($key,$value) = each(shmaster)) { next if $value eq ''; foreach $file (sort(split(/#/, $value))) { next if $file eq ''; print FUI pack("A35", $file), pack("A20", "$shwanted{$key}.U"), $key, "\n"; print UIF pack("A20", "$shwanted{$key}.U"), pack("A25", $key), $file, "\n"; } } } close FUI; close UIF; # If obsolete symbols where found, write an Obsolete file which lists where # each of them appear and the new symbol to be used. Also write Obsol_h.U # and Obsol_sh.U in .MT for later perusal. &dump_obsolete; # Dump obsolete symbols if any # Clean-up memory by freeing useless data structures undef @SHlist; undef %shmaster; } # This routine records matches of obsolete keys (C or shell) sub ofound { local($key) = @_; local($_) = $Obsolete{$key}; # Value of new symbol $ofound{"$ARGV $key $_"}++; # Record obsolete match $cmaster{$_} .= "$ARGV#" unless /^\$/; # A C hit $shmaster{$_} .= "$ARGV#" if /^\$/; # Or a shell one } dist_3.5-30.orig/mcon/pl/depend.pl0000644000175000017500000001050410473316164017207 0ustar srivastasrivasta;# $Id: depend.pl 1 2006-08-24 12:32:52Z rmanfredi $ ;# ;# Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ;# ;# You may redistribute only under the terms of the Artistic Licence, ;# as specified in the README file that comes with the distribution. ;# You may reuse parts of this distribution only within the terms of ;# that same Artistic Licence; a copy of which may be found at the root ;# of the source tree for dist 4.0. ;# ;# $Log: depend.pl,v $ ;# Revision 3.0.1.3 1995/09/25 09:18:56 ram ;# patch59: new ?Y: directive to change unit layout ;# ;# Revision 3.0.1.2 1994/10/29 16:35:23 ram ;# patch36: added various escapes in strings for perl5 support ;# ;# Revision 3.0.1.1 1993/10/16 13:54:35 ram ;# patch12: added minimal support for ?P: lines (not ready yet) ;# ;# Revision 3.0 1993/08/18 12:10:21 ram ;# Baseline for dist 3.0 netwide release. ;# ;# Metaconfig-dependent part of the dependency extraction. ;# # Process the ?W: lines sub p_wanted { # Syntax is ?W:: local($active) = $_[0] =~ /^([^:]*):/; # Symbols to activate local($look_symbols) = $_[0] =~ /:(.*)/; # When those are used local(@syms) = split(/ /, $look_symbols); # Keep original spacing info $active =~ s/\s+/\n/g; # One symbol per line # Concatenate quoted strings, so saying something like 'two words' will # be introduced as one single symbol "two words". local(@symbols); # Concatenated symbols to look for local($concat) = ''; # Concatenation buffer foreach (@syms) { if (s/^\'//) { $concat = $_; } elsif (s/\'$//) { push(@symbols, $concat . ' ' . $_); $concat = ''; } else { push(@symbols, $_) unless $concat; $concat .= ' ' . $_ if $concat; } } # Now record symbols in master and wanted tables foreach (@symbols) { $cmaster{$_} = undef; # Asks for look-up in C files $cwanted{$_} = "$active" if $active; # Shell symbols to activate } } # Process the ?INIT: lines sub p_init { local($_) = @_; print INIT "?$unit:", $_; # Wanted only if unit is loaded } # Process the ?D: lines sub p_default { local($_) = @_; s/^([A-Za-z_]+)=(.*)/\@if !$1\n%$1:$1=$2\n\@define $1\n\@end/ && ($hasdefault{$1}++, print INIT $_); } # Process the ?P: lines sub p_public { local($_) = @_; local($csym); # C symbol(s) we're trying to look at local($nosym); # List of symbol(s) which mustn't be wanted local($cfile); # Name of file implementing csym (no .ext) ($csym, $nosym, $cfile) = /([^()]+)\s*(\(.*\))\s*:\s*(\S+)/; unless ($csym eq '' || $cfile eq '') { # Add dependencies for each C symbol, of the form: # -pick public # and the file will be added to config.c whenever sym is wanted and # none of the notdef symbols is wanted. foreach $sym (split(' ', $csym)) { $dependencies .= "\t-pick public $sym $cfile $nosym\n"; } } } # Process the ?Y: lines # Valid layouts are for now are: top, bottom, default. # # NOTA BENE: # This routine relies on the $defined variable, a global variable set # during the ?MAKE: processing, which lists all the defined symbols in # the unit (the optional leading '+' for internal symbols has been removed # if present). # # The routine fills up a %Layout table, indexed by symbol, yielding the # layout imposed to this unit. That table will then be used later on when # we sort wanted symbols for the Makefile. sub p_layout { local($_) = @_; local($layout) = /^\s*(\w+)/; $layout =~ tr/A-Z/a-z/; # Case is not significant for layouts unless (defined $Lcmp{$layout}) { warn "\"$file\", line $.: unknown layout directive '$layout'.\n"; return; } foreach $sym (split(' ', $defined)) { $Layout{$sym} = $Lcmp{$layout}; } } # Process the ?L: lines # There should not be any '-l' in front of the library name sub p_library { &write_out("L:$_"); } # Process the ?I: lines sub p_include { &write_out("I:$_"); } # Write out line in file Extern.U. The information recorded there has the # following prototypical format: # ?symbol:L:inet bsd # If 'symbol' is wanted, then 'inet bsd' will be added to $libswanted. sub write_out { local($_) = @_; local($target) = $defined; # By default, applies to defined symbols $target = $1 if s/^(.*)://; # List is qualified "?L:target:symbols" local(@target) = split(' ', $target); chop; foreach $key (@target) { print EXTERN "?$key:$_\n"; # EXTERN file defined in xref.pl } } dist_3.5-30.orig/mcon/mxref.SH0000755000175000017500000001006611017237675016367 0ustar srivastasrivastacase $CONFIG in '') if test -f config.sh; then TOP=.; elif test -f ../config.sh; then TOP=..; elif test -f ../../config.sh; then TOP=../..; elif test -f ../../../config.sh; then TOP=../../..; elif test -f ../../../../config.sh; then TOP=../../../..; else echo "Can't find config.sh."; exit 1 fi . $TOP/config.sh ;; esac case "$0" in */*) cd `expr X$0 : 'X\(.*\)/'` ;; esac echo "Extracting mcon/mxref (with variable substitutions)" cat >mxref < # # $Log: mxref.SH,v $ # Revision 3.0.1.3 1997/02/28 16:30:49 ram # patch61: new -L option to match metaconfig and metalint # # Revision 3.0.1.2 1994/01/24 14:21:04 ram # patch16: added ~/.dist_profile awareness # # Revision 3.0.1.1 1993/08/19 06:42:27 ram # patch1: leading config.sh searching was not aborting properly # # Revision 3.0 1993/08/18 12:10:18 ram # Baseline for dist 3.0 netwide release. # # Perload ON \$MC = '$privlib'; \$version = '$VERSION'; \$patchlevel = '$PATCHLEVEL'; \$revision = '$REVISION'; \$grep = '$grep'; !GROK!THIS! $spitshell >>mxref <<'!NO!SUBS!' &profile; # Read ~/.dist_profile require 'getopts.pl'; &usage unless &Getopts("df:hkmsVL:"); chop($date = `date`); chop($WD = `pwd`); # Working directory $MC = $opt_L if $opt_L; # May override library path $MC = &tilda_expand($MC); # ~name expansion chdir $MC || die "Can't chdir to $MC: $!\n"; chop($MC = `pwd`); # Real metaxref lib path (no symbolic links) chdir $WD || die "Can't chdir back to $WD: $!\n"; if ($opt_V) { print STDERR "metaxref $version-$revision\n"; exit 0; } elsif ($opt_h) { &usage; } $NEWMANI = $opt_f || (-f 'MANIFEST.new' ? 'MANIFEST.new' : 'MANIFEST'); &init; # Various initializations `mkdir .MT 2>&1` unless -d '.MT'; # For private temporary files unlink 'Obsolete'; # Obsolete file rebuilt &locate_units; # Fill in @ARGV with a unit list &extract_dependencies; # Extract dependencies from units &extract_filenames; # Get source files from MANIFEST.new &build_xref; # Parse files, build I.* output if ($opt_k) { print "Leaving subdirectory .MT unremoved so you can peruse it.\n" unless $opt_s; } else { `rm -rf .MT 2>&1`; } print "Done.\n" unless $opt_s; # General initializations sub init { &init_except; # Token which have upper-cased letters &init_depend; # The %Depend array records control line handling } # Record the exceptions -- all symbols but these are lower case sub init_except { $Except{'Author'}++; $Except{'Date'}++; $Except{'Header'}++; $Except{'Id'}++; $Except{'Locker'}++; $Except{'Log'}++; $Except{'RCSfile'}++; $Except{'Revision'}++; $Except{'Source'}++; $Except{'State'}++; } # Print out metaxref's usage and exits sub usage { print STDERR <>mxref $grep -v '^;#' pl/common.pl >>mxref $grep -v '^;#' pl/xref.pl >>mxref $grep -v '^;#' pl/files.pl >>mxref $grep -v '^;#' pl/init.pl >>mxref $grep -v '^;#' pl/extract.pl >>mxref $grep -v '^;#' pl/obsolete.pl >>mxref $grep -v '^;#' pl/xwant.pl >>mxref $grep -v '^;#' pl/gensym.pl >>mxref $grep -v '^;#' ../pl/manifake.pl >>mxref $grep -v '^;#' ../pl/tilde.pl >>mxref $grep -v '^;#' ../pl/profile.pl >>mxref chmod +x mxref $eunicefix mxref dist_3.5-30.orig/mcon/README0000644000175000017500000000223510473316164015662 0ustar srivastasrivastaThis is the root directory for metaconfig. If you are new to metaconfig, you may wish to have a look at the INTRO file, which gives a quick introduction. The metaconfig you have here is a modified version of Larry Wall's 2.0 release. The units themselves have been ripped off from some Configure scripts (perl 4.0, elm 2.3). They all carry a copyright from me, which is not true, but it was automatically produced and I had no time yet to set the proper copyrights for each unit. Although metaconfig, as being part of dist, is covered by the Artistic License, a Configure script is not copyrighted and belongs to the public domain. Units can be copyrighted, and credits for each unit may appear in the generated Configure script, at the author's request. The manual page for metaconfig is not up-to-date. The built-in interpreter and the changes are documented in NOTES. The units that come from dist 2.0 need to be changed. A script should be provided in the final release to do an automatic conversion, which will be fine 90% of the time. If you want to see how new features can be used, I would recommend you to have a look at Oldconfig.U, d_gethname.U and voidflags.U. dist_3.5-30.orig/mcon/NOTES0000644000175000017500000001463710473316164015626 0ustar srivastasrivastaThis file shortly documents the built-in interpreter and other new features from metaconfig. The notion of "conditional unit" has been added. In the ?MAKE: line, each unit whose name begins with a "+" will not be loaded in the Configure script unless its exact value is a mandatory. The default value specified in ?DEF: will be used instead. If no ?DEF: line is found, then the symbol is initialized with a null default value. In the config.h.SH file, only the necessary symbols are loaded. Note that the format in ?H: line has changed. It is no longer necessary to write ?H:?%1: to get a line included in config.h. First of all, the %1 symbol is not defined any more. Secondly, the unit's name is now %< and it does not matter whether the name appears first in the ?MAKE: line or not. Lastly, metaconfig can guess for itself whether to include a symbol or not. Sometimes, it is necessary to force a given value, because metaconfig is not smart enough to guess 100% of the time. See voidflags.U for an example (look at the ?C: and ?H: lines and read the comments). The Myread.U unit changed. It is now able to do variable substitutions, and it sets the prompt correctly if there is no supplied default. Thus, instead of the old: dflt=y rp="Question? [$dflt]" $echo $n "$rp $c" . myread you must now write: dflt=y rp='Question?' . myread and 'myread' will take care of echoing the question with the default put in square brakets. Likewise, question asking for filenames or pathnames may now use the Getfile.U unit to take care of all the burden. The presetting is the same as for myread and the answer is finally held in $ans. But the variable $fn must be set to indicate the type of file and enable/disable some of the sanity checks. See leading comments in Getfile.U. Here is a simple example to locate the active file: dflt='~news/lib' fn='l~:active' rp='Where is the active file?' . getfile active="$ans" The user may answer the question by using ~substitution and giving only the directory where the active file is located (in which case getfile will try to locate a file named 'active' in that directory). A full path may also be given of course, if the basename of the file is not 'active'. The units are now filtered by a built-in interpreter before getting loaded in Configure. That way, a Configure script can be more or less tuned. See d_gethname.U for a complex example. All the interpreter commands start with a leading '@'. Possible commands include: o if/elsif/else/end is the traditional conditional construct. o define tells metaconfig the is to be defined. Expressions in conditional constructs can include the &&, || and ! operator with same meaning as in the shell. Backslash at the end of a line stands for the continuation character. All the symbols in the expression stands for themselves, and their value is true if they are defined/wanted and false otherwise. It is possible to include shell and perl test. All the text enclosed in single brackets as {} is expanded in a shell as if >/dev/null 2>&1; then exit 0; else exit 1; fi whereas text in double brackets as {{}} is expanded in perl as if ( {exit 0;} else {exit 1;} and the exit status is used in the standard way to get a boolean value (i.e 0 is true and everything else is false). See Oldconfig.U for an example. Metaconfig's interpreter has standard C operator priority, but you may force the evaluation order with parenthesis. A simple error recovery attempt is made, so that you should get meaningful error messages. The simple test ?sym: means "keep the remaining of the line iff the symbol is defined" and %sym: is the same for non-definedness. Some special symbols may be put in a unit and will get expanded, provided the ?MAKE: command line is 'wipe' and not 'add'. Here are the available symbols: is the name $package as found in .package is the $maintloc variable as found in .pakcage is metaconfig's version number is metaconfig's patchlevel is the current frozen date as given by `date` A 'wipe'ed unit is passed through the interpreter too. It is also possible to declare a symbol obsolete. A warning message will be issued if the symbol is used and the Glossary mentions it. the "Obsolete" clause. The syntax is: ?C:symbol (obsolete list): ?S:symbol (obsolete list): If metaconfig is used with the -o option, it will generate code to remap those old symbols to the new ones, so the old code does not have to be changed right away. If you do not use -o, the Obsolete file will still be generated to warn you about obsolete symbols but no maping will be done. The new ?W: line can be use to tie up the destiny of some symbols. The syntax is: ?W:shell symbols list:C symbol list and the symbols in the shell list will be defined if one of the C symbols is. For instance, unit d_const.U uses the following: ?W:%<:const so that any 'const' usage in the C code will have %< (the unit name) handled as a wanted symbol. In particular, this has the interesting side effect of loading the unit into Configure when the 'const' keyword is used. This shell symbol list part may be left empty. For example unit i_time.U uses: ?W::timezone for its side effect: the symbol 'timezone' may now be part of the interpreter tests to conditionally load some code into Configure when struct timezone is used. C symbol aliasing can be used to let metaconfig know that the symbol comment is to be loaded in config_h.SH even when the main symbol is not used in C. For instance, d_const.U writes: ?C:HASCONST ~ %<: so that the HASCONST hype is loaded iff the unit (%<) is wanted. This is why the ?H: lines are also explicitely tied to the wanted-ness of the d_const symbol, by writing: ?H:?%<:#$d_const HASCONST /**/ ?H:?%<:#ifndef HASCONST ?H:?%<:#define const ?H:?%<:#endif ?H:. because we want all those lines to appear in config_h.SH as soon as the d_const unit is loaded into Configure. Because of the new -s (silent) option of Configure, the important messages which are to appear even in silent mode must be written on file descriptor #4. Others will simply not be echoed under -s. Note that all the questions and default answers are written on #4. You should write: echo " " echo "Checking to see if......" >&4 ..... echo "Yes, it does" which will have the traditional behaviour unless -s is used, in which case only the line Checking to see if..... will echo on the terminal. dist_3.5-30.orig/mcon/man/0002755000175000017500000000000011272612640015551 5ustar srivastasrivastadist_3.5-30.orig/mcon/man/mconfig.SH0000755000175000017500000024713111017237675017450 0ustar srivastasrivastacase $CONFIG in '') if test -f config.sh; then TOP=.; elif test -f ../config.sh; then TOP=..; elif test -f ../../config.sh; then TOP=../..; elif test -f ../../../config.sh; then TOP=../../..; elif test -f ../../../../config.sh; then TOP=../../../..; else echo "Can't find config.sh."; exit 1 fi . $TOP/config.sh ;; esac case "$0" in */*) cd `expr X$0 : 'X\(.*\)/'` ;; esac echo "Extracting mcon/man/metaconfig.$manext (with variable substitutions)" $rm -f metaconfig.$manext $spitshell >metaconfig.$manext < macro substitution ''' ''' Revision 3.0.1.5 1993/10/16 13:51:50 ram ''' patch12: new option -M to activate ?M: lines ''' patch12: documents new ?M: lines format ''' patch12: new internal Makefile command cm_h_weed for ?M: support ''' patch12: documents usage for new confmagic.h file ''' ''' Revision 3.0.1.4 1993/09/09 11:50:35 ram ''' patch9: lots of typo fixes and abusive variable substitution problems ''' ''' Revision 3.0.1.3 1993/08/30 08:53:51 ram ''' patch8: wrongly stated that patchlevel.h should not be part of MANIFEST.new ''' ''' Revision 3.0.1.2 1993/08/24 12:13:32 ram ''' patch3: typo fixes ''' ''' Revision 3.0.1.1 1993/08/19 06:42:23 ram ''' patch1: leading config.sh searching was not aborting properly ''' ''' Revision 3.0 1993/08/18 12:10:14 ram ''' Baseline for dist 3.0 netwide release. ''' ''' .de Ex \" Start of Example .sp .in +5 .nf .. .de Ef \" End of Example .sp .in -5 .fi .. .SH NAME metaconfig \- a Configure script generator .SH SYNOPSIS .B metaconfig [ \-\fBdhkmostvwGMV\fR ] [ \-\fBL \fIdir\fR ] .SH DESCRIPTION .I Metaconfig is a program that generates Configure scripts. If you don't know what a Configure script is, please skip to the \fBTUTORIAL\fR section of this manual page. If you want a full (formal) description of the way to use \fImetaconfig\fR and its units, please look at the \fBREFERENCE\fR section. The following is a quick introduction and reference for knowledgeable users. .PP .B Metaconfig operates from set of .I units which define everything that metaconfig knows about portability. Each unit is self-contained, and does not have to be registered anywhere other than by inclusion in either the public U directory or your private U directory. If the dist package (of which metaconfig is a part) is installed in LIB, then the public U directory is LIB/dist/mcon/U. On this machine, the LIB directory is $privlibexp. Your private U directory, if you have one, is in the top level directory of your package. Before you can run \fImetaconfig\fR you must do a several things: .IP \(bu 5 Create a .package file in the package's top level directory by running \fIpackinit\fR. This program will ask you about your package and remember what you tell it so that all the dist programs can be smart. .IP \(bu Consult the Glossary (in LIB/dist/mcon) and write your shell scripts and C programs in terms of the symbols that metaconfig knows how to define. You don't need to tell metaconfig which symbols you used, since metaconfig will figure that out for you. .IP \(bu Generate any .SH scripts needed to write Makefiles or shell scripts that will depend on values defined by Configure. There is a program called \fImakeSH\fR that will help you convert a plain script into a script.SH template; some editing will still need to be performed on the resulting .SH file to move the variable configuration part in the top part of the script (see inline comments generated by \fImakeSH\fR within your .SH file). .IP \(bu Create a MANIFEST.new file in your top level directory that lists all the files in your package. This file will remain private and will not be part of the final distribution. (As a convenience, the MANIFEST file will be used by \fImetaconfig\fR if there is no MANIFEST.new file yet.) The filename should be the first field on each line. After some whitespace you can add a short comment describing your file. Only source files should be listed in there. The special file \fIpatchlevel.h\fR (which is handled and maintained by the patching tools -- see \fIpat\fR(1)) should be part of the MANIFEST.new file, but may be silently ignored by some tools. As a rule of thumb, only files maintained by RCS should be listed in there, the \fIpatchlevel.h\fR file being one important exception. .IP \(bu Optionally, you may wish to create a MANIFEST file, which will be an exported version of your MANIFEST.new. That file must be made part of the release, i.e. listed in both your MANIFEST.new and MANIFEST itself. One of the \fImetaconfig\fR units knows about this file and will force Configure to perform a release check, ensuring all the files listed there are part of the distribution. The MANIFEST and MANIFEST.new files should be distinct, not links. .IP \(bu Copy any .U files that you want to modify to your private U directory. Any .U files in your private U directory will be used in preference to the one in the public U directory. For example, one way to force inclusion of any unit is to copy the End.U file to your .U directory and add the name of the unit you want as a dependency on the end of the ?MAKE: line. Certain units can ONLY be forced in this way, namely those of the form Warn_*.U and Chk_*.U. You can also customize certain default Configure variables by copying Myinit.U to your package's private U directory and setting the variables in that unit. .PP Now you are ready to run \fImetaconfig\fR. That will create a \fIConfigure\fR file, and optionally a \fIconfig_h.SH\fR file (if your sources make any use of C symbols). The generated files will automatically be added to your MANIFEST.new if necessary. Do not forget to update your MANIFEST file though. .PP In order to create new units, do the following: .IP \(bu 5 Copy a similar unit to a new .U file. The name you choose should be the name of a variable generated by the unit, although this is only a convenience for you, not a requirement. It should be 12 or less characters to prevent filename chopping. Actually, it should probably be 10 or less so that those who want to use RCS can have a .U,v on the end without chopping. Metaconfig uses the case of the first letter to determine if any variable is actually produced by this unit, so don't Capitalize your unit name if it is supposed to produce a shell variable. .IP \(bu Edit the new .U file to do what you want. The first ?MAKE: line indicates the dependencies; before the final list colon all the variables this unit defines, and after the final colon all the variables (or other units) on which this unit depends. It is very important that these lists be accurate. If a dependency is optional and a default value can be used, you should prefix the dependency with a '+' sign. The corresponding unit will not be loaded to compute the symbol, unless really required by another unit. .IP \(bu To the extent possible, parameterize your unit based on shell variable defined on ?INIT: lines. This will move the variable definitions up to the Init.U unit, where they can be overridden by definitions in Myinit.U, which is included after Init.U. .IP \(bu Add the definition of any C symbols desired as ?H: lines. A line beginning with ?H:?%<: in the .U file will be added to the eventual config.h file if and only if metaconfig decides that this unit is needed. The %< stands for the unit's name, which happens to be the name of the file too (without .U) if you followed the convention. Always put a comment on each ?H: line in case one of the variable substitutions earlier on the line starts a comment without finishing it. Any shell variable starting with d_ may do this, so beware. If you ommit the ?%<:, then metaconfig will try to intuit the symbol whose definition is needed prior any inclusion in config.h. .IP \(bu Add glossary definitions as ?S: lines for shell variables and ?C: lines for C preprocessor variables. See a current unit for examples. It is VERY important to start each entry with a left justified symbol name, and end each entry with a ?C:. or ?S:. line. The algorithm that translates C preprocessor symbol entries for the Glossary into comments for config.h depends on this. .IP \(bu Make sure the order of all your ? lines is right. The correct order is: .sp .RS +10 .PD 0 .TP 15 ?RCS: and ?X: basically just comments .TP ?MAKE: metaconfig dependencies .TP ?Y: unit layout directive .TP ?S: glossary shell definitions .TP ?C: glossary C definitions .TP ?H: config.h definitions .TP ?M: confmagic.h definitions .TP ?W: wanted symbols .TP ?V: visible symbols .TP ?F: files created by this unit .TP ?T: temporary shell symbols used .TP ?D: optional dependencies default value .TP ?O: used to mark obsolete units .TP ?LINT: metalint hints .TP ?INIT: shell symbols initializations .PD .RE .PP Here is an example to show the ordering of the lines and the various formats allowed: .Ex ?RCS: \$RCS-Id\$ ?RCS: Copyright information ?RCS: \$RCS-Log\$ ?X: ?X: A contrived example ?X: ?MAKE:d_one two: three +four Five ?MAKE: -pick add \$@ %< ?Y:DEFAULT ?S:d_one: ?S: First shell symbol, conditionally defines ONE. ?S:. ?S:two: ?S: Second shell symbol, value for TWO. ?S:. ?C:ONE: ?C: First C symbol. ?C:. ?C:TWO: ?C: Second C symbol. ?C:. ?H:#\$d_one ONE /**/ ?H:#define TWO "\$two" ?H:#\$d_one ONE_TWO "\$two" ?H:. ?M:flip: HAS_FLIP ?M:#ifndef HAS_FLIP ?M:#define flip(x) flop(x) ?M:#endif ?M:. ?W:%<:one_two ?V:p_one p_two:p_three ?F:file ./ftest !tmp ?T:tmp var ?D:two='undef' ?LINT:change three ?INIT:two_init='2' : shell code implementing the unit follows p_one='one' p_two='two' p_three="$three" .Ef Let me state it one more time: the above unit definition is a \fIfake\fR one to only show the different possibilities. Such a unit would serve little purpose anyway... Some more advanced features are not described here. Please refer to the \fBREFERENCE\fR section for more complete information. .IP \(bu Put the unit into the public or private U directory as appropriate. .IP \(bu Rerun \fImetaconfig\fR. .IP \(bu Send your unit to ram@acri.fr (Raphael Manfredi) for inclusion in the master copy, if you think it's of general interest. .PP In order to add a new program to be located: .IP \(bu Edit Loc.U, and add the name of the program both to the ?MAKE: line (between the two colons) and to either loclist or trylist (depending on whether the program is mandatory or not). .IP \(bu Rerun metaconfig. .IP \(bu Send your unit to me for inclusion in the master copy, if you think it's of general interest. .PP Notes for writing .U files: .IP * 5 Always use "rm -f" because there are systems where rm is interactive by default. .IP * Do not use "set -- ..." because '--' does not work with every shell. Use "set x ...; shift". .IP * Do not use "unset ENV" since unset is not fully portable. Say "ENV=''" instead. .IP * Always use echo " " (with a space) because of Eunice systems. .IP * Only use \fBtest\fR with \-r, \-w, \-f or \-d since those are the only portable switches. In particular, avoid "test -x". .IP * Use only programs that came with V7, so that you know everyone has them. .IP * Use \$\&contains when you want to grep conditionally, since not all greps return a reasonable status. Be sure to redirect the output to /dev/null, by using '>/dev/null 2>&1'. .IP * Use "if test" rather than "if [...]" since not every sh knows the latter construct. .IP * Use the myread script for inputs so that they can do shell escapes and default evaluation. The general form is .Ex case "\$grimble" in \&'') dflt=452;; *) dflt="\$grimble";; esac rp='How many grimbles do you have?' \&. ./myread grimble="\$ans" .Ef .IP * Use the getfile script when asking for a file pathname in order to have optional ~name expansion and sanity checks. See the Getfile.U unit for a full decription. .IP * Always put a .Ex \$startsh .Ef at the top of every generated script that is going to be launched or sourced by \fIConfigure\fR. .IP * Never assume common UNIX-isms like the fact that an object file ends with a \fI.o\fR and that a library name ends with \fI.a\fR. Use the \fI\$_o\fR and \fI\$_a\fR variables instead (see Unix.U). .IP * When doing a compile-link-execute test, always write it like this: .Ex \$\&cc \$\&ccflags \$\&ldflags try.c -o try \$\&libs .Ef because some systems require that linking flags be specified before the compiled target (with the exception of trailing linking libraries). .IP * Issue important messages on file descriptor #4, by using '>&4' to redirect output. Only those messages will appear when the \fB\-s\fR switch is given to \fIConfigure\fR on the command line (silent mode). .IP * Always try to determine whether a feature is present in the most specific way--don't say "if bsd" when you can grep libc. There are many hybrid systems out there, and each feature should stand or fall by itself. .IP * Always try to determine whether a feature is present in the most general way, so that other packages can use your unit. .IP * When in doubt, set a default and ask. Don't assume anything. .IP * If you think the user is wrong, allow for the fact that he may be right. For instance, he could be running Configure on a different system than he is going to use the final product on. .PP Metaconfig reserves the following names in your directory, and if you use such a name it may get clobbered or have other unforeseen effects: .Ex .MT/* Configure Wanted Obsolete configure config_h.SH confmagic.h U/* MANIFEST.new .Ef Additionally, Configure may clobber these names in the directory it is run in: .Ex UU/* config.sh config.h .Ef ''' ''' O p t i o n s ''' .SH OPTIONS The following options are recognized by \fImetaconfig\fR: .TP 15 .B \-d Turn on debug mode. Not really useful unless you are debugging \fImetaconfig\fR itself. .TP .B \-h Print help message and exit. .TP .B \-k Keep temporary directory, so that you may examine the working files used by \fImetaconfig\fR to build your \fIConfigure\fR script. Useful only when debugging the units. .TP .B \-m Assume lots of memory and swap space. This will speed up symbol lookup in source files by a significant amount of time, at the expense of memory consumption... .TP .B \-o Map obsolete symbols on new ones. Use this switch if you still have some obsolete symbols in your source code and do not want (or cannot) remove them for now. The obsolete symbols are otherwise ignored, although that will give you a warning from \fImetaconfig\fR. .TP .B \-s Turn silent mode on. .TP .B \-t Trace symbols as they are found. .TP .B \-v Turn verbose mode on. .TP .B \-w Assume Wanted file is up-to-date. This will skip the time and memory consuming phase of source code scanning, looking for known symbols. Use it only when you know your source file have not changed with respect to the pool of \fImetaconfig\fR symbols used. .TP .B \-G Also provide a GNU \fIconfigure\fR-like front end to the generated .I Configure script, to be included in the distribution as well. This is only a wrapper around the .I Configure script naturally, but it lets people familiar with the GNU tool to not be lost when facing a new distribution. .TP \fB\-L\fI dir\fR Override default library location. Normally only useful for metaconfig maintainers to locally use the units being developped instead of the publicly available ones. The \fIdir\fR specified is the one containing the units \fIU\fR directory. .TP .B \-M Allow production of a \fIconfmagic.h\fR file to automagically remap some well-known symbols to some other alternative, like \fIbcopy\fR() being remapped transparently to \fImemcpy()\fR when not available. This option is turned on automatically when a \fIconfmagic.h\fR file exists in the top-level directory. Simply remove that file if you wish to disable this option permanently. .TP .B \-V Print version number and exit. ''' ''' T u t o r i a l ''' .SH TUTORIAL This (long) section is an introduction to \fImetaconfig\fR, in which we will learn all the basics. If you already know how to use \fImetaconfig\fR, you may safely skip to the next section. ''' .SS Overview .PP Usually when you want to get some source package to compile on a given platform you have to edit the main Makefile (assuming there is one!), choose a C compiler, make sure you have the proper libraries, and then fire the \fImake\fR command. If the package is reasonably well written, it will compile (without a warning being an option :-). In itself, the last sentence is a real performance, since given the variety of UNIX platforms available today and the diversity of flavours, that means the author of the package has gone into deep trouble to figure out the right choices given some standard trial, guessing and messing around with system includes and types. .PP However, despite all his talent, the author cannot possibly know that some system has a broken system call, or that some sytem structure lacks one otherwise standard field, or simply wheter a given include file exists or not. And I'm not considering the implicit assumptions, like the type returned by the \fImalloc()\fR function or the presence of the \fIrename()\fR system call to name a few. But that knowledge is necessary to achieve real portability. .PP Now let's not abuse ourselves. Using that information requires greater skills, yet it can lead to more portable programs since it is then written in a system-independant fashion and relies only on the fact that some assumption is true or false on a particular system, each assumption being unrelated with each other. That is to say, we do not say: We're on a BSD system or we are on a USG system. That's too fuzzy anyway nowadays. No, we want to say to the source code: this system does not have the .I rename() system call and \fImalloc()\fR returns a \fI(void *)\fR value. .PP Metaconfig is a tool that will let you do just that, with the additional benefit of not having to hand-edit the Makefile if all goes well. By running \fImetaconfig\fR, you create a shell script named \fIConfigure\fR. Lots of efforts have been devoted to the Configure script internals to ensure it will run on 99% of the existing shells available as of this writing. Configure will probe the target system, asking questions when in doubt and gather all the answers in one single shell file, which in turn can be used to automatically generate configured Makefiles and C include files. .PP There is only a limited (but quite large) set of symbols available for your shell scripts and C programs. They are all documented in the Glossary file. All you need to do is learn about them and start using them to address portability and configuration problems. Then, by running \fImetaconfig\fR, a suitable Configure script will be generated for your package. .PP The Configure script is built out several units (more than 300), each unit being responsible for defining a small number of shell and/or C symbols. Units are assembled together at the final stage, honoring the dependency graph (one unit may need the result of several other units which are then placed before in the script). ''' .SS Symbols .PP Symbols are the most important thing in the \fImetaconfig\fR world. They are the smallest recognized entity, usually a word, and can be granted a value at the end of the Configure execution. For instance, the C pre-processor symbol \fIHAS_RENAME\fR is a \fImetaconfig\fR symbol that is guranteed to be defined if, and only if, the \fIrename()\fR system call is present. Likewise, the \fI\$\&ranlib\fR shell variable will be set to either ':' or 'ranlib' depending on whether the call to the \fIranlib\fR program is needed to order a library file. How this works is not important for now, what is important is to understand that those symbols are given a \fIlife\fR (i.e. a value) upon \fIConfigure\fR execution. .PP Using symbols is relatively straightforward. In a C source file, you simply use the symbol value, as a pre-processor directive (for instance an: \fI#ifdef HAS_RENAME\fR) or, if the symbol value is a string, directly as you would use a macro in C. And in a shell file or a Makefile, you may reference a shell symbol directly. .PP Actually, I'm lying, because that's not completely as magic as the previous paragraph could sound. In a C file, you need to include the Configure-produced \fIconfig.h\fR file, and you must wrap your shell script or Makefile in a .SH file and you may reference the shell symbol only in the variable substitution part of that .SH file. More on this later. ''' .SS Source Files .PP Symbols may only appear in a limited set of source files, because \fImetaconfig\fR will only scan those when looking for known symbols, trying to figure out which units it will need. You may use C symbols in C source files, i.e. files with a \fI.c\fR, \fI.h\fR, \fI.y\fR or \fI.l\fR extension, and shell symbols are looked for only in .SH files. .PP In order to get the value of a symbol, a C file needs to include the special \fIconfig.h\fR file, which is produced by \fIConfigure\fR when C symbols are present. And .SH files are run through a shell, producing a new file. However, in the top section of the .SH file, the special \fIconfig.sh\fR file (also produced by running \fIConfigure\fR) is sourced, and variable substitutions apply. Actually, \fIconfig.h\fR is produced by running the \fImetaconfig\fR-produced \fIconfig_h.SH\fR file, again using variable substitution. So we're going to look at that a little more closely since this is the heart of the whole \fIconfiguration\fR scheme... ''' .SS Variable Substitution .PP There is shell construct called \fIhere document\fR which enables a command to take an input specified within the script itself. That input is interpreted by the shell as a double-quoted string or a single quoted string depending on the form of the here document specification. .PP To specify a here document, the '<<' token is used, followed by a single identifier. From then on, the remaining script lines form the input for the command, until the here document is found on a line by itself. Shell substitution (including shell variable substitutions) is done unless the identifier is surrounded by single quotes. For instance: .Ex var='first' tar='second' echo "--> first here document:" cat < second here document:" cat <<'EOM' echo \$var echo \$\&tar EOM echo "--> end." .Ef will produce, when run through a shell: .Ex --> first here document: var='first' tar='second' --> second here document: echo \$var echo \$\&tar --> end. .Ef The first here document has its content interpreted whilst the second one is output as-is. Both are useful in a .SH script, as we are about to see. ''' .SS Using .SH Scripts .PP A .SH script is usually produced by running the \fIMakeSH\fR script other an existing file, transforming \fIfile\fR into a \fIfile.SH\fR. Let's take a single example. Here is a little script (let's call it \fIintsize\fR) which prints a single message, the size of the \fBint\fR datatype in C. Unfortunately, it has the value hardwired in it, thusly: .Ex #!/bin/sh intsize='4' echo "On this machine, the int type is \$\&intsize bytes" .Ef Let's run \fImakeSH\fR on it by typing '\fImakeSH intsize\fR'. We get a single \fIintsize.SH\fR file that looks like this: .Ex case \$CONFIG in \&'') if test -f config.sh; then TOP=.; elif test -f ../config.sh; then TOP=..; elif test -f ../../config.sh; then TOP=../..; elif test -f ../../../config.sh; then TOP=../../..; elif test -f ../../../../config.sh; then TOP=../../../..; else echo "Can't find config.sh."; exit 1 fi . \$TOP/config.sh ;; esac : This forces SH files to create target in same directory as SH file. : This is so that make depend always knows where to find SH derivatives. case "\$0" in */*) cd \`expr X\$0 : 'X\\\\(.*\\\\)/'\` ;; esac echo "Extracting intsize (with variable substitutions)" : This section of the file will have variable substitutions done on it. : Move anything that needs config subs from !NO!SUBS! section to !GROK!THIS!. : Protect any dollar signs and backticks that you do not want interpreted : by putting a backslash in front. You may delete these comments. \$spitshell >intsize <>intsize <<'!NO!SUBS!' intsize='4' echo "On this machine, the int type is \$\&intsize bytes" \&!NO!SUBS! chmod 755 intsize \$\&eunicefix intsize .Ef The first part of this script (in the \fIcase\fR statement) is trying to locate the \fIconfig.sh\fR file, in order to source it. The \fI\$CONFIG\fR variable is false by default, by true when \fIconfig.sh\fR has been sourced already (which would be the case if this file was executed from within \fIConfigure\fR itself, but let's not confuse the issue here). .PP Once the \fIconfig.sh\fR file has been sources, all the shell symbols defined by \fIConfigure\fR are set. We know reach a second case statement, used to change the current directory should a path be used to reach this program (for instance if we said '\fIsh ../scripts/intsize.SH\fR', we would first run '\fIcd ../scripts\fR' before continuing). If you do not understand this, don't worry about it. .PP Here comes the intersting stuff. This script uses the \fI\$spitshell\fR variable, and it's not something we know about...yet. If you look through the Glossary file, you will see that this is a variable known by \fImetaconfig\fR. If you make this file part of your distribution (by including it in the MANIFEST.new file, we'll come back to that later on) and run \fImetaconfig\fR, then the \fIConfigure\fR script will determine a suitable value for this variable and it will be set in \fIconfig.sh\fR. Same goes for \fI\$startsh\fR and the mysterious \fI\$\&eunicefix\fR at the end. On a reasonable system, the relevant part of \fIconfig.sh\fR would look like this: .Ex spitshell='cat' startsh='#!/bin/sh' eunicefix=':' .Ef Ah! We're getting there. Now it looks familiar. We're facing a single \fIcat\fR command whose input comes from a variable-interpolated here document and whose output is redirected to \fIintsize\fR. The value will be that of \fI\$startsh\fR, i.e. '#!/bin/sh'. Fine so far. .PP Then we reach the second here document expansion, to get the remaining of the script. This time, the here document symbol is surrounded by single quotes so the contents will be appended verbatim to the \fIintsize\fR file. So, by running '\fIsh intsize.SH\fR', we get the following output: .Ex Extracting intsize (with variable substitutions) .Ef and by looking at the produced intsize file, we see: .Ex #!/bin/sh intsize='4' echo "On this machine, the int type is \$\&intsize bytes" .Ef which is exactly what we had at the beginning. So far, it's a no-operation procedure... But, how marvelous! It so happens (pure coincidence, trust me!), that \fImetaconfig\fR knows about the \fI$\&intsize\fR shell symbol. By moving the initialization of intsize to the variable-interpolated area of the .SH script and initializing it with the \fIConfigure\fR-computed value, and removing the now useless comments added by \fImakeSH\fR, we get: .Ex case \$CONFIG in \&'') if test -f config.sh; then TOP=.; elif test -f ../config.sh; then TOP=..; elif test -f ../../config.sh; then TOP=../..; elif test -f ../../../config.sh; then TOP=../../..; elif test -f ../../../../config.sh; then TOP=../../../..; else echo "Can't find config.sh."; exit 1 fi . \$TOP/config.sh ;; esac case "\$0" in */*) cd \`expr X\$0 : 'X\\\\(.*\\\\)/'\` ;; esac echo "Extracting intsize (with variable substitutions)" \$\&spitshell >intsize <>intsize <<'!NO!SUBS!' echo "On this machine, the int type is \$\&intsize bytes" \&!NO!SUBS! chmod 755 intsize \$\&eunicefix intsize .Ef Of course, running this script through a shell will again output the same script. But if we run \fIConfigure\fR on a machine where an \fBint\fR is stored as a 64 bits quantity, \fIconfig.sh\fR will set \fIintsize\fR to 8 and the \fIintsize\fR script will bear the right value and print: .Ex On this machine, the int type is 8 bytes .Ef which is correct. Congratulations! We have just configured a shell script!! ''' .SS Producing config.h .PP We can now have a look at the way \fIconfig.h\fR is produced out of \fIconfig_h.SH\fR. We know that running \fIConfigure\fR produces a \fIconfig.sh\fR script (how exactly this is done is not strictly relevant here, but for the curious, it's another here document substitution within \fIConfigure\fR itself). The \fIconfig_h.SH\fR itself is built by \fImetaconfig\fR at the same time \fIConfigure\fR is, provided you make use of at least one C symbol within your sources. .PP Let's have a look at some random \fIconfig_h.SH\fR file to see what really happens: .Ex case \$CONFIG in \&'') if test -f config.sh; then TOP=.; elif test -f ../config.sh; then TOP=..; elif test -f ../../config.sh; then TOP=../..; elif test -f ../../../config.sh; then TOP=../../..; elif test -f ../../../../config.sh; then TOP=../../../..; else echo "Can't find config.sh."; exit 1 fi . \$TOP/config.sh ;; esac case "\$0" in */*) cd \`expr X\$0 : 'X\\\\(.*\\\\)/'\` ;; esac echo "Extracting config.h (with variable substitutions)" sed <config.h -e 's!^#undef!/\*#define!' -e 's!^#un-def!#undef!' /* * This file was produced by running the config_h.SH script, which * gets its values from config.sh, which is generally produced by * running Configure. * * Feel free to modify any of this as the need arises. Note, however, * that running config.h.SH again will wipe out any changes you've made. * For a more permanent change edit config.sh and rerun config.h.SH. */ /* Configuration time: \$\&cf_time * Configured by: \$\&cf_by * Target system: \$\&myuname */ #ifndef _config_h_ #define _config_h_ /* bcopy: * This symbol is maped to memcpy if the bcopy() routine is not * available to copy strings. */ /* HAS_BCOPY: * This symbol is defined if the bcopy() routine is available to * copy blocks of memory. You should not use this symbol under * normal circumstances and use bcopy() directly instead, which * will get mapped to memcpy() if bcopy is not available. */ #\$\&d_bcopy HAS_BCOPY /**/ #ifndef HAS_BCOPY #ifdef bcopy #un-def bcopy #endif #define bcopy(s,d,l) memcpy((d),(s),(l)) /* mapped to memcpy */ #endif /* HAS_DUP2: * This symbol, if defined, indicates that the dup2 routine is * available to duplicate file descriptors. */ #\$\&d_dup2 HAS_DUP2 /**/ /* I_STRING: * This symbol, if defined, indicates to the C program that it should * include (USG systems) instead of (BSD systems). */ #\$\&i_string I_STRING /**/ #endif \&!GROK!THIS! .Ef At the top of the file, we recognize the standard .SH construct that we have already studied in detail. Next comes the extraction of the file itself, via a here document with variable substitutions. However, here we do not use a plain \fIcat\fR but a \fIsed\fR instead, since we need to do some further editing on-the-fly. We'll see why later on, so let's forget about it right now. .PP We now reach the leading comment, and the file is tagged with the configuration time, the target system, etc... (those variables coming from the sourced \fIconfig.sh\fR file have been set up by \fIConfigure\fR). That comment header is followed by a '#ifndef' protection to guard against multiple inclusions of this file. Then comes the heart of the file... .PP It helps to know that \fI\$d_*\fR and \fI\$i_*\fR variables are set to either '\fIdefine\fR' or '\fIundef\fR' by \fIConfigure\fR, depending on wether a function or an include file is present on the system or not. That means the: .Ex #\$\&d_bcopy HAS_BCOPY /**/ .Ef line will be expanded to either: .Ex #define HAS_BCOPY /**/ .Ef if the \$\&d_bcopy variable is set to 'define' or: .Ex #undef HAS_BCOPY /**/ .Ef if \$\&d_bcopy was set to 'undef', because the feature was not there. However, that's not what gets written in the \fIconfig.h\fR file because of the \fIsed\fR filter we have already seen, which will transform the second form into: .Ex /*#define HAS_BCOPY /**/ .Ef That's a handy form for later editing of \fIconfig.h\fR because you only need to remove the leading '/*' if you want to override \fIConfigure\fR's choice. Likewise, you may add a single '/*' at the beginning of a '#define' line to avoid the definition of a particular symbol. This is why each symbol definition is protected by a trailing '/**/', to close the leading comment opened by '/*' (comments are not nested in C). .PP Now transforming '#undef' into '/*#define' is nice, but if we want to actually write a '#undef', we're stuck... unless we write it as '#un-def' and let \fIsed\fR fix that to '#undef' while producing \fIconfig.h\fR, which is what is actually done here. .PP The same kind of reasoning applies to those two lines: .Ex #\$\&d_dup2 HAS_DUP2 /**/ #\$\&i_string I_STRING /**/ .Ef and assuming \fIconfig.sh\fR defines: .Ex d_dup2='define' i_string='undef' .Ef we'll get in the produced \fIconfig.h\fR: .Ex #define HAS_DUP2 /**/ /*#define I_STRING /**/ .Ef Clear as running water? Good! .PP Now it should be obvious that by including \fIconfig.h\fR in all your C source files, you get to know what \fIConfigure\fR has guessed on your system. In effect, by using those symbols, you are writing configured C code, since \fImetaconfig\fR will know that you need those symbols and will generate a suitable \fIconfig_h.SH\fR file as well as all the necessary code in \fIConfigure\fR to compute a proper value for them (by assigning values to associated shell variables). ''' .SS Running Metaconfig .PP Let's focus on the \fImetaconfig\fR program for a while to understand how it uses its units and your source code to produce all the needed configuration files. If you intend to write new units, you should have a good understanding of the whole scheme. .PP If there is no MANIFEST.new file, \fImetaconfig\fR will try to use the MANIFEST file instead, for convenience. Everywhere we mention MANIFEST.new, it can be understood as MANIFEST provided there is no MANIFEST.new file found at the root of your package. .PP Assuming your MANIFEST.new file is properly set and lists all the source files you wish to configure, and that you have run \fIpackint\fR in your root source directory to create a \fI.package\fR file, you may run \fImetaconfig\fR and you'll get the following: .Ex \$ metaconfig Locating units... Extracting dependency lists from 312 units... Extracting filenames (*.[chyl] and *.SH) from MANIFEST.new... Building a Wanted file... .in +2 Scanning .[chyl] files for symbols... Scanning .SH files for symbols... .in -2 Computing optimal dependency graph... .in +2 Building private make file... Determining loadable units... Updating make file... .in -2 Determining the correct order for the units... Creating Configure... Done. .Ef The first phase looks for all the units files (ending with .U) in the public directory first, then in your private one. If you copy a public file in your private U directory (i.e. a directory named U at the top level of your package), it will override the public version. Once it has a list of all the available units, it parses them and extracts all the ?MAKE: lines to know about the dependencies and the known shell symbols. It also focuses on the ?H: lines to learn about the C symbols and which shell symbols needs to be computed to get a proper value for that C symbol (so we have another level of dependencies here). .PP Next, the proper filenames are extracted from the MANIFEST.new files and a \fIWanted\fR file is built: that file lists all the C symbols and the shell symbols needed for that package. We first scan the C-type files for C symbols, then propagate the dependencies to their associated shell symbols (gathered from ?H: lines). Next .SH files are scanned and finally all the shell symbols are known. .PP A temporary Makefile is built and metaconfig tries to \fImake\fR all the shell symbols to see what commands (listed on the second ?MAKE: lines) are executed, and thus which units are really needed. Optional units not otherwise required are removed and a second Makefile is generated. This time, we know about all the units and their respective orders, optional units having been removed and default values computed for their shell symbols. The \fIConfigure\fR script can then be generated, along with \fIconfig_h.SH\fR. We're done. ''' .SS Conventions .PP Proper conventions needs to be followed to make the whole process sound. There is a case convention for units and a variable naming convention. .PP All units should have their first letter lower-cased, unless they are special units. By special, we mean they do not really define new shell variables that can be used by the user in his .SH files, but rather units producing scripts or shell variables that are to be used internally by the \fIConfigure\fR script. Typical examples are the \fIInit.U\fR file which is the main variable initialization, or \fIMyread.U\fR which produces the \fImyread\fR script used almost everywhere in \fIConfigure\fR when a question is to be asked to the user. .PP Non-special units then subdivise in two distinct groups: units defining variables associated to a C symbol and units defining shell variables of their own. The first group is further divided in variables related to include files (their name begin with \fIi_\fR) and variables related to other definitions (name starting with \fId_\fR). The second group have names standing for itself, for instance \fIcc.U\fR defines the \fI\$\&cc\fR shell variable whose value is the C compiler to be used. .PP Special units sometimes reserve themselves some pre-defined variable and return "results" in other well-known variables. For instance, the \fImyread\fR script produced by Myread.U expects the prompt in \fI\$rp\fR, the default answer in \fI\$dflt\fR and places the user answer in \fI\$ans\fR. This is not documented in this manual page: you have to go and look at the unit itself to understand which variables are used and how the unit is to be used. ''' .SS Using The Glossary .PP The Glossary file is automatically produced by the \fImakegloss\fR script, which extracts the information from ?S:, ?C: and ?MAKE: lines and reformats them into an alphabetically sorted glossary. It is important to read the Glossary to know about the symbols you are allowed to use. However, the Glossary will not tell you how to use them. Usually, that's up to you. .PP One day, you will probably write your own units and you will know enough about \fImetaconfig\fR to do so quickly and efficiently. However, never forget to properly document your work in the ?S: and ?C: lines, or other people will not be able to reuse it. Remember about the time where you had only the Glossary and this manual page to get started. ''' .SS Conclusion .PP Now that you know the \fImetaconfig\fR basics, you should read the \fIDESCRIPTION\fR section, then skip to the \fIREFERENCE\fR section to learn about all the gory details such as the allowed syntax for unit control lines (lines starting with a '?') or the distinct MAKE commands you are allowed to use. .SH REFERENCE This section documents the internals of \fImetaconfig\fR, basically the unit syntax, the special units you should know about and the hint files. ''' .SS General Unit Syntax .PP A metaconfig unit is divided into two distinct parts. The header section (lines starting with '?') and a shell section (code to be included in the \fIConfigure\fR script). It is possible to add '?X:' comments anywhere within the unit, but the other '?' lines (also called \fIcontrol lines\fR) have a strict ordering policy. .PP If a control line is too long, it is possible to use a continuation by escaping the final new-line with a backslash and continuing on the next line (which should then be indented by spaces or tabs). .PP The following is a formal description of each of the control lines. Unless stated otherwise, the order of this presentation is the order to be used within the unit. .TP 5 ?RCS: \fIfree text\fR To be used for RCS comments, at the top of the unit. .TP ?X: \fIany text\fR General purpose comments. May appear anywhere in the unit but must be left justfied. For RCS comments, please use the ?RCS: comment form. .TP ?MAKE:\fIsymbol list\fR: \fIdependency list\fR [\fI+optional\fR] This is the first dependency line. The first \fIsymbol list\fR should list all the symbols built by this unit (i.e. whose value is computed by the shell section of the unit). Symbols should be space separated. If a defined symbol is for internal use only and should not appear in the generated \fIconfig.sh\fR file, then it should be preceded by a '+' (not to be confused with optional dependencies defined hereafter). The second part of the list (after the middle ':') is the unit dependency. It should list all the needed special units, as well as all the symbols used by the shell implementation. If a symbol is nedded but its configuration value is not critical, it can be preceded by a '+', in which case it is called a conditional dependency: its corresponding unit will be loaded if, and only if, that symbol is otherwise really wanted; otherwise the default value will be used. .TP ?MAKE:\fItab\fR \fIcommand\fR There can be one or more command lines following the initial dependency lines. Those commands will be executed when the unit is wanted to load them into \fIConfigure\fR. See the paragraph about make commands for more information. Note that the leading \fItab\fR character is required before the \fIcommand\fR. .TP ?Y:\fIlayout\fR Declare a layout directive for this unit. That directive may be one of the strings \fItop\fR, \fIdefault\fR or \fIbottom\fR (case does not matter, recommended style is to spell them out uppercased). If omitted, \fIdefault\fR is assumed. .sp This directive is only required if you wish to force a unit at the top or the bottom of the generated \fIConfigure\fR script, as unit dependencies permit it. Important questions may thus be forced at the beginning. Within the same layout class, units are sorted alphabetically with two special cases for d_* and i_* units, forced respectively at the top and bottom of their classes (but these should belong to the default class). .sp It you force at the top a unit whose dependencies require all the other unit to precede it, you achieve nothing interesting. Therefore, that directive should really be used to increase the priority of some interactive units that do not depend on many other user-visible symbols, like path-related questions. .TP ?S:\fIsymbol_name\fR [(\fIobsolete symbol list\fR)]: Introduces a shell symbol. This first line names the symbol, optionally followed by a list enclosed between parenthesis and giving the obsolete equivalent. Those obsolete symbols will be remapped to the new \fIsymbol_name\fR if the \fB\-o\fR option is given to \fImetaconfig\fR. .TP ?S:\fIany text, for Glossary\fR Basically a comment describing the shell symbol, which will be extracted by \fImakegloss\fR into the Glossary file. .TP ?S:. Closes the shell symbol comment. .TP ?C:\fIsymbol_name\fR [~ \fIalias\fR] [(\fIobsolete symbol list\fR)]: Introduces a new C symbol. The \fIalias\fR name is the name under which the C symbol will be controlled, i.e. if the \fIalias\fR symbol is wanted, then that C symbol will be written in the \fIconfig_h.SH\fR file. Usually, the alias is just '%<' (stands for the unit's name) and there is also a ?W: line mapping a C symbol to the \fIalias\fR. Also the relevant parts of the ?H: lines are explicitely protected by a '?%<' condition. See the symbol aliasing paragraph for more details. The remaining of the line is the optional \fIobsolete symbol list\fR, which lists old equivalents for the new \fIsymbol_name\fR. .TP ?C:\fIany text, for Glossary and config_h.SH\fR Basically a comment describing the C symbol, which will be extracted by \fImakegloss\fR into the Glossary file and by \fImetaconfig\fR into the \fIconfig_h.SH\fR file if the symbol is wanted (or if its alias is wanted when symbol aliasing is used). .TP ?C:. Closes the C symbol comment. .TP ?H:?\fIsymbol\fR:\fIconfig_h.SH stuff\fR This is the general inclusion request into \fIconfig_h.SH\fR. The line is only written when the guarding \fIsymbol\fR is really wanted. This general form is needed when C symbol aliasing was used. Otherwise, if you use one of the other "standard" forms, the guarding is automatically done by \fImetaconfig\fR itself. .TP ?H:#\fI\$d_var VAR\fR "\fI\$var\fR" Conditionally defines the \fIVAR\fR C symbol into \fI\$var\fR when \fI$d_var\fR is set to '\fIdefine\fR'. Implies a '?\fIVAR\fR:' guarding condition, and \fImetaconfig\fR automatically links \fIVAR\fR to its two shell variable dependencies (i.e. both \fI\$d_var\fR and \fI\$var\fR will be flagged as \fIwanted\fR if \fIVAR\fR is used in C sources). .TP ?H:#define \fIVAR\fR [\fIoptional text\fR] Always defines the \fIVAR\fR C symbol to some value. Implies a '?\fIVAR\fR:' guarding condition. An automatic shell dependency is made to the unit itself. .TP ?H:#define \fIVAR(x,y,z)\fR \fI\$var\fR Always defines the macro \fIVAR\fR to be the value of the \fI\$var\fR variable. It is up to the unit to ensure \fI\$var\fR holds a sensible value. An automatic dependency between the C macro \fIVAR\fR and the shell variable is established, and the whole line is guarded by an implicit '?\fIVAR\fR:'. .TP ?H:#\fI\$d_var VAR\fR Conditionally defines \fIVAR\fR if \fI\$d_var\fR is set to '\fIdefine\fR'. Implies a '?\fIVAR\fR:' guarding condition. An automatic shell dependency is generated towards \fI\$d_war\fR. .TP ?H:#define \fIVAR\fR "\fI\$var\fR" Assigns a configured value to the \fIVAR\fR C symbol. Implies a '?\fIVAR\fR:' gurading condition. An automatic shell dependency is generated to link \fIVAR\fR and \fI\$var\fR. .TP ?H:. Closes the \fIconfig_h.SH\fR inclusion requests. .TP ?M:\fIC symbol\fR: \fIC dependencies\fR Introduces magic definition concerning the C symbol, for \fIconfmagic.h\fR, and defines the guarding symbol for the remaining ?M: definitions. This line silently implies '?W:%<:\fIC symbol\fR', i.e. the unit will be loaded into Configure if the C symbol appears within the C sources, whether magic is used or not. The C dependencies are activated when magic is used, in order to force their definition in \fIconfig_h.SH\fR. However, if magic is \fBnot\fR used but the C symbol appears in the source without the needed C dependencies, you will be warned every time the Wanted file is built, since it may be a portability issue (and also because the unit is unconditionally loaded into Configure whenever the C symbol is used, regardless of the other ?C: lines from the unit). .TP ?M:\fIcpp defs\fR Defines the magic cpp mapping to be introduced in confmagic.h whenever the concerned symbol is used. There is an implicit '?\fIsym\fR' guarding where \fIsym\fR is the symbol name defined by the leading ?M: line. .TP ?M:. Closes the \fIconfmagic.h\fR inclusion request. .TP ?W:\fIshell symbol list\fR:\fIC symbol list\fR Ties up the destiny of the shell symbols with that of the C symbols: if any of the C symbols listed is wanted, then all the shell symbols are marked as wanted. Useful to force inclusion of a unit (shell symbol list set to \&'%<') when the presence of some C symbol is detected. The shell symbol list may be left empty, to benefit from the side effect of C symbol location within the builtin pre-processor (symbol being \fIdefined\fR for that pre-processor if located in the source). To look for patterns with a space in them, you need to quote the C symbols within simple quotes, as in \&'struct timezone'. .TP ?V:\fIread-only symbols\fR:\fIread-write symbols\fR This is a \fImetalint\fR hint and should be used only in special units exporting some shell variables. The variables before the middle ':' are exported read-only (changing them will issue a warning), while other symbols may be freely read and changed. .TP ?F:\fIfiles created\fR This line serves two purposes: it is a \fImetalint\fR hint, and also a placeholder for future \fIjmake\fR use. It must list three kind of files: the temporary one which are created for a test, the private UU ones created in the UU directory for later perusal, and the public ones left in the root directory of the package. Temporary files must be listed with a preceding '!' character (meaning "no! they're not re-used later!"), private UU files should be preceded by a './' (meaning: to use them, say \fI./file\fR, not just \fIfile\fR), and public ones should be named as-is. .TP ?T:\fIshell temporaries\fR Another \fImetalint\fR hint. This line lists all the shell variables used as temporaries within the shell section of this unit. .TP ?D:\fIsymbol\fR='\fIvalue\fR' Initialization value for symbols used as conditional dependencies. If no ?D: line is found, then a null value is used instead. The \fImetalint\fR program will warn you if a symbol is used at least once as a conditional dependency and does not have a proper ?D: initialization. It's a good practice to add those lines even for a null initialization since it emphasizes on the possibly optional nature of a symbol. .TP ?O:\fIany message you want\fR This directive indicates that this unit is obsolete as a whole. Whenever usage of any of its symbols is made (or indirect usage via dependencies), the message is output on the screen (on stderr). You can put one ore more lines, in which case each line will be printed, in order. .TP ?LINT:\fImetalint hints\fR See the \fImetalint\fR manual page for an explaination of the distinct hints that can be used. .TP ?INIT:\fIinitialization code\fR The initialization code specified by this line will be loaded at the top of the \fIConfigure\fR script provided the unit is needed. ''' .SS C Symbol Aliasing .PP Sometimes it is not possible to rely on \fImetaconfig\fR's own default selection for \fIconfig_h.SH\fR comments and C symbol definition. That's where aliasing comes into play. Since it's rather tricky to explain, we'll study an example to understand the underlying mechanism. .PP The d_const.U unit tries to determine whether or not your C compiler known about the \fIconst\fR keyword. If it doesn't we want to remap that keyword to a null string, in order to let the program compile. Moreover, we want to automatically trigger the test when the \fIconst\fR word is used. .PP Here are the relevant parts of the d_const.U unit: .Ex ?MAKE:d_const: cat cc ccflags Setvar ?MAKE: -pick add \$@ %< ?S:d_const: ?S: This variable conditionally defines the HASCONST symbol, which ?S: indicates to the C program that this C compiler knows about the ?S: const type. ?S:. ?C:HASCONST ~ %<: ?C: This symbol, if defined, indicates that this C compiler knows about ?C: the const type. There is no need to actually test for that symbol ?C: within your programs. The mere use of the "const" keyword will ?C: trigger the necessary tests. ?C:. ?H:?%<:#$\&d_const HASCONST /**/ ?H:?%<:#ifndef HASCONST ?H:?%<:#define const ?H:?%<:#endif ?H:. ?W:%<:const ?LINT:set d_const ?LINT:known const : check for const keyword echo " " echo 'Checking to see if your C compiler knows about "const"...' >&4 $cat >const.c <<'EOCP' main() { const char *foo; } EOCP if $\&cc -c $\&ccflags const.c >/dev/null 2>&1 ; then val="$\&define" echo "Yup, it does." else val="$\&undef" echo "Nope, it doesn't." fi set d_const eval $\&setvar .Ef First we notice the use of a ?W: line, which basically says: "This unit is wanted when the \fIconst\fR keyword is used in a C file.". In order to conditionally remap \fIconst\fR to a null string in \fIconfig.h\fR, I chose to conditionally define \fIHASCONST\fR via \fI\$\&d_const\fR. .PP However, this raises a problem, because the \fIHASCONST\fR symbol is not going to be used in the sources, only the \fIconst\fR token is. And the ?H: line defining \fIHASCONST\fR is implicitely guarded by '?HASCONST'. Therefore, we must add the explicit '?%<' constraint to tell \fImetaconfig\fR that those lines should be included in \fIconfig_h.SH\fR whenever the \&'%<' symbol gets wanted (%< refers to the unit's name, here \fId_const\fR). .PP That's almost perfect, because the ?W: line will want \fId_const\fR whenever \fIconst\fR is used, then the ?H: lines will get included in the \fIconfig_h.SH\fR file. However, the leading comment (?C: lines) attached to \fIHASCONST\fR is itself also guarded via \fIHASCONST\fR, i.e. it has an implicit '?HASCONST' constraint. Hence the need for \fIaliasing\fR the \fIHASCONST\fR symbol to '%<'. .PP The remaining part of the unit (the shell part) is really straightforward. It simply tries to compile a sample C program using the \fIconst\fR keyword. If it can, then it will define \fI\$\&d_const\fR via the \fI\$\&setvar\fR fonction (defined by the \fISetvar.U\fR unit). See the paragraph about special units for more details. ''' .SS Make Commands .PP On the ?MAKE: command line, you may write a shell command to be executed as-is or a special \fI-pick\fR command which is trapped by \fImetaconfig\fR and parsed to see what should be done. The leading '-' is only there to prevent \fImake\fR from failing when the command returns a non-zero status -- it's not really needed since we use '\fImake -n\fR' to resolve the dependencies, but I advise you to keep it in case it becomes mandatory in future versions. The syntax of the \fIpick\fR command is: .Ex -pick \fIcmd\fR \$@ \fItarget_file\fR .Ef where \fI\$@\fR is the standard macro within Makefiles standing for the current target (the name of the unit being built, with the final .U extension stripped). The \fIcmd\fR part is the actual \fImetaconfig\fR command to be run, and the \fItarget_file\fR is yet another parameter, whose interpretation depends on the \fIcmd\fR itself. It also has its final .U extension stripped and normally refers to a unit file, unless it start with './' in which case it references one of the \fImetaconfig\fR control files in the '\fI.MT\fR directory. .PP The available commands are: .TP 10 add Adds the \fItarget_file\fR to \fIConfigure\fR. .TP add.Config_sh Fills in that part of \fIConfigure\fR producing the \fIconfig.sh\fR file. Only used variables are added, conditional ones (from conditional dependencies) are skipped. .TP add.Null Adds the section initializing all the shell variables used to an empty string. .TP c_h_weed Produces the \fIconfig_h.SH\fR file. Only the necessary lines are printed. .TP cm_h_weed Produces the \fIconfmagic.h\fR file. Only the necessary lines are printed. This command is only enabled when the \fB\-M\fR switch is given, or when a \fIconfmagic.h\fR file already exists. .TP close.Config_sh Adds the final 'EOT' symbol on a line by itself to end the here document construct producing the \fIconfig.sh\fR file. .TP prepend Prepends the content of the target to the \fItarget_file\fR if that file is not empty. .TP weed Adds the unit to \fIConfigure\fR like the \fIadd\fR command, but make some additional tests to remove the '?\fIsymbol\fR' and '%\fIsymbol\fR' lines from the \fItarget_file\fR if the symbol is not wanted or conditionally wanted. The '%' form is only used internally by \fImetaconfig\fR while producing its own .U files in the '\fI.MT\fR' directory. .TP wipe Same as \fIadd\fR really, but performs an additional macro substitution. The available macros are described in the \fIHardwired Macros\fR paragraph. .PP As a side note, \fImetaconfig\fR generates a \fI-cond\fR command internally to deal with conditional dependencies. You should not use it by yourself, but you will see it if scanning the generated \fIMakefile\fR in the \fI.MT\fR directory. ''' .SS Hardwired Macros .PP The following macros are recognized by the \fIwipe\fR command and subsituted before inclusion in \fIConfigure\fR: .TP 10 The base revision number of the package, derived from \fI.package\fR. .TP The current date. .TP The e-mail address of the maintainer of this package, derived from your \fI.package\fR. .TP The name of the package, as derived from your \fI.package\fR file. .TP The patch level of the \fImetaconfig\fR program (deprecated in favor of ). .TP The SVN revision level of the \fImetaconfig\fR program. .TP The version number of the \fImetaconfig\fR program. .PP Those macros are mainly used to identify the \fImetaconfig\fR version that generated a particular \fIConfigure\fR script and for which package it was done. The e-mail address of the maintainer is hardwired in the leading instructions that \fIConfigure\fR prints when starting. .PP Recent \fImetaconfig\fR versions understand a much more general syntax of the form: .Ex <\$variable> .Ef which is replaced at Configure-generation time by the value of \fIvariable\fR taken from your \fI.package\fR file. Eventually, the old hardwired macro format will disappear, and <\$baserev> will replace in all the supplied units. ''' .SS Special Units .PP The following special units are used to factorize code and provide higher level functionalities. They either produce a shell script that can be sourced or a shell variable that can be \fIeval\fR'ed. Parameter passing is done via well-know variables, either named or anonymous like \$1, \$2, etc... (which can be easily set via the shell \fIset\fR operator). When \fIConfigure\fR executes, it creates and goes into a \fIUU\fR directory, so every produced script lies in there and does not interfere with the files from your package. .PP Here are the sepcial units that you should know about, and the way to use them. .TP 5 Cppsym.U This unit produces a shell script called \fICppsym\fR, which can be used to determine whether any symbol in a list is defined by the C preprocessor or C compiler you have specified. It can determine the status of any symbol, though the symbols in \fI$al\fR (attribute list) are more easily determined. .TP Csym.U This sets the \$csym shell variable, used internally by \fIConfigure\fR to check whether a given C symbol is defined or not. A typical use is: .Ex set symbol result [-fva] [previous] eval \$\&csym .Ef That will set the \fIresult\fR variable to 'true' if the function [-f], variable [-v] or array [-a] is defined, 'false' otherwise. If a previous value is given and the \fB\-r\fR switch was provided to \fIConfigure\fR (see the \fIConfigure Options\fR paragraph), then that value is re-used without questioning. .sp The way this computation is done depends on the answer the user gives to the question \fIConfigure\fR will ask about whether it should perform an .I nm extraction or not. If the exctraction was performed, the unit simply looks through the symbol list, otherwise it performs a compile-link test, unless .B \-r was given to reuse the previously computed value, naturally... .TP End.U By copying this unit into your private \fIU\fR directory and appending dependencies on the ?MAKE: line, you can force a given unit to be loaded into \fIConfigure\fR even if it is not otherwise wanted. Some units may only be forced into \fIConfigure\fR that way. .TP Filexp.U This unit produces a shell script \fIfilexp\fR which will expand filenames beginning with tildes. A typical use is: .Ex exp_name=\`./filexp \$name\` .Ef to assign the expanded file name in \fIexp_name\fR. .TP Findhdr.U This unit produces a \fIfindhdr\fR script which is used to locate the header files in \fI$\&usrinc\fR or other stranger places using cpp capabilities. The script is given an include file base name like 'stdio.h' or 'sys/file.h' and it returns the full path of the inlcude file and a zero status if found, or an empty string and a non-zero status if the file could not be located. .TP Getfile.U This unit produces a bit of shell code that must be sourced in order to get a file name and make some sanity checks. Optionally, a ~name expansion is performed. .sp To use this unit, \fI\$rp\fR and \fI\$dflt\fR must hold the question and the default answer, which will be passed as-is to the \fImyread\fR script (see forthcoming \fIMyread.U\fR). The \fI\$fn\fR variable controls the operation and the result is returned into \fI\$ans\fR. .sp To locate a file or directory, put 'f' or 'd' in \fI$fn\fR. If a '~' appears, then ~name substitution is allowed. If a '/' appears, only absolute pathnames are accepted and ~name subsitutions are always expanded before returning. If '+' is specified, existence checks are skipped. If 'n' appears within \fI\$fn\fR, then the user is allowed to answer 'none'. .sp Usually, unless you asked for portability, ~name substitution occurs when requested. However, there are some times you wish to bypass portability and force the substitution. You may use the 'e' letter (expand) to do that. .sp If the special 'l' (locate) type is used, then the \fI\$fn\fR variable must end with a ':', followed by a file basename. If the answer is a directory, the file basename will be appended before testing for file existence. This is useful in locate-style questions like this: .Ex dflt='~news/lib' : no need to specify 'd' or 'f' when 'l' is used fn='l~:active' rp='Where is the active file?' \&. ./getfile active="\$ans" .Ef .sp Additionally, the 'p' (path) letter may be used in conjunction with 'l' to tell \fIgetfile\fR that an answer without a '/' in it should be accepted, assuming that it will be in everyone's PATH at the time this value will be needed. .sp Also useful is the possibility to specify a list of answers that should be accepted verbatim, bypassing all the checks. This list must be within parenthesis and items must be comma separated, with no interleaving spaces. Don't forget to quote the resulting string since parenthesis are meaningful to the shell. For instance: .Ex dflt='/bin/install' fn='/fe~(install,./install)' rp='Use which install program?' \&. ./getfile install="\$ans" .Ef would let the user only specify fully qualified paths referring to existing files, but still allow the special "install" and "./install" answers as-is (assuming of course something will deal with them specially later on in the chain since they do not conform with the general expected frame). .sp If the answer to the question is 'none', then the existence checks are skipped and the empty string is returned. Note that since \fIgetfile\fR calls \fImyread\fR internally, all the features available with \fImyread\fR apply here to. .sp If a completely expanded value is needed (for instance in a Makefile), you may use the \fI\$ansexp\fR variable which is always set up properly by \fIgetfile\fR as the expanded version of \fI\$ans\fR. Of course, it will not expand ~name if you did not allow that in the first place in the \fI\$fn\fR variable. .TP Inhdr.U This unit produces the \fI\$inhdr\fR shell variable, used internally by \fIConfigure\fR to check whether a set of headers exist or not. A typical use is: .Ex set header i_header [ header2 i_header2 ... ] eval \$\&inhdr .Ef That will print a message, saying whether the header was found or not and set the \fIi_header\fR variable accordingly. If more than one header is specified and the first header is not found, we try the next one, until the list is empty or one is found. .TP Inlibc.U This unit produces the \fI\$inlibc\fR shell variable, used internally by \fIConfigure\fR to check whether a given C function is defined or not. A typical use is: .Ex set function d_func eval \$\&inlibc .Ef That will print a message, saying whether the function was found or not and set \fI\$d_func\fR accordingly. Internally, it used the \fI\$\&csym\fR routine. .TP Loc.U This important unit produces a shell script \fIloc\fR which can be used to find out where in a list of directories a given file lies. The first argument specifies the file to be located, the second argument is what will be returned if the search fails, and the reamining arguments are a list of directories where the file is to be searched. For instance: .Ex dflt=\`./loc sendmail.cf X /usr/lib /var/adm/sendmail /lib\` .Ef would set \fI\$dflt\fR to \fIX\fR if no \fIsendmail.cf\fR file was found under the listed directories, or something like \fI/usr/lib/sendmail.cf\fR on some systems. See also \fIGetfile.U\fR. .TP MailAuthor.U This unit needs to be included on the ?MAKE: line of your own private End.U to make it into \fIConfigure\fR. It offers the user to register himself to the author, optionally being notified when new patches arrive or receiving them automatically when issued. You need to install \fImailagent\fR to do this (at least version 3.0). .TP MailList.U This unit needs to be included on the ?MAKE: line of your own private End.U to make it into \fIConfigure\fR. It offers the user to subscribe or unsubscribe to a mailing list where discussion related to the package are taking place. You need to run \fIpackinit\fR and answer the mailing list related questions to set up the proper variables in your \fI.package\fR before this unit may become operational. .TP Myinit.U Copy this unit into your private \fIU\fR directory to add your own default values to some internal variables. This unit is loaded into \fIConfigure\fR after all the default initializations have been done. .TP Myread.U This unit produces the \fImyread\fR shell script that must be sourced in order to do a read. It allows shell escapes, default assignment and parameter evaluation, as documented in the Instruct.U unit. It also allows dynamic setting of the \fB\-d\fR option, which will be used for the remaining of the script execution. .sp To use this unit, \fI\$rp\fR must hold the question and \fI\$dflt\fR should contain the default answer. The question will be printed by the script itself, and the result is returned in the \fI\$ans\fR variable. .sp Here is a typical usage: .Ex dflt='y' rp='Question?' \&. ./myread value="\$ans" .Ef See the unit itself for more information. .TP Oldconfig.U This unit must be part of your dependency ?MAKE: line when some of your units tries to reuse an old symbol value. This unit is responsible for getting the old answers from \fIconfig.sh\fR or providing useful hints when running on a given platform for the first time. See the \fIConfigure Hints\fR paragraph for more information about hints. .TP Prefixit.U The purpose of this unit is to detect changes in the installation prefix directory to recompute automatically suitable defaults from previous answers. It relies on the value of the \fI\$oldprefix\fR variable which holds the previous prefix directory when it changed, and is empty otherwise. For instance, if the prefix was changed from \fI/opt\fR to \fI/usr/local\fR, then the previous binary installation directory will be changed from \fI/opt/bin\fR to \fI/usr/local/bin\fR, or will remain unchanged if it was, say, \fI/bin\fR. .sp You need to call \fBset\fR before issuing an \fBeval\fR on \fI\$prefixit\fR, such as: .Ex set dflt var [dir] eval \$prefixit .Ef which would set \fI\$dflt\fR to \fI\$var\fR or \fI\$prefix/dir\fR depending on whether the prefix remained the same or not. If \fIdir\fR is the string \fInone\fR, a single space value in \fI\$dflt\fR is kept as-is, even when the prefix changes. If \fIdir\fR is omitted, then \fI\$dflt\fR is set to an empty string if the prefix changed, to \fI\$var\fR otherwise. .TP Prefixup.U The intent of thit unit is similar to that of Prefixit.U, i.e. it helps fixing the default string to accomodate prefix changes. However, the shell variable \fI\$prefixup\fR, when evaluated, will only restore ~name expansions, should prefix use such an escape mechanism. Use it as: .Ex set dflt eval \$prefixup .Ef before prompting via \fIgetfile\fR for instance. If the prefix does not make use of ~name expanstion, then the above will be a no-op on the \fI$dflt\fR variable, naturally. .TP Typedef.U This unit produces the \fI\$typedef\fR shell variable, used internally by \fIConfigure\fR to check whether a typedef exists or not. A typical use is: .Ex set typedef val_t default [ includes ] eval \$\&typedef .Ef This will set the variable \fIval_t\fR to the value of \fIdefault\fR if the typedef was not found among the listed include files, or to \fItypedef\fR if found. If no include files are specified, the unit looks in \fI\fR only. If you specifiy some includes, only those are looked at. .TP Unix.U The purpose of this unit is to define some of the most common UNIX-isms via variables which can be altered from the command line or via proper hint files. In particular, \fI\$_exe\fR, \fI\$_o\fR and \fI\$_a\fR are set. All the units should refer to \fI\$_o\fR and not to \fI.o\fR directly. The '.' is part of these variables. .TP Setvar.U This unit produces the \fI$setvar\fR variable, which is used internally by \fIConfigure\fR to set a \fIdefine\fR/\fRundef\fR value to a given symbol, emitting a warning when it suddenly changes from a previous value. For instance: .Ex val="\$\&define" set d_variable eval \$\&setvar .Ef If the previous \fI\$d_variable\fR value was non-null and \fI\$val\fR is different, a "whoa" warning is issued. .TP Whoa.U This unit produces the \fIwhoa\fR script, which emits a warning when the \fIvalue\fR in variable whose name is \fI\$var\fR is not the same as its old previous value held in \fI\$was\fR. Upon return, \fI\$td\fR and \fI\$tu\fR hold the proper value to \fIdefine\fR or \fIundef\fR the variable. See examples in \fIInlibc.U\fR. ''' .SS Builtin Pre-processor .PP Each unit to be included in \fIConfigure\fR is ran through a built-in pre-processor. Pre-processor statements are introduced by the '@' character ('#' is the shell comment character). It functions merely as the C pre-processor does but allows for shell and perl escapes. Here are the available functions: .TP 10 @if \fIexpression\fR If \fIexpression\fR is true, continue loading code until @end, @elsif or @else. .TP @elsif \fIexpression\fR Alternative choice. If \fIexpression\fR is true, continue loading code until @end, another @elsif or @else. .TP @else Default code to be loaded if the @if \fIexpression\fR was false and none of the optional @elsif matched. Load until @end. .TP @end Close the conditional loading statement opened by @if. .TP @define \fIsymbol\fR Tells the pre-processor that \fIsymbol\fR is defined from now on. .PP The conditional \fIexpression\fR can include symbol names (value is true if symbol is wanted or defined via \fI@define\fR or shell/perl escapes. Those atoms can be combined using the traditional boolean operators '!' for negation, '&&' for logical and, and '||' for logical or. .PP Text enclosed within single brackets is a shell test, while text between double brakets is a perl test. Namely the expressions: .Ex { \fIshell text\fR } {{ \fIperl text\fR }} .Ef are translated into: .Ex if \fIshell text\fR >/dev/null 2>&1; then exit 0; else exit 1; fi if (\fIperl text\fR) {exit 0;} else {exit 1;} .Ef and the exit status is used in the standard way to get a boolean value, i.e. 0 is true and everything else is false. Note that only simple conditions can be expressed in perl, until some complex code can be loaded within \fImetaconfig\fR and executed. .PP The built-in pre-processor can be used to finely tune some units (see \fId_gethname.U\fR for a complex example) depending on the symbols actually used by the program or the files present in the distribution. For instance, the \fIOldconfig.U\fR uses a test like: .Ex @if {test -d ../hints} .Ef and \fIConfigure\fR will contain hint-dependent code only if there is a \fIhints\fR directory in the package's top level directory. Note that tests are ran from within the '\fI.MT\fR' directory, hence the needed \&'../' in the test. .PP The pre-processor can also be used to avoid putting useless code when a symbol is not defined. Units defining more than one symbol can be protected that way (since the unit is loaded as a whole) by gathering symbol-dependent code within an @if/@end pair. For instance: .Ex @if I_TIME || I_SYS_TIME || I_SYS_TIME_KERNEL need_time_h='true' @else need_time_h='false' @end .Ef will test whether the source code makes any use of one of the three symbols that control the \fItime.h\fR or \fIsys/time.h\fR inclusion and define the shell symbol accordingly. That gives \fIConfigure\fR a feedback on what the sources need and avoid the drawback of having fixed frozen units. .PP Via the '?W:' lines, you can get intersting combinations. For instance, the \fIi_time.U\fR unit needs to know whether the C sources make any use of the \fIstruct timezone\fR type. Therefore, the line: .Ex ?W::timezone .Ef is used for its side-effect of defining the symbol \fItimezone\fR for the pre-processor. The unit code can then say: .Ex @if timezone for s_timezone in '-DS_TIMEZONE' ''; do @else s_timezone='' @end \&... code using s_timezone ... @if timezone done @end .Ef and have an extra loop trying two successive values for the \fIs_timezone\fR variable, but only if needed. ''' .SS Obsolete Symbols .PP Obsolete symbols are preserved to ease the transition with older .I metaconfig units. Unless the \fB\-o\fR switch is passed to \fImetaconfig\fR they will be ignored. However, an \fIObsolete\fR file will be generated, telling you which files are making use of those obsolete symbols and what are the new symbols to be used. .PP The lifetime for obsolete symbols is one full revision, i.e. they will be removed when the next base revision is issued (patch upgrades do not count of course). Therefore, it is wise to translate your sources and start using the new symbols as soon as possible. ''' .SS Configure Hints .PP It may happen that the internal configuration logic makes the wrong choices. For instance, on some platform, the \fIvfork()\fR system call is present but broken, so it should not be used. It is not possible to include that knowledge in the units themselves, because that might be a temporary problem which the vendor will eventually fix, or something that was introduced by a new OS upgrade. .PP Anyway, for all those tiny little problems that are too system-specific, \fImetaconfig\fR provides hint files support. To use it, you need to create a \fIhints\fR directory in the package's top level directory, and have it when you run \fImetaconfig\fR. That will load the hint-related part from \fIOldconfig.U\fR. .PP From then on, you may pre-set some of the shell variables \fIConfigure\fR uses in an OS-specific .sh file. There is code in \fIOldconfig.U\fR that tries to guess which hint files are needed by computing a standard name based on the system OS name, the kernel name, the release number, etc... Since this information is likely to change rapidly, I'm not documenting it here. You have to reverse engineer the code from \fIOldconfig.U\fR. .PP When you first release your package, your hints file directory should be empty. If the users of your package complain that they have problem with \fIConfigure\fR defaults on a particular system, you have to see whether this is a platform-specific problem or a general one. In the former case, it's time to introduce a new hint file, while in the latter, the corresponding unit should be revised. .PP For instance, SGI systems are known to have a broken \fIvfork()\fR system call, as of this writing. And the corresponding hint file name is \fIsgi.sh\fR. So all you need to do is create a \fIhints/sgi.sh\fR file in which you write: .Ex d_vfork="\$\&define" .Ef which will always remap \fIvfork\fR on \fIfork\fR (see \fId_vfork.U\fR). When running on SGI systems for the first time, \fIConfigure\fR will detect that there is an \fIhints/sgi.sh\fR file, and that we are on an IRIX machine (the kernel name is often /irix), therefore it will propose \fIsgi\fR as a possible hint. If the user accepts it, and since the \fI\$\&d_vfork\fR value is modified via the \fI$\&setvar\fR call, a \fIwhoa!\fR will be emitted to warn that we are about to override the value computed by \fIConfigure\fR. .PP Note that you don't have to provide \fIall\fR the hints known by \fIOldconfig.U\fR. If a hint file is missing, it will not be proposed as a possible choice. The heuristic tests ran to compute the possible hint candidates are flaky. If you have new values or different tests, please send them to me... ''' .SS Overriding Choices .PP If you create a \fIconfig.over\fR file in the top level directory, \fIConfigure\fR will ask you if you wish to load it to override the default values. This is done prior creation of the \fIconfig.sh\fR file, so it gives you a chance to patch the values stored in there. .PP This is distinct from the hints approach in that it is a local file, which the user is free to create for his own usage. You should not provide such a file yourself, but let the user know about this possibility. ''' .SS Configure Options .PP The \fIConfigure\fR script may be called with some options specified on the command line, to slightly modify its behaviour. Here are the allowed options: .TP 10 .B \-d Use defaults for all answers. .TP .B \-e Go on without questioning past the production of \fIconfig.sh\fR. .TP .B \-f \fIfile\fR Use the specified file as a default configuration. If this switch is not used, the configuration is taken from \fIconfig.sh\fR, when present. .TP .B \-h Print help message and exit. .TP .B \-r Reuse C symbols value if possible. This will skip the costly \fInm\fR symbol extraction. If used the first time (with no previous configuration file), \fIConfigure\fR will try to compile and link a small program in order to know about the presence of a symbol, or absence thereof. .TP .B \-s Silent mode. Only strings printed on file descriptor #4 will be seen on the screen (that's the important messages). It's not possible to completely turn off any output, but you may use '\fIConfigure -ders >/dev/null 2>&1\fR' to have a full batch run with no output and no user interaction required. .TP .B \-D\fI symbol=value\fR Pre-defines \fIsymbol\fR to bear the specified \fIvalue\fR. It is also possible to use '\fB-D\fI symbol\fR' which will use a default value of 'define'. .TP .B \-E Stop at the end of the configuration questions, after having produced a \fIconfig.sh\fR. This will not perform any '\fImake depend\fR' or .SH files extraction. .TP .B \-K Knowledgeable user. When you use this option, you know what you are doing and therefore the \fIconfig.sh\fR file will always be handled as if it was intended to be re-used, even though it might have been generated on an alien system. It also prevents aborting when \fIConfigure\fR detects an unusable C compiler or a wrong set of C flags. Further shortcuts might be turned on by this option as well in the future. This option is documented in the \fIConfigure\fR usage message, to remind us about its existence, but the given description is hoped to be cryptic enough. :-) .TP .B \-O Allow values specified via a \fB\-D\fR or \fB\-U\fR to override settings from any loaded configuration file. This is not the default behaviour since the overriding will not be propagated to variables derived from those you are presently altering. Naturally, without \fB-O\fR, the setting is only done when no configuration file is loaded, which is safe since derivative variables have not been computed yet... .TP .B \-S Perform variable substitution on all the .SH files. You can combine it with the \fB\-f\fR switch to propagate any configuration you like. .TP .B \-U\fI symbol=\fR Pre-sets \fIsymbol\fR to bear an empty value. It is also possible to use '\fB-U\fI symbol\fR' which will set \fIsymbol\fR to 'undef'. .TP .B \-V Print the version number of the \fImetaconfig\fR that generated this .I Configure script and exit. ''' .SS Running Environment Upon starting, \fIConfigure\fR creates a local \fIUU\fR directory and runs from there. The directory is removed when Configure ends, but this means you must run the script from a place where you can write, i.e. not from a read-only file system. .PP You can run \fIConfigure\fR remotely though, as in: .Ex ../package/Configure .Ef to configure sources that are not present locally. All the generated files will be put in the directory where you're running the script from. This magic is done thanks to the src.U unit, which is setting the \fI\$src\fR and \fI\$rsrc\fR variables to point to the package sources. That path is full or relative, depending on whether \fIConfigure\fR was invoked via a full or relative path. .PP From within the \fIUU\fR subdirectory, you can use \fI\$rsrc\fR to access the source files (units referring to source files link hints shall always use this mechanism and not assume the file is present in the parent directory). All the Makefiles should use the \$src variable as a pointer to the sources from the top of the build directory (where \fIConfigure\fR is run), either directly or via a VPATH setting. .PP When running \fIConfigure\fR remotely, the .SH files are extracted in the build directory, not in the source tree. However, it requires some kind of a \fImake\fR support to be able to compile things in a build directory whilst the sources lie elsewhere. ''' .SS Using Magic Redefinitions .PP By making use of the \fB\-M\fR switch, some magic remappings may take place within a \fIconfmagic.h\fR file. That file needs to be included after \fIconfig.h\fR, of course, but also after all the other needed include files. Namely: .Ex #include "config.h" \&... \&... \fIother inclusions\fR ... \&... #include "confmagic.h" .Ef Typically, \fIconfmagic.h\fR will attempt to remap \fIbcopy()\fR on \fImemcpy()\fR if no \fIbcopy()\fR is available locally, or transform \fIvfork\fR into \fIfork\fR when necessary, hence making it useless to bother about the \fIHAS_VFORK\fR symbol. .PP This configuration magic is documented in the Glossary file. ''' .SS Unit Templates .PP There is a set of unit templates in the \fImetaconfig\fR source directory, which are intended to be used by a (not yet written) program to quickly produce new units for various kind of situations. No documentation for this unfinished project, but I thought I would mention it in the manual page in case you wish to do it yourself and then contribute it... .SH AUTHORS Larry Wall for version 2.0. .br Harlan Stenn for important unit extensions. .br Raphael Manfredi . .br Many other contributors for the \fImetaconfig\fR units. See the credit file for a list. .SH FILES .TP 10 .PD 0 LIB/dist/mcon/U/*.U Public unit files .TP U/*.U Private unit files .TP LIB/dist/mcon/Glossary Glossary file, describing all the metaconfig symbols. .TP Obsolete Lists all the obsolete symbols used by the sources. .TP Wanted Lists all the wanted symbols. .PD .sp .in +5 where LIB is $privlibexp. .in -5 .SH BUGS Units are sometimes included unnecessarily if one of its symbols is accidentally mentioned, e.g. in a comment. Better too many units than too few, however. .SH "SEE ALSO" pat($manext), makeSH($manext), makedist($manext), metalint($manext) !GROK!THIS! chmod 444 metaconfig.$manext dist_3.5-30.orig/mcon/man/Jmakefile0000644000175000017500000000126510473675126017377 0ustar srivastasrivasta/* * Jmakefile for metaconfig manual pages */ ;# $Id: Jmakefile 9 2006-08-25 22:31:50Z rmanfredi $ ;# ;# Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ;# ;# You may redistribute only under the terms of the Artistic Licence, ;# as specified in the README file that comes with the distribution. ;# You may reuse parts of this distribution only within the terms of ;# that same Artistic Licence; a copy of which may be found at the root ;# of the source tree for dist 4.0. ;# ;# $Log: Jmakefile,v $ ;# Revision 3.0 1993/08/18 12:10:13 ram ;# Baseline for dist 3.0 netwide release. ;# MPAGES = metaconfig.$(L) metalint.$(L) metaxref.$(L) ComplexShellManualTarget($(MPAGES)) dist_3.5-30.orig/mcon/man/mlint.SH0000755000175000017500000005114710473316164017145 0ustar srivastasrivastacase $CONFIG in '') if test -f config.sh; then TOP=.; elif test -f ../config.sh; then TOP=..; elif test -f ../../config.sh; then TOP=../..; elif test -f ../../../config.sh; then TOP=../../..; elif test -f ../../../../config.sh; then TOP=../../../..; else echo "Can't find config.sh."; exit 1 fi . $TOP/config.sh ;; esac case "$0" in */*) cd `expr X$0 : 'X\(.*\)/'` ;; esac echo "Extracting mcon/man/metalint.$manext (with variable substitutions)" $rm -f metalint.$manext $spitshell >metalint.$manext <' unless the whole string is quoted. This message is suppressed by a ?LINT: nocomment hint. .TP "missing space after ':' to make it a comment." A line starting by ':' is interpreted by the shell but will be ignored. There must be a space after the ':' though, or the shell will try to execute an unknown command... .TP "found unquoted meta-character > on comment line." A line starting by ':' is interpreted by the shell but will be ignored. This means that meaningful meta-characters such as '(' or '>' must be quoted or escaped with a leading backslash. .TP "found dangling quote on ':' comment line." An unclosed single or double quote was spotted on a ':' comment line. Since those lines are interpreted by the shell, albeit ignored, all quotes must match perfectly. .TP "not ending with a blank line." Since all units are gathered together to form one big script, it is recommended (hence enforced by \fImetalint\fR) that every unit file end with an empty line. .TP "last line not ending with a new-line character." This is merely intended to users whose editor does not always append a new-line at the end of text files. Should not happen when you use \fIvi\fR. .TP "symbol '\$xxx' was not described." The shell symbol defined by this unit was not documented. Use the \fIdescribe\fR lint hint to suppress this message. .TP "C symbol 'XXX' was not described." The C symbol defined by this unit was not documented. Use the \fIknown\fR lint hint to suppress this message. .TP "C symbol 'XXX' was not defined by any ?H: line." A C symbol was advertised by never defined, hence it cannot appear in the \fIconfig.h\fR file and is therefore useless... .TP "variable '\$xxx' should have been set." A variable listed on the make line as made by the unit was not set by the shell code body. Use the \fIset\fR lint hint to suppress this message in pathological cases. .TP "unused dependency variable '\$xxx'." Apparently no usage is made from a shell variable. Use the \fIchange\fR or \fIuse\fR lint hints (depending on the situation) to suppress this message. .TP "unused conditional variable '\$xxx'. Apparently no usage is made from this conditional dependency. The \fIchange\fR or \fIuse\fR lint hints can be used to suppress this message. .TP "unused temporary variable '\$xxx'." A variable declared as temporary in a ?T: line is not used. The \fIuse\fR lint hint will fool \fImetalint\fR into thinking it's indeed used. .TP "unknown control sequence '?XXX:'." Attempt to use an unknown control sequence. .TP "unknown LINT request '$xxx' ignored." An unknown ?LINT: tag was used. All such tags must be spelled out in lowercase. .TP "symbol '\$xxx' has no default value." A symbol used as a conditional dependency in some unit has no default value set by a ?D: line. .TP "stale ?MAKE: dependency 'xxx'." Unit lists a symbol as a dependency, but that symbol is otherwise unknown, i.e. never appears as made by any other unit. .TP "symbol '\$xxx' missing from ?MAKE." A symbol used or defined was not listed as a dependency in the ?MAKE: line. .TP "missing xxx from ?MAKE for visible '\$yyy'." A symbol defined as visible by a special unit is used, but that special unit is not part of the dependency line. .TP "stale ?M: dependency 'xxx'." Magic line lists a C symbol as a dependency but that symbol is not known by any unit. .TP "unknown symbol '\$xxx'." I have no idea about what this symbol is. If the variable is externally define, this warning can be suppresed via a proper ?LINT: extern. .TP "read-only symbol '\$xxx' is set." A symbol that should be read-only is set by the unit's shell code body. .TP "obsolete symbol 'xxx' is used." An obsolete symbol is used in the unit's shell code. .TP "undeclared symbol '\$xxx' is set." The unit tries to set a shell variable which has not been otherwise declared as made or as a temporary variable, or whatever. .TP "unclosed ?H: section." The ?H: section was not terminated by a single '?H:.' line before the body of the unit or the start of another ?C: section. .TP "C symbol 'xxx' is defined in the following units:" The C symbol is defined in more that one unit. Offending units are listed. .TP "Shell symbol 'xxx' is defined in the following units:" A shell symbol is defined in more than one unit. Offending units folllow. .TP "Shell symbol 'xxx' is altogether:" A shell symbol is defined by some units, obsoleted by others and used as a temporary. .TP "Shell symbol 'xxx' is both defined and obsoleted:" Self explainatory. .TP "Shell symbol 'xxx' is both defined and used as temporary:" Self explainatory. .TP "Shell symbol 'xxx' obsoleted also used as temporary:" Self explainatory. .TP "definition of '\$xxx' not closed by '?S:.'." Self explainatory. .TP "definition of 'XXX' not closed by '?C:.'." Self explainatory. .TP "magic definition of 'xxx' not closed by '?M:.'." Self explainatory. .TP "variable '\$xxx' is defined externally." A variable defined externally (i.e. in another unit) is used, without proper dependency information. Use the \fIextern\fR lint hint to suppress this message. .TP "file 'xxx' was not created." A file listed as a private UU file is not created by the special unit. Creation is detected by seing an explicit shell redirection to the file, not by an implicit creation (such as a C compilation would for instance). All special units should create only shell scripts explicitely anyway so this message cannot be suppressed via a lint hint. .TP "local file 'xxx' may override the one set by 'unit.U'." You are attempting to create a local file, but the special unit creates one bearing the exact same name and should it be loaded before within \fIConfigure\fR, you would override that file. Change the name of your local file. .TP "unused temporary file 'xxx'. The file was declared on the ?F: line but does not appear to be used anywhere. .TP "mis-used temporary file 'xxx'. A local temporary file has been declared on the ?F: line and is used in a way that may not be the proper one. Indeed, all such local files should be called with an explicit relative path, to avoid PATH lookups which could get you another file. .TP "you might not always get file 'xxx' from 'unit.U'." You seem to be calling the specified file, but not by using an explicit relative pathname. Relying on the PATH to find this file is not safe. To fix this problem, call your file using somthing like \fI./xxx\fR. .TP "missing Unit from ?MAKE for private file 'xxx'." You are using a private UU file without listing the special unit that produces it in your dependency line. Add the unit to your dependency list. .TP "unknown private file 'xxx'." The file does not appear on any ?F: line; however it should. .TP "File 'xxx' is defined in the following units:" The listed units cannot seem to agree on who is defining the file. .TP "empty here-document name discouraged." You should refrain from using empty names for here documents, as .I metalint will not monitor those. .TP "unclosed here-document xxx started line x." The opened here-document at line x was never closed in this unit. This generally mean that when the unit is used, the generated script will not work! .TP "spurious 'LINT xxx' directive." You have inserted a ?LINT: directive that is not used to shut-up warnings. .TP "Cycle found for:" There is a dependency cycle found for the symbols listed. Only the symbols involved in the cycle are listed. .TP "Cycle involves:" An exerpt of the dependencies where the cycle was found is listed. This may involve far more symbols than the previous message, because \fImetalint\fR actually rescans the rules to emphasize the cycle and stops whenever it has found one, i.e. it does not try to minimize it (the cycle is found using another algorithm, which unfortunately cannot spit it out but only say for sure there is one). .SH REFERENCE .I Metalint uses the following control lines, which are otherwise ignored by \fImetaconfig\fR: .TP 5 ?V:\fIread-only symbols\fR:\fIread-write symbols\fR This line should be used only in special units. It lists all the shell variable defined by the unit which should not be used directly as dependencies by other units: they must include this special unit in their dependency list if they make use of any of the symbols described here. Those can be viewed as exported symbols which you inherit from when depending from the unit. Symbols may be exported read-only or read-write. .TP ?F:\fIfiles created\fR This line serves two purposes: it is a \fImetalint\fR hint, and also a placeholder for future \fIjmake\fR use. It must list three kind of files: the temporary one which are created for a test, the private UU ones created in the UU directory for later perusal, and the public ones left in the root directory of the package. Temporary files must be listed with a preceding '!' character (meaning "no! they're not re-used later!"), private UU files should be preceded by a './' (meaning: to use them, say \fI./file\fR, not just \fIfile\fR), and public ones should be named as-is. .TP ?T:\fIshell temporaries\fR This line should list all the shell variables used as temporaries within the unit's body. This line should be kept accurate, and prevents you from writing a unit defining a symbol which would be used as a scratch variable in another unit... .TP ?LINT:\fIkeyword\fR \fIsymbol_list\fR Specifies a lint hint. The following keywords are available: .RS +10 .TP 15 .PD 0 .I change shell variable ok to be changed .TP .I create persistent file ok to be created by non-special unit .TP .I define shell variables listed are defined in this unit .TP .I describe listed shell variables are described by ?S: .TP .I extern variable known to be externally defined .TP .I empty unit file is empty and kept only as a placeholder. .TP .I known listed C variables are described .TP .I nocomment unit file is special and may miss a leading ': description' line. .TP .I nothere listed names are not here documents (e.g. "1 << foo" in a C program) .TP .I set listed variables are set .TP .I use variables listed are used by this unit .TP .I unclosed listed names of here-documents are not closed in this unit .TP .I usefile listed file is used (do not prepend name with '!' for temporary ones) .PD .RS -10 .SH AUTHORS Harlan Stenn wrote the first version, based on Larry Wall's \fImetaconfig\fR from dist 2.0. .br Raphael Manfredi rewrote it from scratch for 3.0 with a few enhancements. .SH FILES .TP 10 .PD 0 LIB/dist/mcon/U/*.U Public unit files .TP U/*.U Private unit files .PD .sp .in +5 where LIB is $privlibexp. .in -5 .SH BUGS Maybe. .SH "SEE ALSO" metaconfig($manext), metaxref($manext) !GROK!THIS! chmod 444 metalint.$manext dist_3.5-30.orig/mcon/man/mxref.SH0000755000175000017500000000716210473316164017141 0ustar srivastasrivastacase $CONFIG in '') if test -f config.sh; then TOP=.; elif test -f ../config.sh; then TOP=..; elif test -f ../../config.sh; then TOP=../..; elif test -f ../../../config.sh; then TOP=../../..; elif test -f ../../../../config.sh; then TOP=../../../..; else echo "Can't find config.sh."; exit 1 fi . $TOP/config.sh ;; esac case "$0" in */*) cd `expr X$0 : 'X\(.*\)/'` ;; esac echo "Extracting mcon/man/metaxref.$manext (with variable substitutions)" $rm -f metaxref.$manext $spitshell >metaxref.$manext < .SH FILES .TP 10 .PD 0 LIB/dist/mcon/U/*.U Public unit files. .TP U/*.U Private unit files .TP I.fui Lists information sorted by file, unit and item. .TP I.uif Lists information sorted by unit, item and file. .TP Obsolete Lists all the obsolete symbols used by the sources. .PD .sp .in +5 where LIB is $privlibexp. .in -5 .SH BUGS Metaxref will list among the wanted items all those magic symbols defined within units on the ?M: lines. Those are relevant only when metaconfig is invoked with the \fB\-M\fR option. .SH "SEE ALSO" metaconfig($manext), metalint($manext) !GROK!THIS! chmod 444 metaxref.$manext dist_3.5-30.orig/mcon/man/Makefile.SH0000755000175000017500000001130310473675243017533 0ustar srivastasrivasta: Makefile.SH generated from Jmake.tmpl and Jmakefile [jmake 3.5 PL0] : $X-Id: Jmake.tmpl 8 2006-08-25 22:27:18Z rmanfredi $ case $CONFIG in '') if test -f config.sh; then TOP=.; elif test -f ../config.sh; then TOP=..; elif test -f ../../config.sh; then TOP=../..; elif test -f ../../../config.sh; then TOP=../../..; elif test -f ../../../../config.sh; then TOP=../../../..; else echo "Can't find config.sh."; exit 1 fi . $TOP/config.sh ;; esac case "$0" in */*) cd `expr X$0 : 'X\(.*\)/'` ;; esac CURRENT=mcon/man DIR=`echo $CURRENT/ | sed -e 's/\.\///g'` echo "Extracting ${DIR}Makefile (with variable substitutions)" INSTALL=`echo $install | sed -e 's,\./i,\$(TOP)/i,'` INSTALLDIR=`echo $installdir | sed -e 's,\./i,\$(TOP)/i,'` DATE=`date` $spitshell >Makefile <>Makefile <<'!NO!SUBS!' ######################################################################## # Jmake rules for building libraries, programs, scripts, and data files # $X-Id: Jmake.rules 8 2006-08-25 22:27:18Z rmanfredi $ ######################################################################## # Start of Jmakefile # $X-Id: Jmakefile 9 2006-08-25 22:31:50Z rmanfredi $ # # Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi # # You may redistribute only under the terms of the Artistic Licence, # as specified in the README file that comes with the distribution. # You may reuse parts of this distribution only within the terms of # that same Artistic Licence; a copy of which may be found at the root # of the source tree for dist 4.0. # # $X-Log: Jmakefile,v $ # Revision 3.0 1993/08/18 12:10:13 ram # Baseline for dist 3.0 netwide release. # MPAGES = metaconfig.$(L) metalint.$(L) metaxref.$(L) all:: $(MPAGES) local_realclean:: $(RM) $(MPAGES) local_install.man:: @case '${MFLAGS}' in *[i]*) set +e;; esac; \ (set -x; test -d $(INSTALL_PREFIX)$(MANSRC) || \ $(INSTALLDIR) $(INSTALL_PREFIX)$(MANSRC)); \ for file in $(MPAGES); do \ (set -x; $(INSTALL) -c -m 444 $$file \ $(INSTALL_PREFIX)$(MANSRC)) || exit 1; \ done local_deinstall.man:: @case '${MFLAGS}' in *[i]*) set +e;; esac; \ for file in $(MPAGES); do \ (set -x; $(RM) $(INSTALL_PREFIX)$(MANSRC)/$$file); \ done ######################################################################## # Common rules for all Makefiles -- do not edit all:: clean: local_clean realclean: local_realclean clobber: local_clobber local_clean:: if test -f core; then $(RM) core; fi $(RM) *~ *.o local_realclean:: local_clean local_clobber:: local_realclean $(RM) Makefile config.sh install:: local_install install.man:: maybe_install.man deinstall:: local_deinstall deinstall.man:: maybe_deinstall.man install.man-yes: local_install.man install.man-no: deinstall.man-yes: local_deinstall.man deinstall.man-no: !NO!SUBS! case "$installmansrc" in '') man=no;; *) man=yes;; esac $spitshell >>Makefile <>Makefile <<'!NO!SUBS!' Makefile.SH: Jmakefile -@if test -f $(TOP)/.package; then \ if test -f Makefile.SH; then \ echo " $(RM) Makefile.SH~; $(MV) Makefile.SH Makefile.SH~"; \ $(RM) Makefile.SH~; $(MV) Makefile.SH Makefile.SH~; \ fi; \ echo " $(JMAKE) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT)" ; \ $(JMAKE) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT) ; \ else touch $@; fi Makefile: Makefile.SH /bin/sh Makefile.SH tags:: $(CTAGS) -w *.[ch] $(CTAGS) -xw *.[ch] > tags local_clobber:: $(RM) tags ######################################################################## # Empty rules for directories with no sub-directories -- do not edit local_install:: @echo "install in $(CURRENT) done." local_deinstall:: @echo "deinstall in $(CURRENT) done." local_install.man:: @echo "install.man in $(CURRENT) done." local_deinstall.man:: @echo "deinstall.man in $(CURRENT) done." Makefiles:: Makefiles.SH:: !NO!SUBS! chmod 644 Makefile $eunicefix Makefile dist_3.5-30.orig/mcon/Makefile.SH0000755000175000017500000002444610473675243016774 0ustar srivastasrivasta: Makefile.SH generated from Jmake.tmpl and Jmakefile [jmake 3.5 PL0] : $X-Id: Jmake.tmpl 8 2006-08-25 22:27:18Z rmanfredi $ case $CONFIG in '') if test -f config.sh; then TOP=.; elif test -f ../config.sh; then TOP=..; elif test -f ../../config.sh; then TOP=../..; elif test -f ../../../config.sh; then TOP=../../..; elif test -f ../../../../config.sh; then TOP=../../../..; else echo "Can't find config.sh."; exit 1 fi . $TOP/config.sh ;; esac case "$0" in */*) cd `expr X$0 : 'X\(.*\)/'` ;; esac CURRENT=mcon DIR=`echo $CURRENT/ | sed -e 's/\.\///g'` echo "Extracting ${DIR}Makefile (with variable substitutions)" INSTALL=`echo $install | sed -e 's,\./i,\$(TOP)/i,'` INSTALLDIR=`echo $installdir | sed -e 's,\./i,\$(TOP)/i,'` DATE=`date` $spitshell >Makefile <>Makefile <<'!NO!SUBS!' ######################################################################## # Jmake rules for building libraries, programs, scripts, and data files # $X-Id: Jmake.rules 8 2006-08-25 22:27:18Z rmanfredi $ ######################################################################## # Start of Jmakefile # $X-Id: Jmakefile 9 2006-08-25 22:31:50Z rmanfredi $ # # Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi # # You may redistribute only under the terms of the Artistic Licence, # as specified in the README file that comes with the distribution. # You may reuse parts of this distribution only within the terms of # that same Artistic Licence; a copy of which may be found at the root # of the source tree for dist 4.0. # # $X-Log: Jmakefile,v $ # Revision 3.0.1.4 1995/07/25 13:23:09 ram # patch56: installs the GNU configure-like front-end to Configure # # Revision 3.0.1.3 1994/01/24 13:42:29 ram # patch16: added dependency generation stage # # Revision 3.0.1.2 1993/11/02 10:40:01 ram # patch14: now invokes perload explicitely via perl executable # # Revision 3.0.1.1 1993/08/25 08:46:44 ram # patch6: split unit installation to avoid shell command line overflow # # Revision 3.0 1993/08/18 12:04:40 ram # Baseline for dist 3.0 netwide release. # all:: Glossary local_realclean:: $(RM) Glossary Glossary: makegloss chmod +x makegloss ./makegloss all:: makegloss local_realclean:: $(RM) makegloss makegloss: makegloss.SH /bin/sh makegloss.SH local_install:: @case '${MFLAGS}' in *[i]*) set +e;; esac; \ for dir in $(PRIVLIB) $(PRIVLIB)/U; do \ (set -x; test -d $(INSTALL_PREFIX)$$dir || \ $(INSTALLDIR) $(INSTALL_PREFIX)$$dir); \ done local_deinstall:: @case '${MFLAGS}' in *[i]*) set +e;; esac; \ for dir in $(PRIVLIB) $(PRIVLIB)/U; do \ (set -x; test -d $$dir && $(RM) -r $(INSTALL_PREFIX)$$dir); \ done local_install:: Glossary @case '${MFLAGS}' in *[i]*) set +e;; esac; \ (set -x; test -d $(INSTALL_PREFIX)$(PRIVLIB) || \ $(INSTALLDIR) $(INSTALL_PREFIX)$(PRIVLIB)); \ $(INSTALL) -c -m 444 Glossary $(INSTALL_PREFIX)$(PRIVLIB) local_deinstall:: $(RM) $(INSTALL_PREFIX)$(PRIVLIB)/Glossary local_install:: makegloss @case '${MFLAGS}' in *[i]*) set +e;; esac; \ (set -x; test -d $(INSTALL_PREFIX)$(PRIVLIB) || \ $(INSTALLDIR) $(INSTALL_PREFIX)$(PRIVLIB)); \ $(INSTALL) -c -m 555 makegloss $(INSTALL_PREFIX)$(PRIVLIB) local_deinstall:: $(RM) $(INSTALL_PREFIX)$(PRIVLIB)/makegloss local_install:: configure @case '${MFLAGS}' in *[i]*) set +e;; esac; \ (set -x; test -d $(INSTALL_PREFIX)$(PRIVLIB) || \ $(INSTALLDIR) $(INSTALL_PREFIX)$(PRIVLIB)); \ $(INSTALL) -c -m 555 configure $(INSTALL_PREFIX)$(PRIVLIB) local_deinstall:: $(RM) $(INSTALL_PREFIX)$(PRIVLIB)/configure local_install:: U/[a-d]*.U @case '${MFLAGS}' in *[i]*) set +e;; esac; \ (set -x; test -d $(INSTALL_PREFIX)$(PRIVLIB)/U || \ $(INSTALLDIR) $(INSTALL_PREFIX)$(PRIVLIB)/U); \ for i in U/[a-d]*.U; do \ (set -x; $(INSTALL) -c -m 444 \ $$i $(INSTALL_PREFIX)$(PRIVLIB)/U) || exit 1;\ done local_deinstall:: @case '${MFLAGS}' in *[i]*) set +e;; esac; \ for i in U/[a-d]*.U; do \ (set -x; $(RM) $(INSTALL_PREFIX)$(PRIVLIB)/U/$$i); \ done local_install:: U/[A-Ze-z]*.U @case '${MFLAGS}' in *[i]*) set +e;; esac; \ (set -x; test -d $(INSTALL_PREFIX)$(PRIVLIB)/U || \ $(INSTALLDIR) $(INSTALL_PREFIX)$(PRIVLIB)/U); \ for i in U/[A-Ze-z]*.U; do \ (set -x; $(INSTALL) -c -m 444 \ $$i $(INSTALL_PREFIX)$(PRIVLIB)/U) || exit 1;\ done local_deinstall:: @case '${MFLAGS}' in *[i]*) set +e;; esac; \ for i in U/[A-Ze-z]*.U; do \ (set -x; $(RM) $(INSTALL_PREFIX)$(PRIVLIB)/U/$$i); \ done all:: metaconfig mconfig local_realclean:: $(RM) metaconfig mconfig all:: mconfig local_realclean:: $(RM) mconfig mconfig: mconfig.SH /bin/sh mconfig.SH metaconfig: mconfig perl $(TOP)/bin/perload -o mconfig > $@ chmod +rx $@ local_install:: metaconfig @case '${MFLAGS}' in *[i]*) set +e;; esac; \ (set -x; test -d $(INSTALL_PREFIX)$(SCRIPTDIR) || \ $(INSTALLDIR) $(INSTALL_PREFIX)$(SCRIPTDIR)); \ $(INSTALL) -c -m 555 metaconfig $(INSTALL_PREFIX)$(SCRIPTDIR) local_deinstall:: $(RM) $(INSTALL_PREFIX)$(SCRIPTDIR)/metaconfig all:: metalint mlint local_realclean:: $(RM) metalint mlint all:: mlint local_realclean:: $(RM) mlint mlint: mlint.SH /bin/sh mlint.SH metalint: mlint perl $(TOP)/bin/perload -o mlint > $@ chmod +rx $@ local_install:: metalint @case '${MFLAGS}' in *[i]*) set +e;; esac; \ (set -x; test -d $(INSTALL_PREFIX)$(SCRIPTDIR) || \ $(INSTALLDIR) $(INSTALL_PREFIX)$(SCRIPTDIR)); \ $(INSTALL) -c -m 555 metalint $(INSTALL_PREFIX)$(SCRIPTDIR) local_deinstall:: $(RM) $(INSTALL_PREFIX)$(SCRIPTDIR)/metalint all:: metaxref mxref local_realclean:: $(RM) metaxref mxref all:: mxref local_realclean:: $(RM) mxref mxref: mxref.SH /bin/sh mxref.SH metaxref: mxref perl $(TOP)/bin/perload -o mxref > $@ chmod +rx $@ local_install:: metaxref @case '${MFLAGS}' in *[i]*) set +e;; esac; \ (set -x; test -d $(INSTALL_PREFIX)$(SCRIPTDIR) || \ $(INSTALLDIR) $(INSTALL_PREFIX)$(SCRIPTDIR)); \ $(INSTALL) -c -m 555 metaxref $(INSTALL_PREFIX)$(SCRIPTDIR) local_deinstall:: $(RM) $(INSTALL_PREFIX)$(SCRIPTDIR)/metaxref BINFILES = \ mconfig \ mlint \ mxref BINSH = \ mconfig.SH \ mlint.SH \ mxref.SH depend:: ($(SED) '/^# DO NOT DELETE/q' Makefile && \ grep '^\$$grep' $(BINSH) | \ $(SED) -e "s/^.*' \([^ ]*\) >>\([^ ]*\)/\2: \1/" \ ) > Makefile.new cp Makefile Makefile.bak cp Makefile.new Makefile $(RM) Makefile.new ######################################################################## # Common rules for all Makefiles -- do not edit all:: clean: sub_clean local_clean realclean: sub_realclean local_realclean clobber: sub_clobber local_clobber local_clean:: if test -f core; then $(RM) core; fi $(RM) *~ *.o local_realclean:: local_clean local_clobber:: local_realclean $(RM) Makefile config.sh install:: local_install sub_install install.man:: maybe_install.man sub_install.man deinstall:: sub_deinstall local_deinstall deinstall.man:: sub_deinstall.man maybe_deinstall.man install.man-no: deinstall.man-no: maybe_install.man: install.man-no maybe_deinstall.man: deinstall.man-no Makefile.SH: Jmakefile -@if test -f $(TOP)/.package; then \ if test -f Makefile.SH; then \ echo " $(RM) Makefile.SH~; $(MV) Makefile.SH Makefile.SH~"; \ $(RM) Makefile.SH~; $(MV) Makefile.SH Makefile.SH~; \ fi; \ echo " $(JMAKE) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT)" ; \ $(JMAKE) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT) ; \ else touch $@; fi Makefile: Makefile.SH /bin/sh Makefile.SH tags:: $(CTAGS) -w *.[ch] $(CTAGS) -xw *.[ch] > tags local_clobber:: $(RM) tags ######################################################################## # Rules for building in sub-directories -- do not edit subdirs: @case '${MFLAGS}' in *[ik]*) set +e;; esac; \ for i in $(SUBDIRS) ;\ do \ (cd $$i ; echo $(VERB) "in $(DIR)$$i..."; \ $(MAKE) $(MFLAGS) $(FLAGS) $(TARGET)) || exit 1; \ done sub_install:: @$(MAKE) subdirs TARGET=install VERB="Installing" FLAGS= sub_deinstall:: @$(MAKE) subdirs TARGET=deinstall VERB="Deinstalling" FLAGS= @echo "Back to $(CURRENT) for "deinstall... sub_install.man:: @$(MAKE) subdirs TARGET=install.man VERB="Installing man pages" FLAGS= sub_deinstall.man:: @$(MAKE) subdirs TARGET=deinstall.man VERB="Deinstalling man pages" FLAGS= @echo "Back to $(CURRENT) for "deinstall.man... sub_clean:: @$(MAKE) subdirs TARGET=clean VERB="Cleaning" FLAGS= @echo "Back to $(CURRENT) for "clean... sub_realclean:: @$(MAKE) subdirs TARGET=realclean VERB="Real cleaning" FLAGS= @echo "Back to $(CURRENT) for "realclean... sub_clobber:: @$(MAKE) subdirs TARGET=clobber VERB="Clobbering" FLAGS= @echo "Back to $(CURRENT) for "clobber... tag:: @case '${MFLAGS}' in *[ik]*) set +e;; esac; \ for i in $(SUBDIRS) ;\ do \ (cd $$i ; echo "Tagging" "in $(DIR)$$i..."; \ $(MAKE) $(MFLAGS) tag) || exit 1; \ done Makefiles:: @case '${MFLAGS}' in *[ik]*) set +e;; esac; \ for i in $(SUBDIRS);\ do \ echo "Making "Makefiles" in $(DIR)$$i..."; \ (cd $$i || exit 1; \ if test ! -f Makefile; then /bin/sh Makefile.SH; fi; \ $(MAKE) $(MFLAGS) Makefiles) || exit 1;\ done Makefiles.SH:: Makefile.SH @case '${MFLAGS}' in *[ik]*) set +e;; esac; \ for i in $(SUBDIRS);\ do \ case "$(DIR)$$i/" in \ */*/*/*/) newtop=../../../..;; \ */*/*/) newtop=../../..;; \ */*/) newtop=../..;; \ */) newtop=..;; \ esac; \ case "$(TOP)" in \ /*) newtop="$(TOP)" ;; \ esac; \ echo "Making Makefiles.SH in $(DIR)$$i..."; \ (cd $$i || exit 1; \ if test -f Jmakefile; then \ $(MAKE) $(MFLAGS) -f ../Makefile \ Makefile TOP=$$newtop CURRENT=$(DIR)$$i && \ $(MAKE) $(MFLAGS) Makefiles.SH; \ fi; \ ) || exit 1; \ done all:: @$(MAKE) subdirs TARGET=all VERB="Making all" FLAGS= local_install:: local_deinstall:: local_install.man:: local_deinstall.man:: !NO!SUBS! chmod 644 Makefile $eunicefix Makefile dist_3.5-30.orig/mcon/U/0002755000175000017500000000000011272612640015202 5ustar srivastasrivastadist_3.5-30.orig/mcon/U/i_sysselct.U0000644000175000017500000000246010473316164017515 0ustar srivastasrivasta?RCS: $Id: i_sysselct.U 1 2006-08-24 12:32:52Z rmanfredi $ ?RCS: ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ?RCS: ?RCS: You may redistribute only under the terms of the Artistic Licence, ?RCS: as specified in the README file that comes with the distribution. ?RCS: You may reuse parts of this distribution only within the terms of ?RCS: that same Artistic Licence; a copy of which may be found at the root ?RCS: of the source tree for dist 4.0. ?RCS: ?RCS: $Log: i_sysselct.U,v $ ?RCS: Revision 3.0.1.1 1993/08/25 14:01:33 ram ?RCS: patch6: added default for i_sysselct ?RCS: ?RCS: Revision 3.0 1993/08/18 12:08:35 ram ?RCS: Baseline for dist 3.0 netwide release. ?RCS: ?X: ?X: Look wether exists ?X: ?MAKE:i_sysselct: Inhdr ?MAKE: -pick add $@ %< ?S:i_sysselct: ?S: This variable conditionally defines I_SYS_SELECT, which indicates ?S: to the C program that it should include in order to ?S: get the definition of struct timeval. ?S:. ?C:I_SYS_SELECT (I_SYSSELECT): ?C: This symbol, if defined, indicates to the C program that it should ?C: include in order to get definition of struct timeval. ?C:. ?H:#$i_sysselct I_SYS_SELECT /**/ ?H:. ?D:i_sysselct='' ?LINT:set i_sysselct : see if sys/select.h has to be included set sys/select.h i_sysselct eval $inhdr dist_3.5-30.orig/mcon/U/spitshell.U0000644000175000017500000000623610473316164017350 0ustar srivastasrivasta?RCS: $Id: spitshell.U 1 2006-08-24 12:32:52Z rmanfredi $ ?RCS: ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ?RCS: ?RCS: You may redistribute only under the terms of the Artistic Licence, ?RCS: as specified in the README file that comes with the distribution. ?RCS: You may reuse parts of this distribution only within the terms of ?RCS: that same Artistic Licence; a copy of which may be found at the root ?RCS: of the source tree for dist 4.0. ?RCS: ?RCS: $Log: spitshell.U,v $ ?RCS: Revision 3.0.1.4 1997/02/28 16:22:12 ram ?RCS: patch61: removed useless chatter as this is now done very early ?RCS: ?RCS: Revision 3.0.1.3 1995/01/11 15:37:01 ram ?RCS: patch45: use 'test -f' instead of 'test -r' for exec-only cat progs (WED) ?RCS: patch45: protected "sh -c" within backquotes for Linux and SGI ?RCS: ?RCS: Revision 3.0.1.2 1994/08/29 16:33:00 ram ?RCS: patch32: don't create spitshell under the UU directory ?RCS: patch32: allow for cat in /bin or /usr/bin ?RCS: ?RCS: Revision 3.0.1.1 1993/09/13 16:12:58 ram ?RCS: patch10: made #!-failure message more friendly (WAD) ?RCS: ?RCS: Revision 3.0 1993/08/18 12:09:49 ram ?RCS: Baseline for dist 3.0 netwide release. ?RCS: ?MAKE:spitshell shsharp sharpbang: eunicefix sh Head ?MAKE: -pick add $@ %< ?S:spitshell: ?S: This variable contains the command necessary to spit out a runnable ?S: shell on this system. It is either cat or a grep -v for # comments. ?S:. ?S:shsharp: ?S: This variable tells further Configure units whether your sh can ?S: handle # comments. ?S:. ?S:sharpbang: ?S: This variable contains the string #! if this system supports that ?S: construct. ?S:. ?F:!sharp ?T:xcat p ?X: "paths" comes from Head ?LINT:extern paths _exe : see if sh knows # comments ?X: This is loaded up early, so avoid being chatty. ?X: echo " " ?X: echo "Checking your $sh to see if it knows about # comments..." >&2 if `$sh -c '#' >/dev/null 2>&1`; then ?X: echo "Your $sh handles # comments correctly." shsharp=true spitshell=cat ?X: echo " " ?X: echo "Okay, let's see if #! works on this system..." xcat=/bin/cat test -f $xcat$_exe || xcat=/usr/bin/cat if test ! -f $xcat$_exe; then for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do if test -f $p/cat$_exe; then xcat=$p/cat break fi done if test ! -f $xcat$_exe; then echo "Can't find cat anywhere!" exit 1 fi fi echo "#!$xcat" >sharp $eunicefix sharp chmod +x sharp ./sharp > today 2>/dev/null if test -s today; then ?X: echo "It does." sharpbang='#!' else echo "#! $xcat" > sharp $eunicefix sharp chmod +x sharp ./sharp > today 2>/dev/null if test -s today; then ?X: echo "It does." sharpbang='#! ' else ?X: echo "Okay, let's see if #! works on this system..." ?X: echo "It's just a comment." sharpbang=': use ' fi fi else echo " " echo "Your $sh doesn't grok # comments--I will strip them later on." shsharp=false ?X: The spitshell script will be perused, so leave it out the UU directory cd .. echo "exec grep -v '^[ ]*#'" >spitshell chmod +x spitshell $eunicefix spitshell spitshell=`pwd`/spitshell cd UU echo "I presume that if # doesn't work, #! won't work either!" sharpbang=': use ' fi rm -f sharp today dist_3.5-30.orig/mcon/U/d_sysconf.U0000644000175000017500000000222510473316164017322 0ustar srivastasrivasta?RCS: $Id: d_sysconf.U 1 2006-08-24 12:32:52Z rmanfredi $ ?RCS: ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ?RCS: ?RCS: You may redistribute only under the terms of the Artistic Licence, ?RCS: as specified in the README file that comes with the distribution. ?RCS: You may reuse parts of this distribution only within the terms of ?RCS: that same Artistic Licence; a copy of which may be found at the root ?RCS: of the source tree for dist 4.0. ?RCS: ?RCS: Original Author: Andy Dougherty ?RCS: ?RCS: $Log: d_sysconf.U,v $ ?RCS: Revision 3.0.1.1 1994/10/29 16:15:57 ram ?RCS: patch36: created by ADO ?RCS: ?MAKE:d_sysconf: Inlibc ?MAKE: -pick add $@ %< ?S:d_sysconf: ?S: This variable conditionally defines the HAS_SYSCONF symbol, which ?S: indicates to the C program that the sysconf() routine is available ?S: to determine system related limits and options. ?S:. ?C:HAS_SYSCONF: ?C: This symbol, if defined, indicates that sysconf() is available ?C: to determine system related limits and options. ?C:. ?H:#$d_sysconf HAS_SYSCONF /**/ ?H:. ?LINT:set d_sysconf : see if sysconf exists set sysconf d_sysconf eval $inlibc dist_3.5-30.orig/mcon/U/d_attribut.U0000644000175000017500000000422210473316164017473 0ustar srivastasrivasta?RCS: $Id: d_attribut.U 1 2006-08-24 12:32:52Z rmanfredi $ ?RCS: ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ?RCS: ?RCS: You may redistribute only under the terms of the Artistic Licence, ?RCS: as specified in the README file that comes with the distribution. ?RCS: You may reuse parts of this distribution only within the terms of ?RCS: that same Artistic Licence; a copy of which may be found at the root ?RCS: of the source tree for dist 4.0. ?RCS: ?RCS: Original Author: Andy Dougherty ?RCS: ?RCS: $Log: d_attribut.U,v $ ?RCS: Revision 3.0.1.3 1995/01/30 14:33:45 ram ?RCS: patch49: test C program now includes (WED) ?RCS: ?RCS: Revision 3.0.1.2 1995/01/11 15:25:47 ram ?RCS: patch45: fixed typo in the d_attribut variable (ADO) ?RCS: ?RCS: Revision 3.0.1.1 1994/10/29 16:08:55 ram ?RCS: patch36: created by ADO ?RCS: ?MAKE:d_attribut: Myread Oldconfig cat cc ccflags rm Setvar contains ?MAKE: -pick add $@ %< ?S:d_attribut (d_attrib): ?S: This variable conditionally defines HASATTRIBUTE, which ?S: indicates the C compiler can check for function attributes, ?S: such as printf formats. ?S:. ?C:HASATTRIBUTE ~ %< (GNUC_ATTRIBUTE_CHECK): ?C: This symbol indicates the C compiler can check for function attributes, ?C: such as printf formats. This is normally only supported by GNU cc. ?C:. ?H:?%<:#$d_attribut HASATTRIBUTE /**/ ?H:?%<:#ifndef HASATTRIBUTE ?H:?%<:#define __attribute__(_arg_) ?H:?%<:#endif ?H:. ?W:%<:__attribute__ ?LINT:set d_attribut ?LINT:known __attribute__ : Look for GNU-cc style attribute checking echo " " echo "Checking whether your compiler can handle __attribute__ ..." >&4 $cat >attrib.c <<'EOCP' #include void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn)); EOCP if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then if $contains 'warning' attrib.out >/dev/null 2>&1; then echo "Your C compiler doesn't fully support __attribute__." val="$undef" else echo "Your C compiler supports __attribute__." val="$define" fi else echo "Your C compiler doesn't seem to understand __attribute__ at all." val="$undef" fi set d_attribut eval $setvar $rm -f attrib* dist_3.5-30.orig/mcon/U/man1dir.U0000644000175000017500000001016410473316164016667 0ustar srivastasrivasta?RCS: $Id: man1dir.U 1 2006-08-24 12:32:52Z rmanfredi $ ?RCS: ?RCS: Copyright (c) 1996, Andy Dougherty ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ?RCS: ?RCS: You may redistribute only under the terms of the Artistic Licence, ?RCS: as specified in the README file that comes with the distribution. ?RCS: You may reuse parts of this distribution only within the terms of ?RCS: that same Artistic Licence; a copy of which may be found at the root ?RCS: of the source tree for dist 4.0. ?RCS: ?RCS: $Log: man1dir.U,v $ ?RCS: Revision 3.0.1.1 1997/02/28 16:10:29 ram ?RCS: patch61: created ?RCS: ?X: ?X: This was originally specific to perl5. Since perl5 has man pages that ?X: go in both man1/ and man3/ directories, we need both man1dir ?X: and man3dir. This unit is basically dist's mansrc.U with ?X: man1 used instead of man everywhere. ?X: ?MAKE:man1dir man1direxp man1ext installman1dir: afs cat nroff Loc Oldconfig \ spackage test Getfile Prefixit prefixexp Prefixup sysman Myread ?MAKE: -pick add $@ %< ?Y:TOP ?S:man1dir: ?S: This variable contains the name of the directory in which manual ?S: source pages are to be put. It is the responsibility of the ?S: Makefile.SH to get the value of this into the proper command. ?S: You must be prepared to do the ~name expansion yourself. ?S:. ?S:man1direxp: ?S: This variable is the same as the man1dir variable, but is filename ?S: expanded at configuration time, for convenient use in makefiles. ?S:. ?S:installman1dir: ?S: This variable is really the same as man1direxp, unless you are using ?S: AFS in which case it points to the read/write location whereas ?S: man1direxp only points to the read-only access location. For extra ?S: portability, you should only use this variable within your makefiles. ?S:. ?S:man1ext: ?S: This variable contains the extension that the manual page should ?S: have: one of 'n', 'l', or '1'. The Makefile must supply the '.'. ?S: See man1dir. ?S:. ?T:lookpath : determine where manual pages go set man1dir man1dir none eval $prefixit $cat < ?RCS: ?RCS: $Log: d_nice.U,v $ ?RCS: Revision 3.0.1.1 1994/08/29 16:09:48 ram ?RCS: patch32: created by ADO ?RCS: ?MAKE:d_nice: Inlibc ?MAKE: -pick add $@ %< ?S:d_nice: ?S: This variable conditionally defines the HAS_NICE symbol, which ?S: indicates to the C program that the nice() routine is available. ?S:. ?C:HAS_NICE : ?C: This symbol, if defined, indicates that the nice routine is ?C: available. ?C:. ?H:#$d_nice HAS_NICE /**/ ?H:. ?LINT:set d_nice : see if nice exists set nice d_nice eval $inlibc dist_3.5-30.orig/mcon/U/d_fork.U0000644000175000017500000000202510473316164016575 0ustar srivastasrivasta?RCS: $Id: d_fork.U 1 2006-08-24 12:32:52Z rmanfredi $ ?RCS: ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ?RCS: ?RCS: You may redistribute only under the terms of the Artistic Licence, ?RCS: as specified in the README file that comes with the distribution. ?RCS: You may reuse parts of this distribution only within the terms of ?RCS: that same Artistic Licence; a copy of which may be found at the root ?RCS: of the source tree for dist 4.0. ?RCS: ?RCS: Original Author: Andy Dougherty ?RCS: ?RCS: $Log: d_fork.U,v $ ?RCS: Revision 3.0.1.1 1994/08/29 16:07:38 ram ?RCS: patch32: created by ADO ?RCS: ?MAKE:d_fork: Inlibc ?MAKE: -pick add $@ %< ?S:d_fork: ?S: This variable conditionally defines the HAS_FORK symbol, which ?S: indicates to the C program that the fork() routine is available. ?S:. ?C:HAS_FORK : ?C: This symbol, if defined, indicates that the fork routine is ?C: available. ?C:. ?H:#$d_fork HAS_FORK /**/ ?H:. ?LINT:set d_fork : see if fork exists set fork d_fork eval $inlibc dist_3.5-30.orig/mcon/U/d_tzname.U0000644000175000017500000000235210473316164017135 0ustar srivastasrivasta?RCS: $Id: d_tzname.U 1 2006-08-24 12:32:52Z rmanfredi $ ?RCS: ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ?RCS: ?RCS: You may redistribute only under the terms of the Artistic Licence, ?RCS: as specified in the README file that comes with the distribution. ?RCS: You may reuse parts of this distribution only within the terms of ?RCS: that same Artistic Licence; a copy of which may be found at the root ?RCS: of the source tree for dist 4.0. ?RCS: ?RCS: $Log: d_tzname.U,v $ ?RCS: Revision 3.0.1.2 1994/08/29 16:14:43 ram ?RCS: patch32: forgot to set proper value in the val variable ?RCS: ?RCS: Revision 3.0.1.1 1994/06/20 06:57:55 ram ?RCS: patch30: created ?RCS: ?MAKE:d_tzname: Csym Setvar ?MAKE: -pick add $@ %< ?S:d_tzname: ?S: This variable conditionally defines HAS_TZNAME if tzname[] is ?S: available to access timezone names. ?S:. ?C:HAS_TZNAME: ?C: This symbol, if defined, indicates that the tzname[] array is ?C: available to access timezone names. ?C:. ?H:#$d_tzname HAS_TZNAME /**/ ?H:. ?LINT:set d_tzname : see if tzname[] exists echo " " if set tzname val -a d_tzname; eval $csym; $val; then val="$define" echo 'tzname[] found.' >&4 else val="$undef" echo 'tzname[] NOT found.' >&4 fi set d_tzname eval $setvar dist_3.5-30.orig/mcon/U/d_strtod.U0000644000175000017500000000221010473316164017147 0ustar srivastasrivasta?RCS: $Id: d_strtod.U 1 2006-08-24 12:32:52Z rmanfredi $ ?RCS: ?RCS: Copyright (c) 1996, Andy Dougherty ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ?RCS: ?RCS: You may redistribute only under the terms of the Artistic Licence, ?RCS: as specified in the README file that comes with the distribution. ?RCS: You may reuse parts of this distribution only within the terms of ?RCS: that same Artistic Licence; a copy of which may be found at the root ?RCS: of the source tree for dist 4.0. ?RCS: ?RCS: $Log: d_strtod.U,v $ ?RCS: Revision 3.0.1.1 1997/02/28 15:46:36 ram ?RCS: patch61: created ?RCS: ?RCS: ?MAKE:d_strtod: Inlibc ?MAKE: -pick add $@ %< ?S:d_strtod: ?S: This variable conditionally defines the HAS_STRTOD symbol, which ?S: indicates to the C program that the strtod() routine is available ?S: to provide better numeric string conversion than atof(). ?S:. ?C:HAS_STRTOD (STRTOD): ?C: This symbol, if defined, indicates that the strtod routine is ?C: available to provide better numeric string conversion than atof(). ?C:. ?H:#$d_strtod HAS_STRTOD /**/ ?H:. ?LINT:set d_strtod : see if strtod exists set strtod d_strtod eval $inlibc dist_3.5-30.orig/mcon/U/d_perror.U0000644000175000017500000000301610473316164017146 0ustar srivastasrivasta?RCS: $Id: d_perror.U 1 2006-08-24 12:32:52Z rmanfredi $ ?RCS: ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ?RCS: ?RCS: You may redistribute only under the terms of the Artistic Licence, ?RCS: as specified in the README file that comes with the distribution. ?RCS: You may reuse parts of this distribution only within the terms of ?RCS: that same Artistic Licence; a copy of which may be found at the root ?RCS: of the source tree for dist 4.0. ?RCS: ?RCS: $Log: d_perror.U,v $ ?RCS: Revision 3.0.1.1 1994/08/29 16:11:38 ram ?RCS: patch32: always define HAS_PERROR even when not used in C code ?RCS: ?RCS: Revision 3.0 1993/08/18 12:06:45 ram ?RCS: Baseline for dist 3.0 netwide release. ?RCS: ?MAKE:d_perror: Inlibc ?MAKE: -pick add $@ %< ?S:d_perror: ?S: This variable conditionally remaps perror to a null action and ?S: defines the symbol HAS_PERROR, which indicates to the C program ?S: that the perror() routine is not available to print system ?S: error messages. ?S:. ?C:HAS_PERROR ~ %<: ?C: This symbol, if defined, indicates that the perror() routine is ?C: available to print system error messages. If not defined, you should ?C: use your own diagnostic routine... ?C:. ?C:perror ~ %<: ?C: This symbol is maped to null if the perror() routine is not ?C: available to print system error messages. ?C:. ?H:?%<:#$d_perror HAS_PERROR /**/ ?H:?%<:#ifndef HAS_PERROR ?H:?%<:#define perror(s) ; /* mapped to a null statement */ ?H:?%<:#endif ?H:. ?LINT:set d_perror : see if perror exists set perror d_perror eval $inlibc dist_3.5-30.orig/mcon/U/d_tcgtpgrp.U0000644000175000017500000000224410473316164017471 0ustar srivastasrivasta?RCS: $Id: d_tcgtpgrp.U 1 2006-08-24 12:32:52Z rmanfredi $ ?RCS: ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ?RCS: ?RCS: You may redistribute only under the terms of the Artistic Licence, ?RCS: as specified in the README file that comes with the distribution. ?RCS: You may reuse parts of this distribution only within the terms of ?RCS: that same Artistic Licence; a copy of which may be found at the root ?RCS: of the source tree for dist 4.0. ?RCS: ?RCS: Original Author: Andy Dougherty ?RCS: ?RCS: $Log: d_tcgtpgrp.U,v $ ?RCS: Revision 3.0.1.1 1994/08/29 16:12:08 ram ?RCS: patch32: created by ADO ?RCS: ?MAKE:d_tcgetpgrp: Inlibc ?MAKE: -pick add $@ %< ?S:d_tcgetpgrp: ?S: This variable conditionally defines the HAS_TCGETPGRP symbol, which ?S: indicates to the C program that the tcgetpgrp() routine is available. ?S: to get foreground process group ID. ?S:. ?C:HAS_TCGETPGRP : ?C: This symbol, if defined, indicates that the tcgetpgrp routine is ?C: available to get foreground process group ID. ?C:. ?H:#$d_tcgetpgrp HAS_TCGETPGRP /**/ ?H:. ?LINT:set d_tcgetpgrp : see if tcgetpgrp exists set tcgetpgrp d_tcgetpgrp eval $inlibc dist_3.5-30.orig/mcon/U/d_fsetpos.U0000644000175000017500000000201110473316164017312 0ustar srivastasrivasta?RCS: $Id: d_fsetpos.U 1 2006-08-24 12:32:52Z rmanfredi $ ?RCS: ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ?RCS: ?RCS: You may redistribute only under the terms of the Artistic Licence, ?RCS: as specified in the README file that comes with the distribution. ?RCS: You may reuse parts of this distribution only within the terms of ?RCS: that same Artistic Licence; a copy of which may be found at the root ?RCS: of the source tree for dist 4.0. ?RCS: ?RCS: $Log: d_fsetpos.U,v $ ?RCS: Revision 3.0.1.1 1994/06/20 06:57:38 ram ?RCS: patch30: created ?RCS: ?MAKE:d_fsetpos: Inlibc ?MAKE: -pick add $@ %< ?S:d_fsetpos: ?S: This variable conditionally defines HAS_FSETPOS if fsetpos() is ?S: available to set the file position indicator. ?S:. ?C:HAS_FSETPOS: ?C: This symbol, if defined, indicates that the fsetpos routine is ?C: available to set the file position indicator, similar to fseek(). ?C:. ?H:#$d_fsetpos HAS_FSETPOS /**/ ?H:. ?LINT:set d_fsetpos : see if fsetpos exists set fsetpos d_fsetpos eval $inlibc dist_3.5-30.orig/mcon/U/d_open3.U0000644000175000017500000000513210473316164016662 0ustar srivastasrivasta?RCS: $Id: d_open3.U 1 2006-08-24 12:32:52Z rmanfredi $ ?RCS: ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ?RCS: ?RCS: You may redistribute only under the terms of the Artistic Licence, ?RCS: as specified in the README file that comes with the distribution. ?RCS: You may reuse parts of this distribution only within the terms of ?RCS: that same Artistic Licence; a copy of which may be found at the root ?RCS: of the source tree for dist 4.0. ?RCS: ?RCS: $Log: d_open3.U,v $ ?RCS: Revision 3.0.1.2 1997/02/28 15:37:12 ram ?RCS: patch61: added ?F: metalint hint ?RCS: ?RCS: Revision 3.0.1.1 1995/07/25 13:58:26 ram ?RCS: patch56: added knowledge of the O_NONBLOCK symbol ?RCS: ?RCS: Revision 3.0 1993/08/18 12:06:44 ram ?RCS: Baseline for dist 3.0 netwide release. ?RCS: ?MAKE:d_open3: test +cc cat +cppflags h_fcntl h_sysfile rm Setvar Findhdr Warn ?MAKE: -pick add $@ %< ?X: It would be easy to separate the h_O_stuff from this. ?X: Is there a reason to do so? -- HMS ?S:d_open3: ?S: This variable conditionally defines the HAS_OPEN3 manifest constant, ?S: which indicates to the C program that the 3 argument version of ?S: the open(2) function is available. ?S:. ?C:HAS_OPEN3 (OPEN3): ?C: This manifest constant lets the C program know that the three ?C: argument form of open(2) is available. ?C:. ?H:#$d_open3 HAS_OPEN3 /**/ ?H:. ?W:%<:O_RDONLY O_WRONLY O_RDWR O_NDELAY O_APPEND O_SYNC O_CREAT O_TRUNC ?W:%<:O_EXCL O_NONBLOCK ?F:!open3 ?LINT:set d_open3 ?LINT:change h_fcntl h_sysfile : Locate the flags for 'open()' echo " " $cat >open3.c <<'EOCP' #include #ifdef I_FCNTL #include #endif #ifdef I_SYS_FILE #include #endif int main() { if(O_RDONLY); #ifdef O_TRUNC exit(0); #else exit(1); #endif } EOCP : check sys/file.h first to get FREAD on Sun if $test `./findhdr sys/file.h` && \ $cc $cppflags "-DI_SYS_FILE" -o open3 open3.c >/dev/null 2>&1 ; then h_sysfile=true; echo " defines the O_* constants..." >&4 if ./open3; then echo "and you have the 3 argument form of open()." >&4 val="$define" else echo "but not the 3 argument form of open(). Oh, well." >&4 val="$undef" fi elif $test `./findhdr fcntl.h` && \ $cc "-DI_FCNTL" -o open3 open3.c >/dev/null 2>&1 ; then h_fcntl=true; echo " defines the O_* constants..." >&4 if ./open3; then echo "and you have the 3 argument form of open()." >&4 val="$define" else echo "but not the 3 argument form of open(). Oh, well." >&4 val="$undef" fi else val="$undef" ./warn "I can't find the O_* constant definitions! You got problems." fi set d_open3 eval $setvar $rm -f open3* dist_3.5-30.orig/mcon/U/d_volatile.U0000644000175000017500000000410510473316164017454 0ustar srivastasrivasta?RCS: $Id: d_volatile.U 1 2006-08-24 12:32:52Z rmanfredi $ ?RCS: ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ?RCS: ?RCS: You may redistribute only under the terms of the Artistic Licence, ?RCS: as specified in the README file that comes with the distribution. ?RCS: You may reuse parts of this distribution only within the terms of ?RCS: that same Artistic Licence; a copy of which may be found at the root ?RCS: of the source tree for dist 4.0. ?RCS: ?RCS: $Log: d_volatile.U,v $ ?RCS: Revision 3.0.1.2 1995/07/25 14:08:49 ram ?RCS: patch56: made cc and ccflags optional dependencies ?RCS: ?RCS: Revision 3.0.1.1 1993/09/09 11:49:51 ram ?RCS: patch9: volatile definition was swapped over with undef ?RCS: ?RCS: Revision 3.0 1993/08/18 12:07:57 ram ?RCS: Baseline for dist 3.0 netwide release. ?RCS: ?MAKE:d_volatile: cat +cc +ccflags rm Setvar ?MAKE: -pick add $@ %< ?S:d_volatile: ?S: This variable conditionally defines the HASVOLATILE symbol, which ?S: indicates to the C program that this C compiler knows about the ?S: volatile declaration. ?S:. ?C:HASVOLATILE ~ %<: ?C: This symbol, if defined, indicates that this C compiler knows about ?C: the volatile declaration. ?C:. ?H:?%<:#$d_volatile HASVOLATILE /**/ ?H:?%<:#ifndef HASVOLATILE ?H:?%<:#define volatile ?H:?%<:#endif ?H:. ?W:%<:volatile ?LINT:set d_volatile ?LINT:known volatile : check for volatile keyword echo " " echo 'Checking to see if your C compiler knows about "volatile"...' >&4 $cat >try.c <<'EOCP' int main() { ?X: ?X: The following seven lines added by Bill Campbell ?X: detect that MIPS compilers do not handle volatile in all situations. ?X: typedef struct _goo_struct goo_struct; goo_struct * volatile goo = ((goo_struct *)0); struct _goo_struct { long long_int; int reg_int; char char_var; }; typedef unsigned short foo_t; char *volatile foo; volatile int bar; volatile foo_t blech; foo = foo; } EOCP if $cc -c $ccflags try.c >/dev/null 2>&1 ; then val="$define" echo "Yup, it does." else val="$undef" echo "Nope, it doesn't." fi set d_volatile eval $setvar $rm -f try.* dist_3.5-30.orig/mcon/U/d_dosuid.U0000644000175000017500000001233510473316164017130 0ustar srivastasrivasta?RCS: $Id: d_dosuid.U 1 2006-08-24 12:32:52Z rmanfredi $ ?RCS: ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ?RCS: ?RCS: You may redistribute only under the terms of the Artistic Licence, ?RCS: as specified in the README file that comes with the distribution. ?RCS: You may reuse parts of this distribution only within the terms of ?RCS: that same Artistic Licence; a copy of which may be found at the root ?RCS: of the source tree for dist 4.0. ?RCS: ?RCS: Tye McQueen added safe setuid script checks. ?RCS: ?RCS: $Log: d_dosuid.U,v $ ?RCS: Revision 3.0.1.2 1997/02/28 15:33:03 ram ?RCS: patch61: moved unit to TOP via a ?Y: layout directive ?RCS: patch61: tell them /dev/fd is not about floppy disks ?RCS: ?RCS: Revision 3.0.1.1 1994/10/29 16:12:08 ram ?RCS: patch36: added checks for secure setuid scripts (Tye McQueen) ?RCS: ?RCS: Revision 3.0 1993/08/18 12:05:55 ram ?RCS: Baseline for dist 3.0 netwide release. ?RCS: ?MAKE:d_dosuid d_suidsafe: cat contains ls rm test Myread Setvar \ Oldconfig Guess package hint ?MAKE: -pick add $@ %< ?S:d_suidsafe: ?S: This variable conditionally defines SETUID_SCRIPTS_ARE_SECURE_NOW ?S: if setuid scripts can be secure. This test looks in /dev/fd/. ?S:. ?S:d_dosuid: ?S: This variable conditionally defines the symbol DOSUID, which ?S: tells the C program that it should insert setuid emulation code ?S: on hosts which have setuid #! scripts disabled. ?S:. ?C:SETUID_SCRIPTS_ARE_SECURE_NOW: ?C: This symbol, if defined, indicates that the bug that prevents ?C: setuid scripts from being secure is not present in this kernel. ?C:. ?C:DOSUID: ?C: This symbol, if defined, indicates that the C program should ?C: check the script that it is executing for setuid/setgid bits, and ?C: attempt to emulate setuid/setgid on systems that have disabled ?C: setuid #! scripts because the kernel can't do it securely. ?C: It is up to the package designer to make sure that this emulation ?C: is done securely. Among other things, it should do an fstat on ?C: the script it just opened to make sure it really is a setuid/setgid ?C: script, it should make sure the arguments passed correspond exactly ?C: to the argument on the #! line, and it should not trust any ?C: subprocesses to which it must pass the filename rather than the ?C: file descriptor of the script to be executed. ?C:. ?H:#$d_suidsafe SETUID_SCRIPTS_ARE_SECURE_NOW /**/ ?H:#$d_dosuid DOSUID /**/ ?H:. ?Y:TOP ?F:!reflect ?LINT: set d_suidsafe ?LINT: set d_dosuid : see if setuid scripts can be secure $cat <reflect chmod +x,u+s reflect ./reflect >flect 2>&1 if $contains "/dev/fd" flect >/dev/null; then echo "Congratulations, your kernel has secure setuid scripts!" >&4 val="$define" else $cat <&4 dflt=n;; "$undef") echo "Well, the $hint value is *not* secure." >&4 dflt=n;; *) echo "Well, the $hint value *is* secure." >&4 dflt=y;; esac ;; *) $rm -f reflect flect echo "#!$ls" >reflect chmod +x,u+s reflect echo >flect chmod a+w flect echo '"su" will (probably) prompt you for '"$ans's password." su $ans -c './reflect >flect' if $contains "/dev/fd" flect >/dev/null; then echo "Okay, it looks like setuid scripts are secure." >&4 dflt=y else echo "I don't think setuid scripts are secure." >&4 dflt=n fi ;; esac rp='Does your kernel have *secure* setuid scripts?' . ./myread case "$ans" in [yY]*) val="$define";; *) val="$undef";; esac fi else echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4 echo "(That's for file descriptors, not floppy disks.)" val="$undef" fi set d_suidsafe eval $setvar $rm -f reflect flect : now see if they want to do setuid emulation echo " " val="$undef" case "$d_suidsafe" in "$define") val="$undef" echo "No need to emulate SUID scripts since they are secure here." >& 4 ;; *) $cat </dev/null` case "$user" in '') user=`whoami 2>&1`;; esac if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then firsttime=false echo " " rp='Would you like to see the instructions?' dflt=n . ./myread case "$ans" in [yY]*) ;; *) needman=false;; esac fi if $needman; then cat < package should be installed. If you get stuck on a question, you may use a ! shell escape to start a subshell or execute a command. Many of the questions will have default answers in square brackets; typing carriage return will give you the default. On some of the questions which ask for file or directory names you are allowed to use the ~name construct to specify the login directory belonging to "name", even if you don't have a shell which knows about that. Questions where this is allowed will be marked "(~name ok)". EOH rp='' dflt='Type carriage return to continue' . ./myread cat <<'EOH' The prompter used in this script allows you to use shell variables and backticks in your answers. You may use $1, $2, etc... to refer to the words in the default answer, as if the default line was a set of arguments given to a script shell. This means you may also use $* to repeat the whole default line, so you do not have to re-type everything to add something to the default. Everytime there is a substitution, you will have to confirm. If there is an error (e.g. an unmatched backtick), the default answer will remain unchanged and you will be prompted again. If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all the questions and use the computed defaults (or the previous answers if there was already a config.sh file). Type 'Configure -h' for a list of options. You may also start interactively and then answer '& -d' at any prompt to turn on the non-interactive behaviour for the remainder of the execution. EOH . ./myread cat <) know how I blew it. This installation script affects things in two ways: 1) it may do direct variable substitutions on some of the files included in this kit. 2) it builds a config.h file for inclusion in C programs. You may edit any of these files as the need arises after running this script. If you make a mistake on a question, there is no easy way to back up to it currently. The easiest thing to do is to edit config.sh and rerun all the SH files. Configure will offer to let you do this before it runs the SH files. EOH ?X: In case they played with the prompter... dflt='Type carriage return to continue' . ./myread case "$firsttime" in true) echo $user >>../.config/instruct;; esac fi dist_3.5-30.orig/mcon/U/d_mbstowcs.U0000644000175000017500000000221710473316164017500 0ustar srivastasrivasta?RCS: $Id: d_mbstowcs.U 1 2006-08-24 12:32:52Z rmanfredi $ ?RCS: ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ?RCS: ?RCS: You may redistribute only under the terms of the Artistic Licence, ?RCS: as specified in the README file that comes with the distribution. ?RCS: You may reuse parts of this distribution only within the terms of ?RCS: that same Artistic Licence; a copy of which may be found at the root ?RCS: of the source tree for dist 4.0. ?RCS: ?RCS: $Log: d_mbstowcs.U,v $ ?RCS: Revision 3.0 1993/08/18 12:06:29 ram ?RCS: Baseline for dist 3.0 netwide release. ?RCS: ?MAKE:d_mbstowcs: Inlibc ?MAKE: -pick add $@ %< ?S:d_mbstowcs: ?S: This variable conditionally defines the HAS_MBSTOWCS symbol, which ?S: indicates to the C program that the mbstowcs() routine is available ?S: to convert a multibyte string into a wide character string. ?S:. ?C:HAS_MBSTOWCS (MBSTOWCS): ?C: This symbol, if defined, indicates that the mbstowcs routine is ?C: available to covert a multibyte string into a wide character string. ?C:. ?H:#$d_mbstowcs HAS_MBSTOWCS /**/ ?H:. ?LINT:set d_mbstowcs : see if mbstowcs exists set mbstowcs d_mbstowcs eval $inlibc dist_3.5-30.orig/mcon/U/End.U0000644000175000017500000000201410473316164016035 0ustar srivastasrivasta?RCS: $Id: End.U 1 2006-08-24 12:32:52Z rmanfredi $ ?RCS: ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ?RCS: ?RCS: You may redistribute only under the terms of the Artistic Licence, ?RCS: as specified in the README file that comes with the distribution. ?RCS: You may reuse parts of this distribution only within the terms of ?RCS: that same Artistic Licence; a copy of which may be found at the root ?RCS: of the source tree for dist 4.0. ?RCS: ?RCS: $Log: End.U,v $ ?RCS: Revision 3.0 1993/08/18 12:04:51 ram ?RCS: Baseline for dist 3.0 netwide release. ?RCS: ?X: ?X: This unit serves as the goal which forces make to choose all the units that ?X: ask questions. The $W on the ?MAKE: line is the list of all symbols wanted. ?X: To force any unit to be included, copy this unit to your private U directory ?X: and add the name of the unit desired to the ?MAKE: dependency line. ?X: ?MAKE:End: $W ?MAKE: -pick add $@ %< ?LINT:use $W : end of configuration questions echo " " echo "End of configuration questions." dist_3.5-30.orig/mcon/U/d_strcspn.U0000644000175000017500000000205310473316164017331 0ustar srivastasrivasta?RCS: $Id: d_strcspn.U 1 2006-08-24 12:32:52Z rmanfredi $ ?RCS: ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ?RCS: ?RCS: You may redistribute only under the terms of the Artistic Licence, ?RCS: as specified in the README file that comes with the distribution. ?RCS: You may reuse parts of this distribution only within the terms of ?RCS: that same Artistic Licence; a copy of which may be found at the root ?RCS: of the source tree for dist 4.0. ?RCS: ?RCS: $Log: d_strcspn.U,v $ ?RCS: Revision 3.0 1993/08/18 12:07:33 ram ?RCS: Baseline for dist 3.0 netwide release. ?RCS: ?MAKE:d_strcspn: Inlibc ?MAKE: -pick add $@ %< ?S:d_strcspn: ?S: This variable conditionally defines the HAS_STRCSPN symbol, which ?S: indicates to the C program that the strcspn() routine is available ?S: to scan strings. ?S:. ?C:HAS_STRCSPN (STRCSPN): ?C: This symbol, if defined, indicates that the strcspn routine is ?C: available to scan strings. ?C:. ?H:#$d_strcspn HAS_STRCSPN /**/ ?H:. ?LINT:set d_strcspn : see if strcspn exists set strcspn d_strcspn eval $inlibc dist_3.5-30.orig/mcon/U/d_system.U0000644000175000017500000000175610473316164017172 0ustar srivastasrivasta?RCS: $Id: d_system.U 1 2006-08-24 12:32:52Z rmanfredi $ ?RCS: ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ?RCS: ?RCS: You may redistribute only under the terms of the Artistic Licence, ?RCS: as specified in the README file that comes with the distribution. ?RCS: You may reuse parts of this distribution only within the terms of ?RCS: that same Artistic Licence; a copy of which may be found at the root ?RCS: of the source tree for dist 4.0. ?RCS: ?RCS: $Log: d_system.U,v $ ?RCS: Revision 3.0 1993/08/18 12:07:44 ram ?RCS: Baseline for dist 3.0 netwide release. ?RCS: ?MAKE:d_system: Inlibc ?MAKE: -pick add $@ %< ?S:d_system: ?S: This variable conditionally defines HAS_SYSTEM if system() is ?S: available to issue a shell command. ?S:. ?C:HAS_SYSTEM (SYSTEM): ?C: This symbol, if defined, indicates that the system routine is ?C: available to issue a shell command. ?C:. ?H:#$d_system HAS_SYSTEM /**/ ?H:. ?LINT:set d_system : see if system exists set system d_system eval $inlibc dist_3.5-30.orig/mcon/U/ptrsize.U0000644000175000017500000000306210473316164017033 0ustar srivastasrivasta?RCS: $Id: ptrsize.U 1 2006-08-24 12:32:52Z rmanfredi $ ?RCS: ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ?RCS: ?RCS: You may redistribute only under the terms of the Artistic Licence, ?RCS: as specified in the README file that comes with the distribution. ?RCS: You may reuse parts of this distribution only within the terms of ?RCS: that same Artistic Licence; a copy of which may be found at the root ?RCS: of the source tree for dist 4.0. ?RCS: ?RCS: $Log: ptrsize.U,v $ ?RCS: Revision 3.0.1.1 1994/10/29 16:28:19 ram ?RCS: patch36: added ?F: line for metalint file checking ?RCS: ?RCS: Revision 3.0 1993/08/18 12:09:37 ram ?RCS: Baseline for dist 3.0 netwide release. ?RCS: ?MAKE:ptrsize: cat rm Myread +cc +ccflags ?MAKE: -pick add $@ %< ?S:ptrsize: ?S: This variable contains the value of the PTRSIZE symbol, which ?S: indicates to the C program how many bytes there are in a pointer. ?S:. ?C:PTRSIZE: ?C: This symbol contains the size of a pointer, so that the C preprocessor ?C: can make decisions based on it. ?C:. ?H:#define PTRSIZE $ptrsize /**/ ?H:. ?F:!try : check for length of pointer echo " " case "$ptrsize" in '') echo "Checking to see how big your pointers are..." >&4 $cat >try.c <<'EOCP' #include int main() { printf("%d\n", sizeof(char *)); } EOCP if $cc $ccflags -o try try.c >/dev/null 2>&1 ; then dflt=`./try` else dflt='4' echo "(I can't seem to compile the test program. Guessing...)" fi ;; *) dflt="$ptrsize" ;; esac rp="What is the size of a pointer (in bytes)?" . ./myread ptrsize="$ans" $rm -f try.c try dist_3.5-30.orig/mcon/U/d_rmdir.U0000644000175000017500000000203610473316164016753 0ustar srivastasrivasta?RCS: $Id: d_rmdir.U 1 2006-08-24 12:32:52Z rmanfredi $ ?RCS: ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ?RCS: ?RCS: You may redistribute only under the terms of the Artistic Licence, ?RCS: as specified in the README file that comes with the distribution. ?RCS: You may reuse parts of this distribution only within the terms of ?RCS: that same Artistic Licence; a copy of which may be found at the root ?RCS: of the source tree for dist 4.0. ?RCS: ?RCS: $Log: d_rmdir.U,v $ ?RCS: Revision 3.0 1993/08/18 12:06:56 ram ?RCS: Baseline for dist 3.0 netwide release. ?RCS: ?MAKE:d_rmdir: Inlibc ?MAKE: -pick add $@ %< ?S:d_rmdir: ?S: This variable conditionally defines HAS_RMDIR if rmdir() is ?S: available to remove directories. ?S:. ?C:HAS_RMDIR (RMDIR): ?C: This symbol, if defined, indicates that the rmdir routine is ?C: available to remove directories. Otherwise you should fork off a ?C: new process to exec /bin/rmdir. ?C:. ?H:#$d_rmdir HAS_RMDIR /**/ ?H:. ?LINT:set d_rmdir : see if rmdir exists set rmdir d_rmdir eval $inlibc dist_3.5-30.orig/mcon/U/newslevel.U0000644000175000017500000000321310473316164017335 0ustar srivastasrivasta?RCS: $Id: newslevel.U 1 2006-08-24 12:32:52Z rmanfredi $ ?RCS: ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ?RCS: ?RCS: You may redistribute only under the terms of the Artistic Licence, ?RCS: as specified in the README file that comes with the distribution. ?RCS: You may reuse parts of this distribution only within the terms of ?RCS: that same Artistic Licence; a copy of which may be found at the root ?RCS: of the source tree for dist 4.0. ?RCS: ?RCS: $Log: newslevel.U,v $ ?RCS: Revision 3.0 1993/08/18 12:09:21 ram ?RCS: Baseline for dist 3.0 netwide release. ?RCS: ?MAKE:newslevel: cat contains test activeexp newslib Myread Oldconfig ?MAKE: -pick add $@ %< ?S:newslevel: ?S: The current revision level of the Usenet news system, encoded ?S: as 1000 * major rev + 10 * minor rev + sub rev. For instance, ?S: news 2.10.3 is encode as 2103, and 2.11 as 2110. ?S:. ?C:NEWSLEVEL: ?C: The current revision level of the Usenet news system, encoded ?C: as 1000 * major rev + 10 * minor rev + sub rev. For instance, ?C: news 2.10.3 is encode as 2103, and 2.11 as 2110. ?C:. ?H:#define NEWSLEVEL $newslevel /**/ ?H:. : check for news version if $test -f $activeexp; then if ??? >/dev/null 2>&1; then dflt=2110 elif $test -f $newslib/cunbatch; then dflt=2103 elif $contains ' [0-9][0-9]* [0-9]' "$activeexp" >/dev/null 2>&1; then dflt=2102 else dflt=2101 fi else dflt=$newslevel fi $cat <" > head.c;; *) case "$h_fcntl" in true) echo "#include " > head.c;; *) echo "#include " > head.c;; esac ;; esac echo " " echo "Figuring out the flag used by open() for non-blocking I/O..." >&4 case "$o_nonblock" in '') $cat head.c > try.c $cat >>try.c <<'EOCP' int main() { #ifdef O_NONBLOCK printf("O_NONBLOCK\n"); exit(0); #endif #ifdef O_NDELAY printf("O_NDELAY\n"); exit(0); #endif ?X: Stevens "Advanced Programming in the UNIX Environment" page 364 mentions ?X: the FNDELAY symbol, used in 4.33BSD (source: Paul Marquess). #ifdef FNDELAY printf("FNDELAY\n"); exit(0); #endif exit(0); } EOCP if $cc $ccflags $ldflags -o try try.c >/dev/null 2>&1; then o_nonblock=`./try` case "$o_nonblock" in '') echo "I can't figure it out, assuming O_NONBLOCK will do.";; *) echo "Seems like we can use $o_nonblock.";; esac else echo "(I can't compile the test program; pray O_NONBLOCK is right!)" fi ;; *) echo "Using $hint value $o_nonblock.";; esac $rm -f try try.* .out core echo " " echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4 case "$eagain" in '') $cat head.c > try.c $cat >>try.c < #include #include #define MY_O_NONBLOCK $o_nonblock extern int errno; $signal_t blech(x) int x; { exit(3); } EOCP $cat >> try.c <<'EOCP' int main() { int pd[2]; int pu[2]; char buf[1]; char string[100]; pipe(pd); /* Down: child -> parent */ pipe(pu); /* Up: parent -> child */ if (0 != fork()) { int ret; close(pd[1]); /* Parent reads from pd[0] */ close(pu[0]); /* Parent writes (blocking) to pu[1] */ if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK)) exit(1); signal(SIGALRM, blech); alarm(5); if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */ exit(2); sprintf(string, "%d\n", ret); write(2, string, strlen(string)); alarm(0); #ifdef EAGAIN if (errno == EAGAIN) { printf("EAGAIN\n"); goto ok; } #endif #ifdef EWOULDBLOCK if (errno == EWOULDBLOCK) printf("EWOULDBLOCK\n"); #endif ok: write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */ sleep(2); /* Give it time to close our pipe */ alarm(5); ret = read(pd[0], buf, 1); /* Should read EOF */ alarm(0); sprintf(string, "%d\n", ret); write(3, string, strlen(string)); exit(0); } close(pd[0]); /* We write to pd[1] */ close(pu[1]); /* We read from pu[0] */ read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */ close(pd[1]); /* Pipe pd is now fully closed! */ exit(0); /* Bye bye, thank you for playing! */ } EOCP if $cc $ccflags $ldflags -o try try.c >/dev/null 2>&1; then ?X: Use script to avoid the possible 'alarm call' message echo "$startsh" >mtry echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry chmod +x mtry ./mtry >/dev/null 2>&1 case $? in 0) eagain=`$cat try.out`;; 1) echo "Could not perform non-blocking setting!";; 2) echo "I did a successful read() for something that was not there!";; 3) echo "Hmm... non-blocking I/O does not seem to be working!";; *) echo "Something terribly wrong happened during testing.";; esac rd_nodata=`$cat try.ret` echo "A read() system call with no data present returns $rd_nodata." case "$rd_nodata" in 0|-1) ;; *) echo "(That's peculiar, fixing that to be -1.)" rd_nodata=-1 ;; esac case "$eagain" in '') echo "Forcing errno EAGAIN on read() with no data available." eagain=EAGAIN ;; *) echo "Your read() sets errno to $eagain when no data is available." ;; esac status=`$cat try.err` case "$status" in 0) echo "And it correctly returns 0 to signal EOF.";; -1) echo "But it also returns -1 to signal EOF, so be careful!";; *) echo "However, your read() returns '$status' on EOF??";; esac val="$define" if test "$status" = "$rd_nodata"; then ./warn "your read() can't distinguish between EOF and no data!" val="$undef" fi else echo "I can't compile the test program--assuming errno EAGAIN will do." eagain=EAGAIN fi set d_eofnblk eval $setvar ;; *) echo "Using $hint value $eagain." echo "Your read() returns $rd_nodata when no data is present." case "$d_eofnblk" in "$define") echo "And you can see EOF because read() returns 0.";; "$undef") echo "But you can't see EOF status from read() returned value.";; *) ?X: Should not happen, but if it does, assume the worst! echo "(Assuming you can't see EOF status from read anyway.)" d_eofnblk=$undef ;; esac ;; esac $rm -f try try.* .out core head.c mtry dist_3.5-30.orig/mcon/U/Csym.U0000644000175000017500000000666510473316164016262 0ustar srivastasrivasta?RCS: $Id: Csym.U 1 2006-08-24 12:32:52Z rmanfredi $ ?RCS: ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ?RCS: ?RCS: You may redistribute only under the terms of the Artistic Licence, ?RCS: as specified in the README file that comes with the distribution. ?RCS: You may reuse parts of this distribution only within the terms of ?RCS: that same Artistic Licence; a copy of which may be found at the root ?RCS: of the source tree for dist 4.0. ?RCS: ?RCS: $Log: Csym.U,v $ ?RCS: Revision 3.0.1.4 1995/07/25 13:36:29 ram ?RCS: patch56: re-arranged compile line to include ldflags before objects ?RCS: patch56: added quotes for OS/2 support ?RCS: ?RCS: Revision 3.0.1.3 1995/05/12 12:00:33 ram ?RCS: patch54: fixed C test program to bypasss gcc builtin type checks (ADO) ?RCS: ?RCS: Revision 3.0.1.2 1994/10/31 09:34:13 ram ?RCS: patch44: added Options to the MAKE line since it's no longer in Init.U ?RCS: ?RCS: Revision 3.0.1.1 1993/08/25 14:00:05 ram ?RCS: patch6: added ldflags as a conditional dependency and to compile line ?RCS: patch6: a final double quote was missing in csym variable after eval ?RCS: ?RCS: Revision 3.0 1993/08/18 12:04:50 ram ?RCS: Baseline for dist 3.0 netwide release. ?RCS: ?MAKE:Csym: Options contains libc libs runnm +cc +ccflags +ldflags rm ?MAKE: -pick add $@ %< ?LINT:define csym ?LINT:use libc ?S:csym: ?S: This shell variable is used internally by Configure to check ?S: wether a given C symbol is defined or not. A typical use is: ?S: set symbol result [-fva] [previous] ?S: eval $csym ?S: That will set result to 'true' if the function [-f], variable [-v] ?S: or array [-a] is defined, 'false' otherwise. If a previous value is ?S: given and the -r flag was provided on the command line, that value ?S: is reused without questioning. ?S:. ?V:csym ?T:tval tx tlook tf tdc tc : is a C symbol defined? csym='tlook=$1; case "$3" in -v) tf=libc.tmp; tc=""; tdc="";; -a) tf=libc.tmp; tc="[0]"; tdc="[]";; *) tlook="^$1\$"; tf=libc.list; tc=""; tdc="()";; esac; tx=yes; case "$reuseval-$4" in true-) ;; true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;; esac; case "$tx" in yes) case "$runnm" in true) if $contains $tlook $tf >/dev/null 2>&1; then tval=true; else tval=false; fi;; *) ?X: ?X: We use 'char' instead of 'int' to try to circumvent overzealous ?X: optimizing compilers using built-in prototypes for commonly used ?X: routines to complain when seeing a different external declaration. For ?X: instance, gcc 2.6.3 fails if we use 'int' and we attempt a test against ?X: memcpy() on machines where sizeof(int) == sizeof(char *) (the usual return ?X: type), the compiler assuming it's a built-in declaration given that the ?X: returned size matches. At least with 'char' we are safe! -- RAM, for ADO ?X: ?X: Let's thank GNU cc for making our lifes so easy! :-) ?X: (An alternative for the future would be to use our knowledge about gcc ?X: to force a -fno-builtin option in the compile test, in case the 'char' ?X: trick is obsoleted by future gcc releases). -- RAM ?X: ?X: Lastly, gcc 3.4 otimizes &missing == 0 away, so we use + 2 instead now. ?X: The GNU folks like to do weird things, don't they? -- RAM, 2004-06-05 ?X: echo "extern char $1$tdc; int main() { return &$1$tc + 2; }" > t.c; if $cc $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1; then tval=true; else tval=false; fi; $rm -f t t.c;; esac;; *) case "$tval" in $define) tval=true;; *) tval=false;; esac;; esac; eval "$2=$tval"' dist_3.5-30.orig/mcon/U/sysman.U0000644000175000017500000000366410473316164016655 0ustar srivastasrivasta?RCS: $Id: sysman.U 1 2006-08-24 12:32:52Z rmanfredi $ ?RCS: ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ?RCS: ?RCS: You may redistribute only under the terms of the Artistic Licence, ?RCS: as specified in the README file that comes with the distribution. ?RCS: You may reuse parts of this distribution only within the terms of ?RCS: that same Artistic Licence; a copy of which may be found at the root ?RCS: of the source tree for dist 4.0. ?RCS: ?RCS: $Log: sysman.U,v $ ?RCS: Revision 3.0.1.2 1994/06/20 07:08:43 ram ?RCS: patch30: now explicitely states that /usr/man/man1 is the default ?RCS: patch30: added /usr/local/man/man1 to the search list ?RCS: ?RCS: Revision 3.0.1.1 1993/09/13 16:13:50 ram ?RCS: patch10: added support for /local/man/man1 (WAD) ?RCS: patch10: added temporary syspath variable to cut down on line length ?RCS: ?RCS: Revision 3.0 1993/08/18 12:09:55 ram ?RCS: Baseline for dist 3.0 netwide release. ?RCS: ?MAKE:sysman: test Loc Oldconfig ?MAKE: -pick add $@ %< ?S:sysman: ?S: This variable holds the place where the manual is located on this ?S: system. It is not the place where the user wants to put his manual ?S: pages. Rather it is the place where Configure may look to find manual ?S: for unix commands (section 1 of the manual usually). See mansrc. ?S:. ?T:syspath : determine where manual pages are on this system echo " " case "$sysman" in '') syspath='/usr/share/man/man1 /usr/man/man1' syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1" syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1" syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1" syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1" syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1" sysman=`./loc . /usr/man/man1 $syspath` ;; esac if $test -d "$sysman"; then echo "System manual is in $sysman." >&4 else echo "Could not find manual pages in source form." >&4 fi dist_3.5-30.orig/mcon/U/d_strcoll.U0000644000175000017500000000214010473316164017314 0ustar srivastasrivasta?RCS: $Id: d_strcoll.U 1 2006-08-24 12:32:52Z rmanfredi $ ?RCS: ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ?RCS: ?RCS: You may redistribute only under the terms of the Artistic Licence, ?RCS: as specified in the README file that comes with the distribution. ?RCS: You may reuse parts of this distribution only within the terms of ?RCS: that same Artistic Licence; a copy of which may be found at the root ?RCS: of the source tree for dist 4.0. ?RCS: ?RCS: Original Author: Andy Dougherty ?RCS: ?RCS: $Log: d_strcoll.U,v $ ?RCS: Revision 3.0.1.1 1994/08/29 16:12:01 ram ?RCS: patch32: created by ADO ?RCS: ?MAKE:d_strcoll: Inlibc ?MAKE: -pick add $@ %< ?S:d_strcoll: ?S: This variable conditionally defines HAS_STRCOLL if strcoll() is ?S: available to compare strings using collating information. ?S:. ?C:HAS_STRCOLL: ?C: This symbol, if defined, indicates that the strcoll routine is ?C: available to compare strings using collating information. ?C:. ?H:#$d_strcoll HAS_STRCOLL /**/ ?H:. ?LINT:set d_strcoll : see if strcoll exists set strcoll d_strcoll eval $inlibc dist_3.5-30.orig/mcon/U/d_syscall.U0000644000175000017500000000204210473316164017305 0ustar srivastasrivasta?RCS: $Id: d_syscall.U 1 2006-08-24 12:32:52Z rmanfredi $ ?RCS: ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ?RCS: ?RCS: You may redistribute only under the terms of the Artistic Licence, ?RCS: as specified in the README file that comes with the distribution. ?RCS: You may reuse parts of this distribution only within the terms of ?RCS: that same Artistic Licence; a copy of which may be found at the root ?RCS: of the source tree for dist 4.0. ?RCS: ?RCS: $Log: d_syscall.U,v $ ?RCS: Revision 3.0 1993/08/18 12:07:42 ram ?RCS: Baseline for dist 3.0 netwide release. ?RCS: ?MAKE:d_syscall: Inlibc ?MAKE: -pick add $@ %< ?S:d_syscall: ?S: This variable conditionally defines HAS_SYSCALL if syscall() is ?S: available call arbitrary system calls. ?S:. ?C:HAS_SYSCALL (SYSCALL): ?C: This symbol, if defined, indicates that the syscall routine is ?C: available to call arbitrary system calls. If undefined, that's tough. ?C:. ?H:#$d_syscall HAS_SYSCALL /**/ ?H:. ?LINT:set d_syscall : see if syscall exists set syscall d_syscall eval $inlibc dist_3.5-30.orig/mcon/U/d_strtol.U0000644000175000017500000000220310473316164017161 0ustar srivastasrivasta?RCS: $Id: d_strtol.U 1 2006-08-24 12:32:52Z rmanfredi $ ?RCS: ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ?RCS: ?RCS: You may redistribute only under the terms of the Artistic Licence, ?RCS: as specified in the README file that comes with the distribution. ?RCS: You may reuse parts of this distribution only within the terms of ?RCS: that same Artistic Licence; a copy of which may be found at the root ?RCS: of the source tree for dist 4.0. ?RCS: ?RCS: $Log: d_strtol.U,v $ ?RCS: Revision 3.0 1993/08/18 12:07:39 ram ?RCS: Baseline for dist 3.0 netwide release. ?RCS: ?MAKE:d_strtol: Inlibc ?MAKE: -pick add $@ %< ?S:d_strtol: ?S: This variable conditionally defines the HAS_STRTOL symbol, which ?S: indicates to the C program that the strtol() routine is available ?S: to provide better numeric string conversion than atoi() and friends. ?S:. ?C:HAS_STRTOL (STRTOL): ?C: This symbol, if defined, indicates that the strtol routine is available ?C: to provide better numeric string conversion than atoi() and friends. ?C:. ?H:#$d_strtol HAS_STRTOL /**/ ?H:. ?LINT:set d_strtol : see if strtol exists set strtol d_strtol eval $inlibc dist_3.5-30.orig/mcon/U/d_sigsetjmp.U0000644000175000017500000000621010473316164017641 0ustar srivastasrivasta?RCS: $Id: d_sigsetjmp.U 1 2006-08-24 12:32:52Z rmanfredi $ ?RCS: ?RCS: Copyright (c) 1996, Andy Dougherty ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ?RCS: ?RCS: You may redistribute only under the terms of the Artistic Licence, ?RCS: as specified in the README file that comes with the distribution. ?RCS: You may reuse parts of this distribution only within the terms of ?RCS: that same Artistic Licence; a copy of which may be found at the root ?RCS: of the source tree for dist 4.0. ?RCS: ?RCS: You may distribute under the terms of either the GNU General Public ?RCS: License or the Artistic License, as specified in the README file. ?RCS: ?RCS: $Log: d_sigsetjmp.U,v $ ?RCS: Revision 3.0.1.1 1997/02/28 15:44:33 ram ?RCS: patch61: created ?RCS: ?MAKE:d_sigsetjmp: Setvar cat +cc +ccflags +ldflags libs rm ?MAKE: -pick add $@ %< ?S:d_sigsetjmp: ?S: This variable conditionally defines the HAS_SIGSETJMP symbol, ?S: which indicates that the sigsetjmp() routine is available to ?S: call setjmp() and optionally save the process's signal mask. ?S:. ?C:HAS_SIGSETJMP: ?C: This variable indicates to the C program that the sigsetjmp() ?C: routine is available to save the calling process's registers ?C: and stack environment for later use by siglongjmp(), and ?C: to optionally save the process's signal mask. See ?C: Sigjmp_buf, Sigsetjmp, and Siglongjmp. ?C:. ?C:Sigjmp_buf: ?C: This is the buffer type to be used with Sigsetjmp and Siglongjmp. ?C:. ?C:Sigsetjmp: ?C: This macro is used in the same way as sigsetjmp(), but will invoke ?C: traditional setjmp() if sigsetjmp isn't available. ?C: See HAS_SIGSETJMP. ?C:. ?C:Siglongjmp: ?C: This macro is used in the same way as siglongjmp(), but will invoke ?C: traditional longjmp() if siglongjmp isn't available. ?C: See HAS_SIGSETJMP. ?C:. ?H:?%<:#$d_sigsetjmp HAS_SIGSETJMP /**/ ?H:?%<:#ifdef HAS_SIGSETJMP ?H:?%<:#define Sigjmp_buf sigjmp_buf ?H:?%<:#define Sigsetjmp(buf,save_mask) sigsetjmp((buf),(save_mask)) ?H:?%<:#define Siglongjmp(buf,retval) siglongjmp((buf),(retval)) ?H:?%<:#else ?H:?%<:#define Sigjmp_buf jmp_buf ?H:?%<:#define Sigsetjmp(buf,save_mask) setjmp((buf)) ?H:?%<:#define Siglongjmp(buf,retval) longjmp((buf),(retval)) ?H:?%<:#endif ?H:. ?W:%<:Sigjmp_buf Sigsetjmp Siglongjmp ?F:!set ?LINT:set d_sigsetjmp : see if sigsetjmp exists ?X: We can't check for these symbols with Inlibc because sigsetjmp ?X: is (sometimes? always?) a macro under GCC echo " " case "$d_sigsetjmp" in '') $cat >set.c <<'EOP' #include sigjmp_buf env; int set = 1; int main() { if (sigsetjmp(env,1)) exit(set); set = 0; siglongjmp(env, 1); exit(1); } EOP if $cc $ccflags $ldflags -o set set.c $libs > /dev/null 2>&1 ; then if ./set >/dev/null 2>&1; then echo "POSIX sigsetjmp found." >&4 val="$define" else $cat >&4 <&4 val="$undef" fi ;; *) val="$d_sigsetjmp" case "$d_sigsetjmp" in $define) echo "POSIX sigsetjmp found." >&4;; $undef) echo "sigsetjmp not found." >&4;; esac ;; esac set d_sigsetjmp eval $setvar $rm -f set.c set dist_3.5-30.orig/mcon/U/d_speedopt.U0000644000175000017500000000351110473316164017460 0ustar srivastasrivasta?RCS: $Id: d_speedopt.U 1 2006-08-24 12:32:52Z rmanfredi $ ?RCS: ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ?RCS: ?RCS: You may redistribute only under the terms of the Artistic Licence, ?RCS: as specified in the README file that comes with the distribution. ?RCS: You may reuse parts of this distribution only within the terms of ?RCS: that same Artistic Licence; a copy of which may be found at the root ?RCS: of the source tree for dist 4.0. ?RCS: ?RCS: $Log: d_speedopt.U,v $ ?RCS: Revision 3.0.1.1 1994/10/29 16:15:51 ram ?RCS: patch36: call ./Cppsym explicitely instead of relying on PATH ?RCS: ?RCS: Revision 3.0 1993/08/18 12:07:27 ram ?RCS: Baseline for dist 3.0 netwide release. ?RCS: ?MAKE:d_speedopt: Myread Cppsym Oldconfig cat models Setvar ?MAKE: -pick add $@ %< ?S:d_speedopt: ?S: This variable conditionally defines the SPEED_OVER_MEM symbol, which ?S: indicates to the C program that it can burn memory in order to save ?S: CPU time. ?S:. ?C:SPEED_OVER_MEM (SPEEDOVERMEM): ?C: This symbol, if defined, indicates that the program can use more ?C: memory in order to reduce CPU time. The symbol doesn't say whether ?C: we are more interested in saving text space or data space. ?C:. ?H:#$d_speedopt SPEED_OVER_MEM /**/ ?H:. ?LINT:set d_speedopt : do we want speed at the expense of memory $cat <<'EOM' I can try to optimize this package for either speed or memory. If you have limited address space you may wish to optimize for memory. Otherwise you should probably optimize for speed. EOM case "$d_speedopt" in '') if ./Cppsym $smallmach; then case "$models" in *large*|*huge*) dflt=speed;; *) dflt=memory;; esac else dflt=speed fi ;; *define*) dflt=speed;; *) dflt=memory;; esac rp="What to optimize for?" . ./myread case "$ans" in mem*) val="$undef";; *) val="$define";; esac set d_speedopt eval $setvar dist_3.5-30.orig/mcon/U/Cross.U0000644000175000017500000001775210473316164016437 0ustar srivastasrivasta?RCS: $Id: Cross.U 1 2006-08-24 12:32:52Z rmanfredi $ ?RCS: ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ?RCS: ?RCS: You may redistribute only under the terms of the Artistic Licence, ?RCS: as specified in the README file that comes with the distribution. ?RCS: You may reuse parts of this distribution only within the terms of ?RCS: that same Artistic Licence; a copy of which may be found at the root ?RCS: of the source tree for dist 4.0. ?RCS: ?RCS: Copyright (c) 2001 Jarkko Hietaniemi ?RCS: ?MAKE:run to from targetarch usecrosscompile: src awk cat grep test rm \ echo sed mkdir cp touch chmod ?MAKE: -pick add $@ %< ?Y:TOP ?S:usecrosscompile: ?S: This variable conditionally defines the USE_CROSS_COMPILE symbol, ?S: and indicates that our package has been cross-compiled. ?S:. ?S:run: ?S: This variable contains the command used by Configure ?S: to copy and execute a cross-compiled executable in the ?S: target host. Useful and available only during the build. ?S: Empty string '' if not cross-compiling. ?S:. ?S:from: ?S: This variable contains the command used by Configure ?S: to copy files from the target host. Useful and available ?S: only during the build. ?S: The string ':' if not cross-compiling. ?S:. ?S:to: ?S: This variable contains the command used by Configure ?S: to copy to from the target host. Useful and available ?S: only during the build. ?S: The string ':' if not cross-compiling. ?S:. ?S:targetarch: ?S: If cross-compiling, this variable contains the target architecture. ?S: If not, this will be empty. ?S:. ?C:USE_CROSS_COMPILE: ?C: This symbol, if defined, indicates that the package is being ?C: cross-compiled. ?C:. ?C:CROSS_TARGET_ARCH: ?C: This symbol, if defined, indicates the target architecture ?C: the package has been cross-compiled to. ?C: Undefined if not a cross-compile. ?C:. ?H:?usecrosscompile:#ifndef USE_CROSS_COMPILE ?H:?usecrosscompile:#$usecrosscompile USE_CROSS_COMPILE /**/ ?H:?usecrosscompile:#define CROSS_TARGET_ARCH "$targetarch" /**/ ?H:?usecrosscompile:#endif ?H:. ?T:croak pwd exe f q i j cwd ?LINT:extern usecrosscompile ?LINT:extern cc ?LINT:extern usrinc ?LINT:change usrinc ?LINT:change ar ?LINT:change nm ?LINT:change ranlib ?LINT:extern targethost ?LINT:extern targetdir ?LINT:change targetdir ?LINT:extern targetuser ?LINT:change targetuser ?LINT:extern targetrun ?LINT:extern targetfrom ?LINT:extern targetto ?LINT:extern targetmkdir ?LINT:change targetrun ?LINT:change targetfrom ?LINT:change targetto ?LINT:change targetmkdir ?LINT:extern incpth ?LINT:extern libpth ?LINT:change incpth ?LINT:change libpth ?LINT:extern locincpth ?LINT:extern loclibpth ?LINT:change locincpth ?LINT:change loclibpth : setup for possible cross-compilation run='' to=: from=: usecrosscompile='undef' targetarch='' case "$usecrosscompile" in $define|true|[yY]*) @if { test -d ../Cross } ?X: ?X: Cross-compilation is enabled when there is a 'Cross' directory found ?X: at the root of the package. This directory must contain the following ?X: entries for defining the cross-compilation process: ?X: ?X: FIXME FIXME ?X: WE MUST DISTINGUISH BETWEEN LOCAL cross-compiling AND REMOTE ONE ?X: ACTUALLY, REMOTE COMPILATION SHOULD BE CONFIGURED INTERACTIVELY ?X: IT WILL COPY ALL THE FILES FROM THE MANIFEST DOWN TO THE REMOTE DIR... ?X: (and copy things like 'mkdep', etc...) ?X: $echo "Cross-compiling..." croak='' case "$cc" in *-*-gcc) ?X: A cross-compiling gcc, probably. targetarch=`$echo $cc|$sed 's/-gcc$//'` ar=$targetarch-ar ?X: leave out ld, choosing it is more complex nm=$targetarch-nm ranlib=$targetarch-ranlib $echo 'extern int foo;' > try.c set X `$cc -v -E try.c 2>&1 | \ $awk '/^#include &4 for i in $*; do j="`$echo $i|$sed 's,/include$,/lib,'`" if $test -d $j; then libpth="$libpth $j" fi done libpth="`$echo $libpth|$sed 's/^ //'`" echo "Guessing libpth '$libpth'." >&4 fi $rm -f try.c ;; esac case "$targetarch" in '') echo "Targetarch not defined." >&4; croak=y ;; *) echo "Using targetarch $targetarch." >&4 ;; esac case "$incpth" in '') echo "Incpth not defined." >&4; croak=y ;; *) echo "Using incpth '$incpth'." >&4 ;; esac case "$libpth" in '') echo "Libpth not defined." >&4; croak=y ;; *) echo "Using libpth '$libpth'." >&4 ;; esac case "$usrinc" in '') for i in $incpth; do if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then usrinc=$i echo "Guessing usrinc $usrinc." >&4 break fi done case "$usrinc" in '') echo "Usrinc not defined." >&4; croak=y ;; esac ;; *) echo "Using usrinc $usrinc." >&4 ;; esac case "$targethost" in '') echo "Targethost not defined." >&4; croak=y ;; *) echo "Using targethost $targethost." >&4 esac locincpth=' ' loclibpth=' ' case "$croak" in y) echo "Cannot continue, aborting." >&4; exit 1 ;; esac case "$src" in /*) run=$src/Cross/run targetmkdir=$src/Cross/mkdir to=$src/Cross/to from=$src/Cross/from ;; *) pwd=`$test -f ../Configure & cd ..; pwd` run=$pwd/Cross/run targetmkdir=$pwd/Cross/mkdir to=$pwd/Cross/to from=$pwd/Cross/from ;; esac case "$targetrun" in '') targetrun=ssh ;; esac case "$targetto" in '') targetto=scp ;; esac case "$targetfrom" in '') targetfrom=scp ;; esac run=$run-$targetrun to=$to-$targetto from=$from-$targetfrom case "$targetdir" in '') targetdir=/tmp echo "Guessing targetdir $targetdir." >&4 ;; esac case "$targetuser" in '') targetuser=root echo "Guessing targetuser $targetuser." >&4 ;; esac case "$targetfrom" in scp) q=-q ;; *) q='' ;; esac case "$targetrun" in ssh|rsh) $cat >$run <&4 exit 1 ;; esac case "$targetmkdir" in */Cross/mkdir) $cat >$targetmkdir <&4 exit 1 ;; esac case "$targetto" in scp|rcp) $cat >$to <$to <&4 exit 1 ;; esac case "$targetfrom" in scp|rcp) $cat >$from <$from <&4 exit 1 ;; esac if $test ! -f $run; then echo "Target 'run' script '$run' not found." >&4 else $chmod a+rx $run fi if $test ! -f $to; then echo "Target 'to' script '$to' not found." >&4 else $chmod a+rx $to fi if $test ! -f $from; then echo "Target 'from' script '$from' not found." >&4 else $chmod a+rx $from fi if $test ! -f $run -o ! -f $to -o ! -f $from; then exit 1 fi $cat >&4 <&4 exit 1 @end ;; esac dist_3.5-30.orig/mcon/U/lseektype.U0000644000175000017500000000272110473316164017341 0ustar srivastasrivasta?RCS: $Id: lseektype.U 1 2006-08-24 12:32:52Z rmanfredi $ ?RCS: ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ?RCS: ?RCS: You may redistribute only under the terms of the Artistic Licence, ?RCS: as specified in the README file that comes with the distribution. ?RCS: You may reuse parts of this distribution only within the terms of ?RCS: that same Artistic Licence; a copy of which may be found at the root ?RCS: of the source tree for dist 4.0. ?RCS: ?RCS: $Log: lseektype.U,v $ ?RCS: Revision 3.0.1.1 1994/08/29 16:30:10 ram ?RCS: patch32: now uses new Typedef unit to compute type information ?RCS: ?RCS: Revision 3.0 1993/08/18 12:09:08 ram ?RCS: Baseline for dist 3.0 netwide release. ?RCS: ?MAKE:lseektype: Myread Typedef ?MAKE: -pick add $@ %< ?S:lseektype: ?S: This variable defines lseektype to be something like off_t, long, ?S: or whatever type is used to declare lseek offset's type in the ?S: kernel (which also appears to be lseek's return type). ?S:. ?C:Off_t (LSEEKTYPE): ?C: This symbol holds the type used to declare offsets in the kernel. ?C: It can be int, long, off_t, etc... It may be necessary to include ?C: to get any typedef'ed information. ?C:. ?H:#define Off_t $lseektype /* type */ ?H:. : see what type lseek is declared as in the kernel set off_t lseektype long stdio.h sys/types.h eval $typedef echo " " dflt="$lseektype" rp="What type is lseek's offset on this system declared as?" . ./myread lseektype="$ans" dist_3.5-30.orig/mcon/U/libdbm.U0000644000175000017500000000257210473316164016571 0ustar srivastasrivasta?RCS: $Id: libdbm.U 1 2006-08-24 12:32:52Z rmanfredi $ ?RCS: ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ?RCS: ?RCS: You may redistribute only under the terms of the Artistic Licence, ?RCS: as specified in the README file that comes with the distribution. ?RCS: You may reuse parts of this distribution only within the terms of ?RCS: that same Artistic Licence; a copy of which may be found at the root ?RCS: of the source tree for dist 4.0. ?RCS: ?RCS: $Log: libdbm.U,v $ ?RCS: Revision 3.0.1.1 1997/02/28 15:56:57 ram ?RCS: patch61: replaced .a with $_a all over the place ?RCS: ?RCS: Revision 3.0 1993/08/18 12:08:58 ram ?RCS: Baseline for dist 3.0 netwide release. ?RCS: ?MAKE:libdbm: test Loc libpth _a ?MAKE: -pick add $@ %< ?S:libdbm: ?S: This variable contains the argument to pass to the loader in order ?S: to get the dbm library routines. If there is no dbm or ndbm ?S: library, it is null. ?S:. ?T:xxx : see if we should include -ldbm echo " " if $test -r /usr/lib/libndbm$_a || $test -r /usr/local/lib/libndbm$_a ; then echo "-lndbm found." >&4 libdbm='-lndbm' elif $test -r /usr/lib/libdbm$_a || $test -r /usr/local/lib/libdbm$_a ; then echo "-ldbm found." >&4 libdbm='-ldbm' else xxx=`./loc libdbm$_a x $libpth` case "$xxx" in x) echo "No dbm library found." >&4 libdbm='' ;; *) echo "DBM library found in $xxx." >&4 libdbm="$xxx" ;; esac fi dist_3.5-30.orig/mcon/U/i_stddef.U0000644000175000017500000000200210473316164017105 0ustar srivastasrivasta?RCS: $Id: i_stddef.U 1 2006-08-24 12:32:52Z rmanfredi $ ?RCS: ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ?RCS: ?RCS: You may redistribute only under the terms of the Artistic Licence, ?RCS: as specified in the README file that comes with the distribution. ?RCS: You may reuse parts of this distribution only within the terms of ?RCS: that same Artistic Licence; a copy of which may be found at the root ?RCS: of the source tree for dist 4.0. ?RCS: ?RCS: $Log: i_stddef.U,v $ ?RCS: Revision 3.0 1993/08/18 12:08:27 ram ?RCS: Baseline for dist 3.0 netwide release. ?RCS: ?MAKE:i_stddef: Inhdr ?MAKE: -pick add $@ %< ?S:i_stddef: ?S: This variable conditionally defines the I_STDDEF symbol, which ?S: indicates to the C program that exists and should ?S: be included. ?S:. ?C:I_STDDEF: ?C: This symbol, if defined, indicates that exists and should ?C: be included. ?C:. ?H:#$i_stddef I_STDDEF /**/ ?H:. ?LINT:set i_stddef : see if stddef is available set stddef.h i_stddef eval $inhdr dist_3.5-30.orig/mcon/U/d_stdstdio.U0000644000175000017500000002362310473316164017500 0ustar srivastasrivasta?RCS: $Id: d_stdstdio.U 1 2006-08-24 12:32:52Z rmanfredi $ ?RCS: ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ?RCS: ?RCS: You may redistribute only under the terms of the Artistic Licence, ?RCS: as specified in the README file that comes with the distribution. ?RCS: You may reuse parts of this distribution only within the terms of ?RCS: that same Artistic Licence; a copy of which may be found at the root ?RCS: of the source tree for dist 4.0. ?RCS: ?RCS: Original Author: Tye McQueen ?RCS: ?RCS: $Log: d_stdstdio.U,v $ ?RCS: Revision 3.0.1.3 1997/02/28 15:46:32 ram ?RCS: patch61: merged with perl5's unit ?RCS: ?RCS: Revision 3.0.1.2 1995/07/25 14:06:54 ram ?RCS: patch56: typo fix on ?C: line for FILE_bufsiz ?RCS: patch56: fixed unbalanced parenthesis (ADO) ?RCS: patch56: check whether FILE_cnt and FILE_ptr can be assigned to (ADO) ?RCS: ?RCS: Revision 3.0.1.1 1995/05/12 12:12:11 ram ?RCS: patch54: complete rewrite by Tye McQueen to fit modern systems ?RCS: ?RCS: Revision 3.0 1993/08/18 12:07:31 ram ?RCS: Baseline for dist 3.0 netwide release. ?RCS: ?MAKE:d_stdstdio d_stdiobase stdio_ptr stdio_cnt stdio_base \ stdio_bufsiz d_stdio_cnt_lval d_stdio_ptr_lval stdio_filbuf: cat \ +cc +ccflags contains +ldflags +libs rm \ Setvar Findhdr Oldconfig ?MAKE: -pick add $@ %< ?S:d_stdstdio: ?S: This variable conditionally defines USE_STDIO_PTR if this system ?S: has a FILE structure declaring usable _ptr and _cnt fields (or ?S: equivalent) in stdio.h. ?S:. ?S:stdio_ptr: ?S: This variable defines how, given a FILE pointer, fp, to access the ?S: _ptr field (or equivalent) of stdio.h's FILE structure. This will ?S: be used to define the macro FILE_ptr(fp). ?S:. ?S:d_stdio_ptr_lval: ?S: This variable conditionally defines STDIO_PTR_LVALUE if the ?S: FILE_ptr macro can be used as an lvalue. ?S:. ?S:stdio_cnt: ?S: This variable defines how, given a FILE pointer, fp, to access the ?S: _cnt field (or equivalent) of stdio.h's FILE structure. This will ?S: be used to define the macro FILE_cnt(fp). ?S:. ?S:d_stdio_cnt_lval: ?S: This variable conditionally defines STDIO_CNT_LVALUE if the ?S: FILE_cnt macro can be used as an lvalue. ?S:. ?S:stdio_filbuf: ?S: This variable defines how, given a FILE pointer, fp, to tell ?S: stdio to refill it's internal buffers (?). This will ?S: be used to define the macro FILE_filbuf(fp). ?S:. ?S:d_stdiobase: ?S: This variable conditionally defines USE_STDIO_BASE if this system ?S: has a FILE structure declaring a usable _base field (or equivalent) ?S: in stdio.h. ?S:. ?S:stdio_base: ?S: This variable defines how, given a FILE pointer, fp, to access the ?S: _base field (or equivalent) of stdio.h's FILE structure. This will ?S: be used to define the macro FILE_base(fp). ?S:. ?S:stdio_bufsiz: ?S: This variable defines how, given a FILE pointer, fp, to determine ?S: the number of bytes store in the I/O buffer pointer to by the ?S: _base field (or equivalent) of stdio.h's FILE structure. This will ?S: be used to define the macro FILE_bufsiz(fp). ?S:. ?C:USE_STDIO_PTR ~ d_stdstdio (USE_STD_STDIO STDSTDIO): ?C: This symbol is defined if the _ptr and _cnt fields (or similar) ?C: of the stdio FILE structure can be used to access the stdio buffer ?C: for a file handle. If this is defined, then the FILE_ptr(fp) ?C: and FILE_cnt(fp) macros will also be defined and should be used ?C: to access these fields. ?C:. ?C:FILE_ptr: ?C: This macro is used to access the _ptr field (or equivalent) of the ?C: FILE structure pointed to by its argument. This macro will always be ?C: defined if USE_STDIO_PTR is defined. ?C:. ?C:STDIO_PTR_LVALUE: ?C: This symbol is defined if the FILE_ptr macro can be used as an ?C: lvalue. ?C:. ?C:FILE_cnt: ?C: This macro is used to access the _cnt field (or equivalent) of the ?C: FILE structure pointed to by its argument. This macro will always be ?C: defined if USE_STDIO_PTR is defined. ?C:. ?C:STDIO_CNT_LVALUE: ?C: This symbol is defined if the FILE_cnt macro can be used as an ?C: lvalue. ?C:. ?C:FILE_filbuf: ?C: This macro is used to access the internal stdio _filbuf function ?C: (or equivalent), if STDIO_CNT_LVALUE and STDIO_PTR_LVALUE ?C: are defined. It is typically either _filbuf or __filbuf. ?C: This macro will only be defined if both STDIO_CNT_LVALUE and ?C: STDIO_PTR_LVALUE are defined. ?C:. ?H:?d_stdstdio:#$d_stdstdio USE_STDIO_PTR /**/ ?H:?d_stdstdio:#ifdef USE_STDIO_PTR ?H:#define FILE_ptr(fp) $stdio_ptr ?H:#$d_stdio_ptr_lval STDIO_PTR_LVALUE /**/ ?H:#define FILE_cnt(fp) $stdio_cnt ?H:#$d_stdio_cnt_lval STDIO_CNT_LVALUE /**/ ?H:?d_stdstdio:#if defined(STDIO_PTR_LVALUE) && defined(STDIO_CNT_LVALUE) ?H:#define FILE_filbuf(fp) $stdio_filbuf /**/ ?H:?d_stdstdio:#endif ?H:?d_stdstdio:#endif ?H:. ?W:d_stdstdio:FILE_ptr FILE_cnt FILE_filbuf ?C:USE_STDIO_BASE ~ d_stdiobase: ?C: This symbol is defined if the _base field (or similar) of the ?C: stdio FILE structure can be used to access the stdio buffer for ?C: a file handle. If this is defined, then the FILE_base(fp) macro ?C: will also be defined and should be used to access this field. ?C: Also, the FILE_bufsiz(fp) macro will be defined and should be used ?C: to determine the number of bytes in the buffer. USE_STDIO_BASE ?C: will never be defined unless USE_STDIO_PTR is. ?C:. ?C:FILE_base: ?C: This macro is used to access the _base field (or equivalent) of the ?C: FILE structure pointed to by its argument. This macro will always be ?C: defined if USE_STDIO_BASE is defined. ?C:. ?C:FILE_bufsiz: ?C: This macro is used to determine the number of bytes in the I/O ?C: buffer pointed to by _base field (or equivalent) of the FILE ?C: structure pointed to its argument. This macro will always be defined ?C: if USE_STDIO_BASE is defined. ?C:. ?H:?d_stdiobase:#$d_stdiobase USE_STDIO_BASE /**/ ?H:?d_stdiobase:#ifdef USE_STDIO_BASE ?H:#define FILE_base(fp) $stdio_base ?H:#define FILE_bufsiz(fp) $stdio_bufsiz ?H:?d_stdiobase:#endif ?H:. ?W:d_stdiobase:FILE_base FILE_bufsiz ?LINT:set d_stdstdio d_stdiobase ?T:ptr_lval cnt_lval filbuf xxx ?F:!try : see if _ptr and _cnt from stdio act std echo " " if $contains '_IO_fpos_t' `./findhdr stdio.h` >/dev/null 2>&1 ; then echo "(Looks like you have stdio.h from Linux.)" case "$stdio_ptr" in '') stdio_ptr='((fp)->_IO_read_ptr)' ptr_lval=$define ;; *) ptr_lval=$d_stdio_ptr_lval;; esac case "$stdio_cnt" in '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)' cnt_lval=$undef ;; *) cnt_lval=$d_stdio_cnt_lval;; esac case "$stdio_base" in '') stdio_base='((fp)->_IO_read_base)';; esac case "$stdio_bufsiz" in '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';; esac else case "$stdio_ptr" in '') stdio_ptr='((fp)->_ptr)' ptr_lval=$define ;; *) ptr_lval=$d_stdio_ptr_lval;; esac case "$stdio_cnt" in '') stdio_cnt='((fp)->_cnt)' cnt_lval=$define ;; *) cnt_lval=$d_stdio_cnt_lval;; esac case "$stdio_base" in '') stdio_base='((fp)->_base)';; esac case "$stdio_bufsiz" in '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';; esac fi : test whether _ptr and _cnt really work echo "Checking how std your stdio is..." >&4 $cat >try.c < #define FILE_ptr(fp) $stdio_ptr #define FILE_cnt(fp) $stdio_cnt int main() { FILE *fp = fopen("try.c", "r"); char c = getc(fp); if ( 18 <= FILE_cnt(fp) && strncmp(FILE_ptr(fp), "include \n", 18) == 0 ) exit(0); exit(1); } EOP val="$undef" if $cc $ccflags $ldflags -o try try.c $libs >/dev/null 2>&1; then if ./try; then echo "Your stdio acts pretty std." val="$define" else echo "Your stdio isn't very std." fi else echo "Your stdio doesn't appear very std." fi $rm -f try.c try set d_stdstdio eval $setvar @if STDIO_PTR_LVALUE || d_stdio_ptr_lval : Can _ptr be used as an lvalue? ?X: Only makes sense if we have a known stdio implementation. case "$d_stdstdio$ptr_lval" in $define$define) val=$define ;; *) val=$undef ;; esac set d_stdio_ptr_lval eval $setvar @end @if STDIO_CNT_LVALUE || d_stdio_cnt_lval : Can _cnt be used as an lvalue? ?X: Only makes sense if we have a known stdio implementation. case "$d_stdstdio$cnt_lval" in $define$define) val=$define ;; *) val=$undef ;; esac set d_stdio_cnt_lval eval $setvar @end @if FILE_filbuf : How to access the stdio _filbuf or __filbuf function. : If this fails, check how the getc macro in stdio.h works. case "${d_stdio_ptr_lval}${d_stdio_cnt_lval}" in ${define}${define}) : Try hint value, if any, then _filbuf, __filbuf, _fill, then punt. : _fill is for OS/2. xxx='notok' for filbuf in $stdio_filbuf '_filbuf(fp)' '__filbuf(fp) ' '_fill(fp)' ; do $cat >try.c < #define FILE_ptr(fp) $stdio_ptr #define FILE_cnt(fp) $stdio_cnt #define FILE_filbuf(fp) $filbuf int main() { FILE *fp = fopen("try.c", "r"); int c; c = getc(fp); c = FILE_filbuf(fp); /* Just looking for linker errors.*/ exit(0); } EOP if $cc $ccflags $ldflags -o try try.c $libs >/dev/null 2>&1 && ./try; then echo "Your stdio appears to use $filbuf" stdio_filbuf="$filbuf" xxx='ok' break else echo "Hmm. $filbuf doesn't seem to work." fi $rm -f try.c try done case "$xxx" in notok) echo "I can't figure out how to access _filbuf" echo "I'll just have to work around it." d_stdio_ptr_lval="$undef" d_stdio_cnt_lval="$undef" ;; esac ;; esac @end @if d_stdiobase || USE_STDIO_BASE || FILE_base || FILE_bufsiz : see if _base is also standard val="$undef" case "$d_stdstdio" in $define) $cat >try.c < #define FILE_base(fp) $stdio_base #define FILE_bufsiz(fp) $stdio_bufsiz int main() { FILE *fp = fopen("try.c", "r"); char c = getc(fp); if ( 19 <= FILE_bufsiz(fp) && strncmp(FILE_base(fp), "#include \n", 19) == 0 ) exit(0); exit(1); } EOP if $cc $ccflags $ldflags -o try try.c $libs > /dev/null 2>&1; then if ./try; then echo "And its _base field acts std." val="$define" else echo "But its _base field isn't std." fi else echo "However, it seems to be lacking the _base field." fi $rm -f try.c try ;; esac set d_stdiobase eval $setvar @end dist_3.5-30.orig/mcon/U/Cppsym.U0000644000175000017500000002530210473316164016607 0ustar srivastasrivasta?RCS: $Id: Cppsym.U 1 2006-08-24 12:32:52Z rmanfredi $ ?RCS: ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ?RCS: ?RCS: You may redistribute only under the terms of the Artistic Licence, ?RCS: as specified in the README file that comes with the distribution. ?RCS: You may reuse parts of this distribution only within the terms of ?RCS: that same Artistic Licence; a copy of which may be found at the root ?RCS: of the source tree for dist 4.0. ?RCS: ?RCS: $Log: Cppsym.U,v $ ?RCS: Revision 3.0.1.5 1995/05/12 11:59:11 ram ?RCS: patch54: split awk command onto two lines for older awks (ADO) ?RCS: ?RCS: Revision 3.0.1.4 1995/01/11 14:55:57 ram ?RCS: patch45: new cc vs. cpp symbol checking suggested by JHI ?RCS: patch45: added more cpp symbols (JHI) ?RCS: ?RCS: Revision 3.0.1.3 1994/10/29 15:51:32 ram ?RCS: patch36: added ?F: line for metalint file checking ?RCS: patch36: new symbols ardent and titan (ADO) ?RCS: ?RCS: Revision 3.0.1.2 1994/06/20 06:53:32 ram ?RCS: patch30: extended cpp symbol lookup list (JHI) ?RCS: patch30: renamed attrlist symbol into al for brevity ?RCS: ?RCS: Revision 3.0.1.1 1993/12/15 08:14:14 ram ?RCS: patch15: added new cpp symbols __bsdi__ and BSD_NET2 ?RCS: ?RCS: Revision 3.0 1993/08/18 12:04:50 ram ?RCS: Baseline for dist 3.0 netwide release. ?RCS: ?X: ?X: This unit produces a shell script called Cppsym, which can be used to ?X: determine whether any in a list of symbols is defined by the C compilation ?X: chain (C preprocessor symbols plus C compiler native ones). ?X: It can determine the status of any symbol, though the symbols in $al ?X: are more easily determined. If you want to add to $al you can do ?X: it in Myinit.U. ?X: ?MAKE:Cppsym ccsymbols cppsymbols cppccsymbols: run \ eunicefix Guess awk cat tr sed sort rm startsh osname \ +cc gccversion test comm uniq echo Options trnl \ optimize ccflags ldflags libs ?MAKE: -pick add $@ %< ?S:ccsymbols: ?S: The variable contains the symbols defined by the C compiler alone. ?S: The symbols defined by cpp or by cc when it calls cpp are not in ?S: this list, see cppsymbols and cppccsymbols. ?S: The list is a space-separated list of symbol=value tokens. ?S:. ?S:cppsymbols: ?S: The variable contains the symbols defined by the C preprocessor ?S: alone. The symbols defined by cc or by cc when it calls cpp are ?S: not in this list, see ccsymbols and cppccsymbols. ?S: The list is a space-separated list of symbol=value tokens. ?S:. ?S:cppccsymbols: ?S: The variable contains the symbols defined by the C compiler ?S: when it calls cpp. The symbols defined by the cc alone or cpp ?S: alone are not in this list, see ccsymbols and cppsymbols. ?S: The list is a space-separated list of symbol=value tokens. ?S:. ?T:also symbols i postprocess_cc_v flags ?F:./Cppsym ?F:!Cppsym.true !Cppsym.know !ccsym.com !ccsym.cpp !ccsym.own : determine known pre-processor and compiler symbols echo " " $echo "Guessing which symbols your C compiler and preprocessor define..." >&4 ?X: ?X: The symbol list is in alpha order for ease of maintenance... ?X: ?X: Lots of new symbols (mostly rummaged from gcc), courtesy of ?X: Jarkko Hietaniemi -- RAM, 06/06/94 ?X: ?X: If your symbol is mixed case, just add it as-is. ?X: All symbols will be transformed to both all-lower and all-upper. ?X: Also drop any leading/trailing underscores, the scan will try all those. ?X: $cat <<'EOSH' > Cppsym.know a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE alliant alpha am29000 AM29000 AMD64 amiga AMIGAOS AMIX ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi bull c cadmus clipper CMU COFF COMPILER_VERSION concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX CYGWIN DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel GLIBC GLIBC_MINOR GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN H3050R H3050RX hbullx20 hcx host_mips hp200 hp300 hp700 HP700 hp800 hp9000 hp9000s200 hp9000s300 hp9000s400 hp9000s500 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG LONGDOUBLE LONGLONG LP64 luna luna88k Lynx M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen MATH_HAS_NO_SIDE_EFFECTS mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr NetBSD news1500 news1700 news1800 news1900 news3700 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000 ns32016 ns32332 ns32k nsc32000 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc pc532 pdp11 PGC PIC plexus PORTAR posix POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE POSIX_C_SOURCE POSIX_SOURCE POWER PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE sony sony_news sonyrisc sparc sparclite spectrum stardent stdc STDC_EXT stratos sun sun3 sun386 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5 sysV68 sysV88 Tek4132 Tek4300 titan TM3200 TM5400 TM5600 tower tower32 tower32_200 tower32_600 tower32_700 tower32_800 tower32_850 tss u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK unix UNIX95 UNIX99 unixpc unos USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED USGr4 USGr4_2 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms xenix Xenix286 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED z8000 EOSH ?X: Maybe put other stuff here too. cat <>Cppsym.know $osname EOSH ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b $cat Cppsym.know > Cppsym.c $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know $rm -f Cppsym.a Cppsym.b Cppsym.c cat < Cppsym $startsh if $test \$# -gt 0; then echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got if $test -s Cppsym.got; then $rm -f Cppsym.got exit 0 fi $rm -f Cppsym.got exit 1 else $tr " " "$trnl" | ./Cppsym.try exit 0 fi EOSH chmod +x Cppsym $eunicefix Cppsym ?X: The below awk script will die a horrible death if ?X: some of the tested symbols are not long ints. ?X: Also, we do not make difference between just defined and defined zero. cat < Cppsym.try $startsh cat <<'EOCP' > try.c #include int main() { EOCP ?X: The length($1) command guards against possible empty entries. ?X: The awk snippet is know to give heartburn to UNICOS/mk awk. $awk \\ EOSH cat <<'EOSH' >> Cppsym.try 'length($1) > 0 { printf "#ifdef %s\n#if %s+0\nprintf(\"%s=%%ld\\n\", (long)%s);\n#else\nprintf(\"%s\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1 printf "#ifdef _%s\n#if _%s+0\nprintf(\"_%s=%%ld\\n\", (long)_%s);\n#else\nprintf(\"_%s\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1 printf "#ifdef __%s\n#if __%s+0\nprintf(\"__%s=%%ld\\n\", (long)__%s);\n#else\nprintf(\"__%s\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1 printf "#ifdef __%s__\n#if __%s__+0\nprintf(\"__%s__=%%ld\\n\", (long)__%s__);\n#else\nprintf(\"__%s__\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1 }' >> try.c echo 'return 0;}' >> try.c EOSH cat <> Cppsym.try flags="$ccflags" case "$osname-$gccversion" in irix-) flags="\$flags -woff 1178" ;; os2-*) flags="\$flags -Zlinker /PM:VIO" ;; esac $cc -o try $optimize \$flags $ldflags try.c $libs && $run ./try EOSH chmod +x Cppsym.try $eunicefix Cppsym.try ./Cppsym < Cppsym.know > Cppsym.true : now check the C compiler for additional symbols ?X: suggested by Jarkko Hietaniemi , thanks! postprocess_cc_v='' case "$osname" in aix) postprocess_cc_v="|$tr , ' '" ;; esac $cat >ccsym <tmp.c <&1 $postprocess_cc_v\` do case "\$i" in -D*) echo "\$i" | $sed 's/^-D//';; -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';; esac done $rm -f try.c EOS postprocess_cc_v='' chmod +x ccsym $eunicefix ccsym ./ccsym > ccsym1.raw ?X: AIX complains if $uniq is passed an empty file. ($sort apparently ?X: doesn't care.) --AD 14 July 1998 if $test -s ccsym1.raw; then $sort ccsym1.raw | $uniq >ccsym.raw else mv ccsym1.raw ccsym.raw fi ?X: canonicalize symbols for easier sort/uniq/comm usage: append =1 if no = sign ?X: the awk script must be on two lines for older awk programs, sigh! -- ADO $awk '/\=/ { print $0; next } { print $0"=1" }' ccsym.raw >ccsym.list $awk '/\=/ { print $0; next } { print $0"=1" }' Cppsym.true >ccsym.true $comm -13 ccsym.true ccsym.list >ccsym.own $comm -12 ccsym.true ccsym.list >ccsym.com $comm -23 ccsym.true ccsym.list >ccsym.cpp also='' if $test -z ccsym.raw; then echo "Your C compiler doesn't seem to define any symbols!" >&4 echo " " echo "However, your C preprocessor defines the following symbols:" $cat Cppsym.true ccsymbols='' cppsymbols=`$cat Cppsym.true` cppsymbols=`echo $cppsymbols` cppccsymbols="$cppsymbols" else if $test -s ccsym.com; then echo "Your C compiler and pre-processor define these symbols:" $sed -e 's/\(..*\)=.*/\1/' ccsym.com also='also ' symbols='ones' cppccsymbols=`$cat ccsym.com` cppccsymbols=`echo $cppccsymbols` $test "$silent" || sleep 1 fi if $test -s ccsym.cpp; then $test "$also" && echo " " echo "Your C pre-processor ${also}defines the following symbols:" $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp also='further ' cppsymbols=`$cat ccsym.cpp` cppsymbols=`echo $cppsymbols` $test "$silent" || sleep 1 fi if $test -s ccsym.own; then $test "$also" && echo " " echo "Your C compiler ${also}defines the following cpp symbols:" $sed -e 's/\(..*\)=1/\1/' ccsym.own $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true ccsymbols=`$cat ccsym.own` ccsymbols=`echo $ccsymbols` $test "$silent" || sleep 1 fi fi $rm -f Cppsym.know Cppsym.true dist_3.5-30.orig/mcon/U/Config_h.U0000644000175000017500000001011010473316164017037 0ustar srivastasrivasta?RCS: $Id: Config_h.U 1 2006-08-24 12:32:52Z rmanfredi $ ?RCS: ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ?RCS: ?RCS: You may redistribute only under the terms of the Artistic Licence, ?RCS: as specified in the README file that comes with the distribution. ?RCS: You may reuse parts of this distribution only within the terms of ?RCS: that same Artistic Licence; a copy of which may be found at the root ?RCS: of the source tree for dist 4.0. ?RCS: ?RCS: $Log: Config_h.U,v $ ?RCS: Revision 3.0.1.5 1997/02/28 14:57:43 ram ?RCS: patch61: added support for src.U ?RCS: ?RCS: Revision 3.0.1.4 1995/09/25 09:10:49 ram ?RCS: patch59: commented the purpose of the #un-def directive ?RCS: ?RCS: Revision 3.0.1.3 1995/01/30 14:25:39 ram ?RCS: patch49: typo fixes in leading config.h comment (WED) ?RCS: ?RCS: Revision 3.0.1.2 1993/08/24 12:13:20 ram ?RCS: patch3: added TOP as a local shell temporary variable ?RCS: ?RCS: Revision 3.0.1.1 1993/08/19 06:42:20 ram ?RCS: patch1: leading config.sh searching was not aborting properly ?RCS: ?RCS: Revision 3.0 1993/08/18 12:04:47 ram ?RCS: Baseline for dist 3.0 netwide release. ?RCS: ?X: ?X: This file ends up producing the config_h.SH script, which is run to produce ?X: the config.h file. The file ./.Config_h below contains all the ?H: lines ?X: extracted out of all the units. Metaconfig itself adds the !GROK!THIS!. ?X: Note that this code isn't included into Configure, but must be shipped with. ?X: ?X: For those who wish to know why the file is config_h.SH instead of the more ?X: natural config.h.SH, well... it is to support systems like MS-DOG. Only one ?X: 'dot' is allowed within the file name, as it is part of the "extension" of ?X: the file. MS-DOG will not let you have two 'dots' because that would mean ?X: two "extensions". ?X: ?MAKE:Config_h: Id End Config_sh Obsol_h myuname cf_time cf_by package src ?MAKE: -pick c_h_weed $@ %< ?MAKE: -pick c_h_weed $@ ./Config_h ?MAKE: -pick c_h_weed $@ ./Obsol_h ?T:CONFIG TOP ?LINT:unclosed !GROK!THIS! ?LINT:extern CONFIG_H CONFIG_SH ?LINT:change CONFIG_H CONFIG_SH ?LINT:nocomment case "$CONFIG_SH" in '') CONFIG_SH=config.sh;; esac case "$CONFIG_H" in '') CONFIG_H=config.h;; esac case $CONFIG in '') if test -f $CONFIG_SH; then TOP=.; elif test -f ../$CONFIG_SH; then TOP=..; elif test -f ../../$CONFIG_SH; then TOP=../..; elif test -f ../../../$CONFIG_SH; then TOP=../../..; elif test -f ../../../../$CONFIG_SH; then TOP=../../../..; else echo "Can't find $CONFIG_SH."; exit 1 fi . $TOP/$CONFIG_SH ;; esac ?X: Make sure we are in the directory where the .SH file is located. case "$0" in */*) cd `expr X$0 : 'X\(.*\)/'` ;; esac echo "Extracting $CONFIG_H (with variable substitutions)" ?X: ?X: Since we unconditionally translate leading #undef into /*#define, we're ?X: stuck when we really want to have a #undef in config.h. That's why there ?X: is provision here for #un-def, which is translated back into #undef after ?X: all original #undef have been processed. ?X: ?X: Previously, we changed all ?X: #undef FOO /**/ ?X: into ?X: /*#define FOO /**/ ?X: The xlc compiler (available on IBM's AIX) complains that this is ?X: an illegal attempt to write a nested comment, and warns against it. ?X: There's apparently no way to shut the compiler up, either. ?X: This sed command from Hallvard B Furuseth ?X: changes it to ?X: /*#define FOO / **/ sed <$CONFIG_H -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un-def!#undef!' /* * This file was produced by running the config_h.SH script, which * gets its values from $CONFIG_SH, which is generally produced by * running Configure. * * Feel free to modify any of this as the need arises. Note, however, * that running config_h.SH again will wipe out any changes you've made. * For a more permanent change edit $CONFIG_SH and rerun config_h.SH. * * \$Id: Config_h.U 1 2006-08-24 12:32:52Z rmanfredi $ */ /* * Package name : $package * Source directory : $src * Configuration time: $cf_time * Configured by : $cf_by * Target system : $myuname */ #ifndef _config_h_ #define _config_h_ dist_3.5-30.orig/mcon/U/cf_email.U0000644000175000017500000000316510473316164017076 0ustar srivastasrivasta?RCS: $Id: cf_email.U 1 2006-08-24 12:32:52Z rmanfredi $ ?RCS: ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ?RCS: ?RCS: You may redistribute only under the terms of the Artistic Licence, ?RCS: as specified in the README file that comes with the distribution. ?RCS: You may reuse parts of this distribution only within the terms of ?RCS: that same Artistic Licence; a copy of which may be found at the root ?RCS: of the source tree for dist 4.0. ?RCS: ?RCS: $Log: cf_email.U,v $ ?RCS: Revision 3.0.1.1 1994/01/24 14:05:06 ram ?RCS: patch16: created ?RCS: ?RCS: ?MAKE:cf_email: cat cf_by myhostname mydomain Oldconfig Myread ?MAKE: -pick add $@ %< ?S:cf_email: ?S: Electronic mail address of the person who ran Configure. This can be ?S: used by units that require the user's e-mail, like MailList.U. ?S:. ?T:cont : determine the e-mail address of the user who is running us $cat <