From 371472d9fb6a936149b105a6563a0550d35bdf1a Mon Sep 17 00:00:00 2001 From: Manoj Srivastava Date: Mon, 1 Dec 2003 17:11:15 +0000 Subject: Initial import of upstream branch Initial import of upstream branch git-archimport-id: srivasta@debian.org--2003-primary/dist--upstream--3.70--base-0 --- mcon/INTRO | 109 +++ mcon/Jmakefile | 93 +++ mcon/Makefile.SH | 378 +++++++++ mcon/NOTES | 174 ++++ mcon/README | 24 + mcon/U/AAAAA.U | 46 ++ mcon/U/Begin.U | 39 + mcon/U/Chk_MANI.U | 84 ++ mcon/U/Chk_whoami.U | 25 + mcon/U/Config_h.U | 104 +++ mcon/U/Config_sh.U | 91 ++ mcon/U/Configdir.U | 28 + mcon/U/Cppsym.U | 229 ++++++ mcon/U/Csym.U | 96 +++ mcon/U/End.U | 28 + mcon/U/Extract.U | 119 +++ mcon/U/Extractall.U | 54 ++ mcon/U/Filexp.U | 69 ++ mcon/U/Findhdr.U | 106 +++ mcon/U/Finish.U | 122 +++ mcon/U/Getfile.U | 305 +++++++ mcon/U/Guess.U | 171 ++++ mcon/U/Head.U | 246 ++++++ mcon/U/Inhdr.U | 78 ++ mcon/U/Init.U | 54 ++ mcon/U/Inlibc.U | 65 ++ mcon/U/Instruct.U | 116 +++ mcon/U/Loc.U | 345 ++++++++ mcon/U/Loc_sed.U | 34 + mcon/U/Magic_h.U | 42 + mcon/U/MailAuthor.U | 192 +++++ mcon/U/MailList.U | 82 ++ mcon/U/Myinit.U | 26 + mcon/U/Myread.U | 199 +++++ mcon/U/Nothing.U | 19 + mcon/U/Null.U | 20 + mcon/U/Obsol_h.U | 27 + mcon/U/Obsol_sh.U | 26 + mcon/U/Oldconfig.U | 599 ++++++++++++++ mcon/U/Oldsym.U | 62 ++ mcon/U/Options.U | 255 ++++++ mcon/U/Prefixit.U | 68 ++ mcon/U/Prefixup.U | 38 + mcon/U/Rcs.U | 34 + mcon/U/Setvar.U | 50 ++ mcon/U/Signal.U | 192 +++++ mcon/U/Tr.U | 60 ++ mcon/U/Typedef.U | 62 ++ mcon/U/Unix.U | 70 ++ mcon/U/Warn_v7EXT.U | 34 + mcon/U/Warn_v7ND.U | 33 + mcon/U/Whoa.U | 50 ++ mcon/U/abortsig.U | 79 ++ mcon/U/active.U | 50 ++ mcon/U/afs.U | 43 + mcon/U/alignbytes.U | 64 ++ mcon/U/archlib.U | 125 +++ mcon/U/archname.U | 76 ++ mcon/U/baserev.U | 22 + mcon/U/basicshell.U | 47 ++ mcon/U/bin.U | 88 ++ mcon/U/bitpbyte.U | 74 ++ mcon/U/byteorder.U | 99 +++ mcon/U/cc.U | 129 +++ mcon/U/ccflags.U | 399 +++++++++ mcon/U/cf_email.U | 57 ++ mcon/U/cf_name.U | 72 ++ mcon/U/cf_who.U | 60 ++ mcon/U/charorder.U | 143 ++++ mcon/U/charsize.U | 58 ++ mcon/U/contains.U | 43 + mcon/U/cpp_stuff.U | 118 +++ mcon/U/cppfilecom.U | 202 +++++ mcon/U/cppstdin.U | 235 ++++++ mcon/U/d_NOFILE.U | 189 +++++ mcon/U/d_NeWS.U | 101 +++ mcon/U/d_PORTAR.U | 79 ++ mcon/U/d_SHM_MAC.U | 141 ++++ mcon/U/d_access.U | 74 ++ mcon/U/d_alarm.U | 33 + mcon/U/d_attribut.U | 64 ++ mcon/U/d_bcmp.U | 44 + mcon/U/d_bcopy.U | 44 + mcon/U/d_brokstat.U | 72 ++ mcon/U/d_bsdjmp.U | 86 ++ mcon/U/d_byacc.U | 33 + mcon/U/d_bzero.U | 44 + mcon/U/d_casti32.U | 86 ++ mcon/U/d_castneg.U | 142 ++++ mcon/U/d_cbrt.U | 32 + mcon/U/d_charsprf.U | 51 ++ mcon/U/d_chown.U | 33 + mcon/U/d_chroot.U | 33 + mcon/U/d_chsize.U | 32 + mcon/U/d_ckeypad.U | 54 ++ mcon/U/d_closedir.U | 107 +++ mcon/U/d_const.U | 64 ++ mcon/U/d_crypt.U | 70 ++ mcon/U/d_csh.U | 50 ++ mcon/U/d_ctermid.U | 31 + mcon/U/d_cuserid.U | 34 + mcon/U/d_dbl_dig.U | 60 ++ mcon/U/d_difftime.U | 33 + mcon/U/d_dlerror.U | 46 ++ mcon/U/d_dlopen.U | 45 + mcon/U/d_dosuid.U | 168 ++++ mcon/U/d_drem.U | 35 + mcon/U/d_dup2.U | 31 + mcon/U/d_eofpipe.U | 92 +++ mcon/U/d_euc2jis.U | 32 + mcon/U/d_fchmod.U | 32 + mcon/U/d_fchown.U | 32 + mcon/U/d_fcntl.U | 31 + mcon/U/d_fd_set.U | 138 ++++ mcon/U/d_ffs.U | 33 + mcon/U/d_fgetpos.U | 31 + mcon/U/d_flexfnam.U | 77 ++ mcon/U/d_flock.U | 31 + mcon/U/d_fmod.U | 34 + mcon/U/d_fork.U | 33 + mcon/U/d_fsetpos.U | 31 + mcon/U/d_ftime.U | 78 ++ mcon/U/d_ftrncate.U | 31 + mcon/U/d_gconvert.U | 147 ++++ mcon/U/d_getgrps.U | 33 + mcon/U/d_gethbynm.U | 32 + mcon/U/d_gethent.U | 31 + mcon/U/d_gethid.U | 31 + mcon/U/d_gethname.U | 287 +++++++ mcon/U/d_getlogin.U | 34 + mcon/U/d_getopt.U | 31 + mcon/U/d_getpagsz.U | 104 +++ mcon/U/d_getpgid.U | 34 + mcon/U/d_getpgrp.U | 105 +++ mcon/U/d_getpgrp2.U | 32 + mcon/U/d_getppid.U | 34 + mcon/U/d_getprior.U | 31 + mcon/U/d_getpwent.U | 40 + mcon/U/d_getwd.U | 41 + mcon/U/d_gnulibc.U | 53 ++ mcon/U/d_group.U | 23 + mcon/U/d_havetlib.U | 125 +++ mcon/U/d_hidnet.U | 68 ++ mcon/U/d_htonl.U | 87 ++ mcon/U/d_inetaton.U | 34 + mcon/U/d_inetd.U | 70 ++ mcon/U/d_internet.U | 52 ++ mcon/U/d_isascii.U | 57 ++ mcon/U/d_itimer.U | 32 + mcon/U/d_keepsig.U | 79 ++ mcon/U/d_killpg.U | 33 + mcon/U/d_link.U | 31 + mcon/U/d_linuxstd.U | 55 ++ mcon/U/d_locconv.U | 33 + mcon/U/d_lockf.U | 33 + mcon/U/d_lstat.U | 31 + mcon/U/d_mblen.U | 34 + mcon/U/d_mbstowcs.U | 32 + mcon/U/d_mbtowc.U | 32 + mcon/U/d_memccpy.U | 33 + mcon/U/d_memchr.U | 32 + mcon/U/d_memcmp.U | 35 + mcon/U/d_memcpy.U | 35 + mcon/U/d_memmove.U | 34 + mcon/U/d_memset.U | 35 + mcon/U/d_mkdir.U | 33 + mcon/U/d_mkfifo.U | 28 + mcon/U/d_mktime.U | 33 + mcon/U/d_mmap.U | 31 + mcon/U/d_msg.U | 45 + mcon/U/d_msgctl.U | 31 + mcon/U/d_msgget.U | 31 + mcon/U/d_msgrcv.U | 31 + mcon/U/d_msgsnd.U | 31 + mcon/U/d_msync.U | 31 + mcon/U/d_munmap.U | 31 + mcon/U/d_newsadm.U | 72 ++ mcon/U/d_nice.U | 33 + mcon/U/d_nolnbuf.U | 98 +++ mcon/U/d_normsig.U | 57 ++ mcon/U/d_open3.U | 90 ++ mcon/U/d_passwd.U | 23 + mcon/U/d_pathconf.U | 55 ++ mcon/U/d_pause.U | 34 + mcon/U/d_perror.U | 44 + mcon/U/d_pidcheck.U | 75 ++ mcon/U/d_pipe.U | 34 + mcon/U/d_poll.U | 36 + mcon/U/d_popen.U | 31 + mcon/U/d_portable.U | 71 ++ mcon/U/d_psignal.U | 31 + mcon/U/d_raster.U | 57 ++ mcon/U/d_rdchk.U | 33 + mcon/U/d_readdir.U | 79 ++ mcon/U/d_readlink.U | 34 + mcon/U/d_regcmp.U | 80 ++ mcon/U/d_rename.U | 33 + mcon/U/d_rmdir.U | 32 + mcon/U/d_rusage.U | 36 + mcon/U/d_safebcpy.U | 124 +++ mcon/U/d_safemcpy.U | 127 +++ mcon/U/d_sanemcmp.U | 88 ++ mcon/U/d_sbrk.U | 31 + mcon/U/d_scandir.U | 31 + mcon/U/d_scannl.U | 74 ++ mcon/U/d_scorfl.U | 58 ++ mcon/U/d_select.U | 33 + mcon/U/d_sem.U | 45 + mcon/U/d_semctl.U | 31 + mcon/U/d_semget.U | 31 + mcon/U/d_semop.U | 31 + mcon/U/d_setegid.U | 32 + mcon/U/d_seteuid.U | 32 + mcon/U/d_setlnbuf.U | 36 + mcon/U/d_setlocale.U | 33 + mcon/U/d_setpgid.U | 37 + mcon/U/d_setpgrp.U | 115 +++ mcon/U/d_setpgrp2.U | 32 + mcon/U/d_setprior.U | 31 + mcon/U/d_setregid.U | 46 ++ mcon/U/d_setreuid.U | 46 ++ mcon/U/d_setrgid.U | 32 + mcon/U/d_setruid.U | 32 + mcon/U/d_setsid.U | 34 + mcon/U/d_sgndchr.U | 59 ++ mcon/U/d_shm.U | 45 + mcon/U/d_shmat.U | 93 +++ mcon/U/d_shmctl.U | 31 + mcon/U/d_shmdt.U | 31 + mcon/U/d_shmget.U | 31 + mcon/U/d_sigaction.U | 61 ++ mcon/U/d_sigblock.U | 31 + mcon/U/d_sighold.U | 31 + mcon/U/d_siglist.U | 39 + mcon/U/d_sigsetjmp.U | 105 +++ mcon/U/d_sigsetmk.U | 41 + mcon/U/d_sigvec.U | 79 ++ mcon/U/d_sjis2jis.U | 32 + mcon/U/d_socket.U | 122 +++ mcon/U/d_speedopt.U | 62 ++ mcon/U/d_stat.U | 31 + mcon/U/d_statblks.U | 46 ++ mcon/U/d_stdstdio.U | 325 ++++++++ mcon/U/d_strccmp.U | 38 + mcon/U/d_strchr.U | 95 +++ mcon/U/d_strcoll.U | 33 + mcon/U/d_strcspn.U | 32 + mcon/U/d_strctcpy.U | 53 ++ mcon/U/d_strdup.U | 32 + mcon/U/d_strerror.U | 117 +++ mcon/U/d_strftime.U | 31 + mcon/U/d_strstr.U | 31 + mcon/U/d_strtod.U | 34 + mcon/U/d_strtok.U | 35 + mcon/U/d_strtol.U | 32 + mcon/U/d_strtoul.U | 34 + mcon/U/d_strxfrm.U | 33 + mcon/U/d_su_chown.U | 41 + mcon/U/d_symlink.U | 32 + mcon/U/d_syscall.U | 31 + mcon/U/d_sysconf.U | 34 + mcon/U/d_syslog.U | 49 ++ mcon/U/d_system.U | 31 + mcon/U/d_table.U | 34 + mcon/U/d_tcgtpgrp.U | 34 + mcon/U/d_tcstpgrp.U | 34 + mcon/U/d_time.U | 66 ++ mcon/U/d_times.U | 74 ++ mcon/U/d_tminsys.U | 41 + mcon/U/d_truncate.U | 31 + mcon/U/d_tzmin.U | 53 ++ mcon/U/d_tzname.U | 42 + mcon/U/d_ulimit.U | 31 + mcon/U/d_umask.U | 34 + mcon/U/d_usendir.U | 77 ++ mcon/U/d_usleep.U | 31 + mcon/U/d_uwait.U | 123 +++ mcon/U/d_vfork.U | 100 +++ mcon/U/d_voidsig.U | 89 ++ mcon/U/d_volatile.U | 74 ++ mcon/U/d_vprintf.U | 80 ++ mcon/U/d_wait3.U | 31 + mcon/U/d_wait4.U | 30 + mcon/U/d_waitpid.U | 31 + mcon/U/d_wcstombs.U | 32 + mcon/U/d_wctomb.U | 34 + mcon/U/d_wifstat.U | 87 ++ mcon/U/d_xdrs.U | 42 + mcon/U/defeditor.U | 45 + mcon/U/doublesize.U | 58 ++ mcon/U/errnolist.U | 106 +++ mcon/U/etc.U | 42 + mcon/U/filexp.U | 30 + mcon/U/floatsize.U | 58 ++ mcon/U/fpostype.U | 39 + mcon/U/fpu.U | 73 ++ mcon/U/gidtype.U | 61 ++ mcon/U/groupstype.U | 62 ++ mcon/U/h_fcntl.U | 23 + mcon/U/h_sysfile.U | 23 + mcon/U/i_arpainet.U | 31 + mcon/U/i_db.U | 146 ++++ mcon/U/i_dbm.U | 79 ++ mcon/U/i_dirent.U | 146 ++++ mcon/U/i_dld.U | 34 + mcon/U/i_dlfcn.U | 34 + mcon/U/i_fcntl.U | 61 ++ mcon/U/i_float.U | 35 + mcon/U/i_gdbm.U | 53 ++ mcon/U/i_grp.U | 31 + mcon/U/i_limits.U | 33 + mcon/U/i_locale.U | 32 + mcon/U/i_malloc.U | 31 + mcon/U/i_math.U | 34 + mcon/U/i_memory.U | 65 ++ mcon/U/i_ndbm.U | 53 ++ mcon/U/i_neterrno.U | 65 ++ mcon/U/i_niin.U | 45 + mcon/U/i_pwd.U | 162 ++++ mcon/U/i_regex.U | 35 + mcon/U/i_sfio.U | 32 + mcon/U/i_stddef.U | 32 + mcon/U/i_stdlib.U | 32 + mcon/U/i_string.U | 62 ++ mcon/U/i_sysdir.U | 34 + mcon/U/i_sysfile.U | 60 ++ mcon/U/i_sysioctl.U | 202 +++++ mcon/U/i_sysmman.U | 34 + mcon/U/i_sysndir.U | 31 + mcon/U/i_sysparam.U | 31 + mcon/U/i_sysresrc.U | 34 + mcon/U/i_sysselct.U | 39 + mcon/U/i_syssock.U | 32 + mcon/U/i_sysstat.U | 32 + mcon/U/i_systable.U | 32 + mcon/U/i_systimeb.U | 55 ++ mcon/U/i_systimes.U | 31 + mcon/U/i_systwgcf.U | 31 + mcon/U/i_systypes.U | 34 + mcon/U/i_sysun.U | 35 + mcon/U/i_syswait.U | 34 + mcon/U/i_termio.U | 123 +++ mcon/U/i_time.U | 171 ++++ mcon/U/i_unistd.U | 31 + mcon/U/i_utime.U | 31 + mcon/U/i_values.U | 35 + mcon/U/i_varhdr.U | 164 ++++ mcon/U/i_vfork.U | 41 + mcon/U/i_whoami.U | 35 + mcon/U/inc.U | 39 + mcon/U/install.U | 188 +++++ mcon/U/intsize.U | 124 +++ mcon/U/ipc.U | 171 ++++ mcon/U/kernel.U | 63 ++ mcon/U/lex.U | 67 ++ mcon/U/lib.U | 54 ++ mcon/U/libc.U | 368 +++++++++ mcon/U/libdbm.U | 47 ++ mcon/U/libflex.U | 65 ++ mcon/U/libnlist.U | 49 ++ mcon/U/libnm.U | 45 + mcon/U/libpth.U | 126 +++ mcon/U/libs.U | 157 ++++ mcon/U/libyacc.U | 64 ++ mcon/U/lintlib.U | 38 + mcon/U/lns.U | 40 + mcon/U/locdist.U | 174 ++++ mcon/U/longsize.U | 24 + mcon/U/lseektype.U | 40 + mcon/U/maildir.U | 41 + mcon/U/mailer.U | 61 ++ mcon/U/mailfile.U | 56 ++ mcon/U/make.U | 57 ++ mcon/U/mallocsrc.U | 163 ++++ mcon/U/man1dir.U | 147 ++++ mcon/U/man3dir.U | 158 ++++ mcon/U/manfmt.U | 118 +++ mcon/U/mansrc.U | 149 ++++ mcon/U/mboxchar.U | 70 ++ mcon/U/mkdep.U | 251 ++++++ mcon/U/models.U | 204 +++++ mcon/U/modetype.U | 40 + mcon/U/myhostname.U | 267 ++++++ mcon/U/n.U | 45 + mcon/U/nametype.U | 134 +++ mcon/U/nblock_io.U | 254 ++++++ mcon/U/newslevel.U | 53 ++ mcon/U/newslib.U | 61 ++ mcon/U/newsspool.U | 52 ++ mcon/U/nis.U | 165 ++++ mcon/U/nlist_pfx.U | 135 +++ mcon/U/orderlib.U | 94 +++ mcon/U/orgname.U | 65 ++ mcon/U/packadmin.U | 32 + mcon/U/package.U | 51 ++ mcon/U/pager.U | 51 ++ mcon/U/patchlevel.U | 33 + mcon/U/perlpath.U | 56 ++ mcon/U/pidtype.U | 39 + mcon/U/prefix.U | 80 ++ mcon/U/prefshell.U | 60 ++ mcon/U/privlib.U | 96 +++ mcon/U/prototype.U | 118 +++ mcon/U/ptrsize.U | 58 ++ mcon/U/randbits.U | 83 ++ mcon/U/randfunc.U | 163 ++++ mcon/U/rcs_branch.U | 43 + mcon/U/registers.U | 104 +++ mcon/U/rootid.U | 35 + mcon/U/sbrksmart.U | 84 ++ mcon/U/sbrktype.U | 44 + mcon/U/scriptdir.U | 110 +++ mcon/U/selecttype.U | 109 +++ mcon/U/sh.U | 89 ++ mcon/U/shm_for.U | 118 +++ mcon/U/sig_name.U | 117 +++ mcon/U/sitearch.U | 94 +++ mcon/U/sitelib.U | 97 +++ mcon/U/sizetype.U | 40 + mcon/U/so.U | 50 ++ mcon/U/sockopt.U | 87 ++ mcon/U/spitshell.U | 92 +++ mcon/U/src.U | 97 +++ mcon/U/ssizetype.U | 91 ++ mcon/U/startperl.U | 94 +++ mcon/U/startsh.U | 50 ++ mcon/U/stdchar.U | 36 + mcon/U/sunscanf.U | 55 ++ mcon/U/sysman.U | 49 ++ mcon/U/uidtype.U | 57 ++ mcon/U/usenm.U | 121 +++ mcon/U/usrinc.U | 95 +++ mcon/U/vaproto.U | 65 ++ mcon/U/voidflags.U | 159 ++++ mcon/U/warnflags.U | 54 ++ mcon/U/yacc.U | 82 ++ mcon/configure | 144 ++++ mcon/files/Internal.U | 20 + mcon/files/README | 6 + mcon/files/d_function.U | 31 + mcon/files/dir.U | 47 ++ mcon/files/file.U | 47 ++ mcon/files/i_include.U | 32 + mcon/files/keyword.U | 54 ++ mcon/files/locate.U | 47 ++ mcon/files/question.U | 58 ++ mcon/files/rcshead.U | 15 + mcon/files/shell.U | 68 ++ mcon/files/type.U | 47 ++ mcon/makegloss.SH | 217 +++++ mcon/man/Jmakefile | 24 + mcon/man/Makefile.SH | 167 ++++ mcon/man/mconfig.SH | 2097 +++++++++++++++++++++++++++++++++++++++++++++++ mcon/man/mlint.SH | 489 +++++++++++ mcon/man/mxref.SH | 133 +++ mcon/mconfig.SH | 179 ++++ mcon/mlint.SH | 137 ++++ mcon/mxref.SH | 147 ++++ mcon/pl/common.pl | 287 +++++++ mcon/pl/configure.pl | 245 ++++++ mcon/pl/cosmetic.pl | 114 +++ mcon/pl/depend.pl | 138 ++++ mcon/pl/eval.pl | 300 +++++++ mcon/pl/extract.pl | 109 +++ mcon/pl/files.pl | 109 +++ mcon/pl/gensym.pl | 22 + mcon/pl/init.pl | 55 ++ mcon/pl/lint.pl | 1144 ++++++++++++++++++++++++++ mcon/pl/locate.pl | 153 ++++ mcon/pl/makefile.pl | 176 ++++ mcon/pl/obsolete.pl | 103 +++ mcon/pl/order.pl | 42 + mcon/pl/tsort.pl | 166 ++++ mcon/pl/wanted.pl | 263 ++++++ mcon/pl/xref.pl | 67 ++ mcon/pl/xwant.pl | 149 ++++ 476 files changed, 38785 insertions(+) create mode 100644 mcon/INTRO create mode 100644 mcon/Jmakefile create mode 100644 mcon/Makefile.SH create mode 100644 mcon/NOTES create mode 100644 mcon/README create mode 100644 mcon/U/AAAAA.U create mode 100644 mcon/U/Begin.U create mode 100644 mcon/U/Chk_MANI.U create mode 100644 mcon/U/Chk_whoami.U create mode 100644 mcon/U/Config_h.U create mode 100644 mcon/U/Config_sh.U create mode 100644 mcon/U/Configdir.U create mode 100644 mcon/U/Cppsym.U create mode 100644 mcon/U/Csym.U create mode 100644 mcon/U/End.U create mode 100644 mcon/U/Extract.U create mode 100644 mcon/U/Extractall.U create mode 100644 mcon/U/Filexp.U create mode 100644 mcon/U/Findhdr.U create mode 100644 mcon/U/Finish.U create mode 100644 mcon/U/Getfile.U create mode 100644 mcon/U/Guess.U create mode 100644 mcon/U/Head.U create mode 100644 mcon/U/Inhdr.U create mode 100644 mcon/U/Init.U create mode 100644 mcon/U/Inlibc.U create mode 100644 mcon/U/Instruct.U create mode 100644 mcon/U/Loc.U create mode 100644 mcon/U/Loc_sed.U create mode 100644 mcon/U/Magic_h.U create mode 100644 mcon/U/MailAuthor.U create mode 100644 mcon/U/MailList.U create mode 100644 mcon/U/Myinit.U create mode 100644 mcon/U/Myread.U create mode 100644 mcon/U/Nothing.U create mode 100644 mcon/U/Null.U create mode 100644 mcon/U/Obsol_h.U create mode 100644 mcon/U/Obsol_sh.U create mode 100644 mcon/U/Oldconfig.U create mode 100644 mcon/U/Oldsym.U create mode 100644 mcon/U/Options.U create mode 100644 mcon/U/Prefixit.U create mode 100644 mcon/U/Prefixup.U create mode 100644 mcon/U/Rcs.U create mode 100644 mcon/U/Setvar.U create mode 100644 mcon/U/Signal.U create mode 100644 mcon/U/Tr.U create mode 100644 mcon/U/Typedef.U create mode 100644 mcon/U/Unix.U create mode 100644 mcon/U/Warn_v7EXT.U create mode 100644 mcon/U/Warn_v7ND.U create mode 100644 mcon/U/Whoa.U create mode 100644 mcon/U/abortsig.U create mode 100644 mcon/U/active.U create mode 100644 mcon/U/afs.U create mode 100644 mcon/U/alignbytes.U create mode 100644 mcon/U/archlib.U create mode 100644 mcon/U/archname.U create mode 100644 mcon/U/baserev.U create mode 100644 mcon/U/basicshell.U create mode 100644 mcon/U/bin.U create mode 100644 mcon/U/bitpbyte.U create mode 100644 mcon/U/byteorder.U create mode 100644 mcon/U/cc.U create mode 100644 mcon/U/ccflags.U create mode 100644 mcon/U/cf_email.U create mode 100644 mcon/U/cf_name.U create mode 100644 mcon/U/cf_who.U create mode 100644 mcon/U/charorder.U create mode 100644 mcon/U/charsize.U create mode 100644 mcon/U/contains.U create mode 100644 mcon/U/cpp_stuff.U create mode 100644 mcon/U/cppfilecom.U create mode 100644 mcon/U/cppstdin.U create mode 100644 mcon/U/d_NOFILE.U create mode 100644 mcon/U/d_NeWS.U create mode 100644 mcon/U/d_PORTAR.U create mode 100644 mcon/U/d_SHM_MAC.U create mode 100644 mcon/U/d_access.U create mode 100644 mcon/U/d_alarm.U create mode 100644 mcon/U/d_attribut.U create mode 100644 mcon/U/d_bcmp.U create mode 100644 mcon/U/d_bcopy.U create mode 100644 mcon/U/d_brokstat.U create mode 100644 mcon/U/d_bsdjmp.U create mode 100644 mcon/U/d_byacc.U create mode 100644 mcon/U/d_bzero.U create mode 100644 mcon/U/d_casti32.U create mode 100644 mcon/U/d_castneg.U create mode 100644 mcon/U/d_cbrt.U create mode 100644 mcon/U/d_charsprf.U create mode 100644 mcon/U/d_chown.U create mode 100644 mcon/U/d_chroot.U create mode 100644 mcon/U/d_chsize.U create mode 100644 mcon/U/d_ckeypad.U create mode 100644 mcon/U/d_closedir.U create mode 100644 mcon/U/d_const.U create mode 100644 mcon/U/d_crypt.U create mode 100644 mcon/U/d_csh.U create mode 100644 mcon/U/d_ctermid.U create mode 100644 mcon/U/d_cuserid.U create mode 100644 mcon/U/d_dbl_dig.U create mode 100644 mcon/U/d_difftime.U create mode 100644 mcon/U/d_dlerror.U create mode 100644 mcon/U/d_dlopen.U create mode 100644 mcon/U/d_dosuid.U create mode 100644 mcon/U/d_drem.U create mode 100644 mcon/U/d_dup2.U create mode 100644 mcon/U/d_eofpipe.U create mode 100644 mcon/U/d_euc2jis.U create mode 100644 mcon/U/d_fchmod.U create mode 100644 mcon/U/d_fchown.U create mode 100644 mcon/U/d_fcntl.U create mode 100644 mcon/U/d_fd_set.U create mode 100644 mcon/U/d_ffs.U create mode 100644 mcon/U/d_fgetpos.U create mode 100644 mcon/U/d_flexfnam.U create mode 100644 mcon/U/d_flock.U create mode 100644 mcon/U/d_fmod.U create mode 100644 mcon/U/d_fork.U create mode 100644 mcon/U/d_fsetpos.U create mode 100644 mcon/U/d_ftime.U create mode 100644 mcon/U/d_ftrncate.U create mode 100644 mcon/U/d_gconvert.U create mode 100644 mcon/U/d_getgrps.U create mode 100644 mcon/U/d_gethbynm.U create mode 100644 mcon/U/d_gethent.U create mode 100644 mcon/U/d_gethid.U create mode 100644 mcon/U/d_gethname.U create mode 100644 mcon/U/d_getlogin.U create mode 100644 mcon/U/d_getopt.U create mode 100644 mcon/U/d_getpagsz.U create mode 100644 mcon/U/d_getpgid.U create mode 100644 mcon/U/d_getpgrp.U create mode 100644 mcon/U/d_getpgrp2.U create mode 100644 mcon/U/d_getppid.U create mode 100644 mcon/U/d_getprior.U create mode 100644 mcon/U/d_getpwent.U create mode 100644 mcon/U/d_getwd.U create mode 100644 mcon/U/d_gnulibc.U create mode 100644 mcon/U/d_group.U create mode 100644 mcon/U/d_havetlib.U create mode 100644 mcon/U/d_hidnet.U create mode 100644 mcon/U/d_htonl.U create mode 100644 mcon/U/d_inetaton.U create mode 100644 mcon/U/d_inetd.U create mode 100644 mcon/U/d_internet.U create mode 100644 mcon/U/d_isascii.U create mode 100644 mcon/U/d_itimer.U create mode 100644 mcon/U/d_keepsig.U create mode 100644 mcon/U/d_killpg.U create mode 100644 mcon/U/d_link.U create mode 100644 mcon/U/d_linuxstd.U create mode 100644 mcon/U/d_locconv.U create mode 100644 mcon/U/d_lockf.U create mode 100644 mcon/U/d_lstat.U create mode 100644 mcon/U/d_mblen.U create mode 100644 mcon/U/d_mbstowcs.U create mode 100644 mcon/U/d_mbtowc.U create mode 100644 mcon/U/d_memccpy.U create mode 100644 mcon/U/d_memchr.U create mode 100644 mcon/U/d_memcmp.U create mode 100644 mcon/U/d_memcpy.U create mode 100644 mcon/U/d_memmove.U create mode 100644 mcon/U/d_memset.U create mode 100644 mcon/U/d_mkdir.U create mode 100644 mcon/U/d_mkfifo.U create mode 100644 mcon/U/d_mktime.U create mode 100644 mcon/U/d_mmap.U create mode 100644 mcon/U/d_msg.U create mode 100644 mcon/U/d_msgctl.U create mode 100644 mcon/U/d_msgget.U create mode 100644 mcon/U/d_msgrcv.U create mode 100644 mcon/U/d_msgsnd.U create mode 100644 mcon/U/d_msync.U create mode 100644 mcon/U/d_munmap.U create mode 100644 mcon/U/d_newsadm.U create mode 100644 mcon/U/d_nice.U create mode 100644 mcon/U/d_nolnbuf.U create mode 100644 mcon/U/d_normsig.U create mode 100644 mcon/U/d_open3.U create mode 100644 mcon/U/d_passwd.U create mode 100644 mcon/U/d_pathconf.U create mode 100644 mcon/U/d_pause.U create mode 100644 mcon/U/d_perror.U create mode 100644 mcon/U/d_pidcheck.U create mode 100644 mcon/U/d_pipe.U create mode 100644 mcon/U/d_poll.U create mode 100644 mcon/U/d_popen.U create mode 100644 mcon/U/d_portable.U create mode 100644 mcon/U/d_psignal.U create mode 100644 mcon/U/d_raster.U create mode 100644 mcon/U/d_rdchk.U create mode 100644 mcon/U/d_readdir.U create mode 100644 mcon/U/d_readlink.U create mode 100644 mcon/U/d_regcmp.U create mode 100644 mcon/U/d_rename.U create mode 100644 mcon/U/d_rmdir.U create mode 100644 mcon/U/d_rusage.U create mode 100644 mcon/U/d_safebcpy.U create mode 100644 mcon/U/d_safemcpy.U create mode 100644 mcon/U/d_sanemcmp.U create mode 100644 mcon/U/d_sbrk.U create mode 100644 mcon/U/d_scandir.U create mode 100644 mcon/U/d_scannl.U create mode 100644 mcon/U/d_scorfl.U create mode 100644 mcon/U/d_select.U create mode 100644 mcon/U/d_sem.U create mode 100644 mcon/U/d_semctl.U create mode 100644 mcon/U/d_semget.U create mode 100644 mcon/U/d_semop.U create mode 100644 mcon/U/d_setegid.U create mode 100644 mcon/U/d_seteuid.U create mode 100644 mcon/U/d_setlnbuf.U create mode 100644 mcon/U/d_setlocale.U create mode 100644 mcon/U/d_setpgid.U create mode 100644 mcon/U/d_setpgrp.U create mode 100644 mcon/U/d_setpgrp2.U create mode 100644 mcon/U/d_setprior.U create mode 100644 mcon/U/d_setregid.U create mode 100644 mcon/U/d_setreuid.U create mode 100644 mcon/U/d_setrgid.U create mode 100644 mcon/U/d_setruid.U create mode 100644 mcon/U/d_setsid.U create mode 100644 mcon/U/d_sgndchr.U create mode 100644 mcon/U/d_shm.U create mode 100644 mcon/U/d_shmat.U create mode 100644 mcon/U/d_shmctl.U create mode 100644 mcon/U/d_shmdt.U create mode 100644 mcon/U/d_shmget.U create mode 100644 mcon/U/d_sigaction.U create mode 100644 mcon/U/d_sigblock.U create mode 100644 mcon/U/d_sighold.U create mode 100644 mcon/U/d_siglist.U create mode 100644 mcon/U/d_sigsetjmp.U create mode 100644 mcon/U/d_sigsetmk.U create mode 100644 mcon/U/d_sigvec.U create mode 100644 mcon/U/d_sjis2jis.U create mode 100644 mcon/U/d_socket.U create mode 100644 mcon/U/d_speedopt.U create mode 100644 mcon/U/d_stat.U create mode 100644 mcon/U/d_statblks.U create mode 100644 mcon/U/d_stdstdio.U create mode 100644 mcon/U/d_strccmp.U create mode 100644 mcon/U/d_strchr.U create mode 100644 mcon/U/d_strcoll.U create mode 100644 mcon/U/d_strcspn.U create mode 100644 mcon/U/d_strctcpy.U create mode 100644 mcon/U/d_strdup.U create mode 100644 mcon/U/d_strerror.U create mode 100644 mcon/U/d_strftime.U create mode 100644 mcon/U/d_strstr.U create mode 100644 mcon/U/d_strtod.U create mode 100644 mcon/U/d_strtok.U create mode 100644 mcon/U/d_strtol.U create mode 100644 mcon/U/d_strtoul.U create mode 100644 mcon/U/d_strxfrm.U create mode 100644 mcon/U/d_su_chown.U create mode 100644 mcon/U/d_symlink.U create mode 100644 mcon/U/d_syscall.U create mode 100644 mcon/U/d_sysconf.U create mode 100644 mcon/U/d_syslog.U create mode 100644 mcon/U/d_system.U create mode 100644 mcon/U/d_table.U create mode 100644 mcon/U/d_tcgtpgrp.U create mode 100644 mcon/U/d_tcstpgrp.U create mode 100644 mcon/U/d_time.U create mode 100644 mcon/U/d_times.U create mode 100644 mcon/U/d_tminsys.U create mode 100644 mcon/U/d_truncate.U create mode 100644 mcon/U/d_tzmin.U create mode 100644 mcon/U/d_tzname.U create mode 100644 mcon/U/d_ulimit.U create mode 100644 mcon/U/d_umask.U create mode 100644 mcon/U/d_usendir.U create mode 100644 mcon/U/d_usleep.U create mode 100644 mcon/U/d_uwait.U create mode 100644 mcon/U/d_vfork.U create mode 100644 mcon/U/d_voidsig.U create mode 100644 mcon/U/d_volatile.U create mode 100644 mcon/U/d_vprintf.U create mode 100644 mcon/U/d_wait3.U create mode 100644 mcon/U/d_wait4.U create mode 100644 mcon/U/d_waitpid.U create mode 100644 mcon/U/d_wcstombs.U create mode 100644 mcon/U/d_wctomb.U create mode 100644 mcon/U/d_wifstat.U create mode 100644 mcon/U/d_xdrs.U create mode 100644 mcon/U/defeditor.U create mode 100644 mcon/U/doublesize.U create mode 100644 mcon/U/errnolist.U create mode 100644 mcon/U/etc.U create mode 100644 mcon/U/filexp.U create mode 100644 mcon/U/floatsize.U create mode 100644 mcon/U/fpostype.U create mode 100644 mcon/U/fpu.U create mode 100644 mcon/U/gidtype.U create mode 100644 mcon/U/groupstype.U create mode 100644 mcon/U/h_fcntl.U create mode 100644 mcon/U/h_sysfile.U create mode 100644 mcon/U/i_arpainet.U create mode 100644 mcon/U/i_db.U create mode 100644 mcon/U/i_dbm.U create mode 100644 mcon/U/i_dirent.U create mode 100644 mcon/U/i_dld.U create mode 100644 mcon/U/i_dlfcn.U create mode 100644 mcon/U/i_fcntl.U create mode 100644 mcon/U/i_float.U create mode 100644 mcon/U/i_gdbm.U create mode 100644 mcon/U/i_grp.U create mode 100644 mcon/U/i_limits.U create mode 100644 mcon/U/i_locale.U create mode 100644 mcon/U/i_malloc.U create mode 100644 mcon/U/i_math.U create mode 100644 mcon/U/i_memory.U create mode 100644 mcon/U/i_ndbm.U create mode 100644 mcon/U/i_neterrno.U create mode 100644 mcon/U/i_niin.U create mode 100644 mcon/U/i_pwd.U create mode 100644 mcon/U/i_regex.U create mode 100644 mcon/U/i_sfio.U create mode 100644 mcon/U/i_stddef.U create mode 100644 mcon/U/i_stdlib.U create mode 100644 mcon/U/i_string.U create mode 100644 mcon/U/i_sysdir.U create mode 100644 mcon/U/i_sysfile.U create mode 100644 mcon/U/i_sysioctl.U create mode 100644 mcon/U/i_sysmman.U create mode 100644 mcon/U/i_sysndir.U create mode 100644 mcon/U/i_sysparam.U create mode 100644 mcon/U/i_sysresrc.U create mode 100644 mcon/U/i_sysselct.U create mode 100644 mcon/U/i_syssock.U create mode 100644 mcon/U/i_sysstat.U create mode 100644 mcon/U/i_systable.U create mode 100644 mcon/U/i_systimeb.U create mode 100644 mcon/U/i_systimes.U create mode 100644 mcon/U/i_systwgcf.U create mode 100644 mcon/U/i_systypes.U create mode 100644 mcon/U/i_sysun.U create mode 100644 mcon/U/i_syswait.U create mode 100644 mcon/U/i_termio.U create mode 100644 mcon/U/i_time.U create mode 100644 mcon/U/i_unistd.U create mode 100644 mcon/U/i_utime.U create mode 100644 mcon/U/i_values.U create mode 100644 mcon/U/i_varhdr.U create mode 100644 mcon/U/i_vfork.U create mode 100644 mcon/U/i_whoami.U create mode 100644 mcon/U/inc.U create mode 100644 mcon/U/install.U create mode 100644 mcon/U/intsize.U create mode 100644 mcon/U/ipc.U create mode 100644 mcon/U/kernel.U create mode 100644 mcon/U/lex.U create mode 100644 mcon/U/lib.U create mode 100644 mcon/U/libc.U create mode 100644 mcon/U/libdbm.U create mode 100644 mcon/U/libflex.U create mode 100644 mcon/U/libnlist.U create mode 100644 mcon/U/libnm.U create mode 100644 mcon/U/libpth.U create mode 100644 mcon/U/libs.U create mode 100644 mcon/U/libyacc.U create mode 100644 mcon/U/lintlib.U create mode 100644 mcon/U/lns.U create mode 100644 mcon/U/locdist.U create mode 100644 mcon/U/longsize.U create mode 100644 mcon/U/lseektype.U create mode 100644 mcon/U/maildir.U create mode 100644 mcon/U/mailer.U create mode 100644 mcon/U/mailfile.U create mode 100644 mcon/U/make.U create mode 100644 mcon/U/mallocsrc.U create mode 100644 mcon/U/man1dir.U create mode 100644 mcon/U/man3dir.U create mode 100644 mcon/U/manfmt.U create mode 100644 mcon/U/mansrc.U create mode 100644 mcon/U/mboxchar.U create mode 100644 mcon/U/mkdep.U create mode 100644 mcon/U/models.U create mode 100644 mcon/U/modetype.U create mode 100644 mcon/U/myhostname.U create mode 100644 mcon/U/n.U create mode 100644 mcon/U/nametype.U create mode 100644 mcon/U/nblock_io.U create mode 100644 mcon/U/newslevel.U create mode 100644 mcon/U/newslib.U create mode 100644 mcon/U/newsspool.U create mode 100644 mcon/U/nis.U create mode 100644 mcon/U/nlist_pfx.U create mode 100644 mcon/U/orderlib.U create mode 100644 mcon/U/orgname.U create mode 100644 mcon/U/packadmin.U create mode 100644 mcon/U/package.U create mode 100644 mcon/U/pager.U create mode 100644 mcon/U/patchlevel.U create mode 100644 mcon/U/perlpath.U create mode 100644 mcon/U/pidtype.U create mode 100644 mcon/U/prefix.U create mode 100644 mcon/U/prefshell.U create mode 100644 mcon/U/privlib.U create mode 100644 mcon/U/prototype.U create mode 100644 mcon/U/ptrsize.U create mode 100644 mcon/U/randbits.U create mode 100644 mcon/U/randfunc.U create mode 100644 mcon/U/rcs_branch.U create mode 100644 mcon/U/registers.U create mode 100644 mcon/U/rootid.U create mode 100644 mcon/U/sbrksmart.U create mode 100644 mcon/U/sbrktype.U create mode 100644 mcon/U/scriptdir.U create mode 100644 mcon/U/selecttype.U create mode 100644 mcon/U/sh.U create mode 100644 mcon/U/shm_for.U create mode 100644 mcon/U/sig_name.U create mode 100644 mcon/U/sitearch.U create mode 100644 mcon/U/sitelib.U create mode 100644 mcon/U/sizetype.U create mode 100644 mcon/U/so.U create mode 100644 mcon/U/sockopt.U create mode 100644 mcon/U/spitshell.U create mode 100644 mcon/U/src.U create mode 100644 mcon/U/ssizetype.U create mode 100644 mcon/U/startperl.U create mode 100644 mcon/U/startsh.U create mode 100644 mcon/U/stdchar.U create mode 100644 mcon/U/sunscanf.U create mode 100644 mcon/U/sysman.U create mode 100644 mcon/U/uidtype.U create mode 100644 mcon/U/usenm.U create mode 100644 mcon/U/usrinc.U create mode 100644 mcon/U/vaproto.U create mode 100644 mcon/U/voidflags.U create mode 100644 mcon/U/warnflags.U create mode 100644 mcon/U/yacc.U create mode 100644 mcon/configure create mode 100644 mcon/files/Internal.U create mode 100644 mcon/files/README create mode 100644 mcon/files/d_function.U create mode 100644 mcon/files/dir.U create mode 100644 mcon/files/file.U create mode 100644 mcon/files/i_include.U create mode 100644 mcon/files/keyword.U create mode 100644 mcon/files/locate.U create mode 100644 mcon/files/question.U create mode 100644 mcon/files/rcshead.U create mode 100644 mcon/files/shell.U create mode 100644 mcon/files/type.U create mode 100755 mcon/makegloss.SH create mode 100644 mcon/man/Jmakefile create mode 100644 mcon/man/Makefile.SH create mode 100755 mcon/man/mconfig.SH create mode 100755 mcon/man/mlint.SH create mode 100755 mcon/man/mxref.SH create mode 100644 mcon/mconfig.SH create mode 100644 mcon/mlint.SH create mode 100644 mcon/mxref.SH create mode 100644 mcon/pl/common.pl create mode 100644 mcon/pl/configure.pl create mode 100644 mcon/pl/cosmetic.pl create mode 100644 mcon/pl/depend.pl create mode 100644 mcon/pl/eval.pl create mode 100644 mcon/pl/extract.pl create mode 100644 mcon/pl/files.pl create mode 100644 mcon/pl/gensym.pl create mode 100644 mcon/pl/init.pl create mode 100644 mcon/pl/lint.pl create mode 100644 mcon/pl/locate.pl create mode 100644 mcon/pl/makefile.pl create mode 100644 mcon/pl/obsolete.pl create mode 100644 mcon/pl/order.pl create mode 100644 mcon/pl/tsort.pl create mode 100644 mcon/pl/wanted.pl create mode 100644 mcon/pl/xref.pl create mode 100644 mcon/pl/xwant.pl (limited to 'mcon') diff --git a/mcon/INTRO b/mcon/INTRO new file mode 100644 index 0000000..51f4417 --- /dev/null +++ b/mcon/INTRO @@ -0,0 +1,109 @@ +This 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. + diff --git a/mcon/Jmakefile b/mcon/Jmakefile new file mode 100644 index 0000000..1bf64f2 --- /dev/null +++ b/mcon/Jmakefile @@ -0,0 +1,93 @@ +/* + * Jmakefile for metaconfig + */ + +;# $Id: Jmakefile,v 3.0.1.4 1995/07/25 13:23:09 ram Exp $ +;# +;# Copyright (c) 1991-1993, 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 3.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) + +>PRIVLIB /* We need the privlib definition */ +>SCRIPTDIR /* As well as the script directory */ + +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 \\ + +>SED +>RM +>MKDEP + +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 + diff --git a/mcon/Makefile.SH b/mcon/Makefile.SH new file mode 100644 index 0000000..3768cb5 --- /dev/null +++ b/mcon/Makefile.SH @@ -0,0 +1,378 @@ +: Makefile.SH generated from Jmake.tmpl and Jmakefile [jmake 3.0 PL55] +: $X-Id: Jmake.tmpl,v 3.0.1.2 1995/01/11 14:50:21 ram Exp ram $ +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,v 3.0.1.3 1995/03/21 08:35:28 ram Exp ram $ +######################################################################## +# Force 'make depend' to be performed first -- do not edit + +.FORCE_DEPEND:: + +all:: .FORCE_DEPEND + +######################################################################## +# Start of Jmakefile + +# $X-Id: Jmakefile,v 3.0.1.4 1995/07/25 13:23:09 ram Exp ram $ +# +# Copyright (c) 1991-1993, 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 3.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 + + +install:: + @for dir in $(PRIVLIB) $(PRIVLIB)/U; do \ + case '${MFLAGS}' in *[i]*) set +e;; esac; \ + (set -x; test -d $$dir || $(INSTALLDIR) $$dir); \ + done + +deinstall:: + $(RM) -r $(PRIVLIB) $(PRIVLIB)/U + +install:: Glossary + $(INSTALL) -c -m 444 Glossary $(PRIVLIB) + +deinstall:: + $(RM) $(PRIVLIB)/Glossary + +install:: makegloss + $(INSTALL) -c -m 555 makegloss $(PRIVLIB) + +deinstall:: + $(RM) $(PRIVLIB)/makegloss + +install:: configure + $(INSTALL) -c -m 555 configure $(PRIVLIB) + +deinstall:: + $(RM) $(PRIVLIB)/configure + +install:: U/[a-d]*.U + @case '${MFLAGS}' in *[i]*) set +e;; esac; \ + for i in U/[a-d]*.U; do \ + (set -x; $(INSTALL) -c -m 444 $$i $(PRIVLIB)/U); \ + done + +deinstall:: + @case '${MFLAGS}' in *[i]*) set +e;; esac; \ + for i in U/[a-d]*.U; do \ + (set -x; $(RM) $(PRIVLIB)/U/$$i); \ + done + +install:: U/[A-Ze-z]*.U + @case '${MFLAGS}' in *[i]*) set +e;; esac; \ + for i in U/[A-Ze-z]*.U; do \ + (set -x; $(INSTALL) -c -m 444 $$i $(PRIVLIB)/U); \ + done + +deinstall:: + @case '${MFLAGS}' in *[i]*) set +e;; esac; \ + for i in U/[A-Ze-z]*.U; do \ + (set -x; $(RM) $(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 $@ + +install:: metaconfig + $(INSTALL) -c -m 555 metaconfig $(SCRIPTDIR) + +deinstall:: + $(RM) $(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 $@ + +install:: metalint + $(INSTALL) -c -m 555 metalint $(SCRIPTDIR) + +deinstall:: + $(RM) $(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 $@ + +install:: metaxref + $(INSTALL) -c -m 555 metaxref $(SCRIPTDIR) + +deinstall:: + $(RM) $(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 + +emptyrule:: + +clean: sub_clean local_clean +realclean: sub_realclean local_realclean +clobber: sub_clobber local_clobber + +local_clean:: + $(RM) core *~ *.o + +local_realclean:: local_clean + +local_clobber:: local_realclean + $(RM) Makefile config.sh + +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 $@; exit 0; 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)); \ + done + +install:: + @$(MAKE) subdirs TARGET=install VERB="Installing" FLAGS= + +deinstall:: + @$(MAKE) subdirs TARGET=deinstall VERB="Deinstalling" FLAGS= + +install.man:: + @$(MAKE) subdirs TARGET=install.man VERB="Installing man pages" FLAGS= + +deinstall.man:: + @$(MAKE) subdirs TARGET=deinstall.man VERB="Deinstalling man pages" FLAGS= + +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); \ + 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) \ + 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; $(MAKE) $(MFLAGS) -f ../Makefile \ + Makefile TOP=$$newtop CURRENT=$(DIR)$$i;\ + $(MAKE) $(MFLAGS) Makefiles.SH) \ + done + +all:: + @$(MAKE) subdirs TARGET=all VERB="Making all" FLAGS= + +######################################################################## +# Dependencies generated by make depend +# DO NOT DELETE THIS LINE -- make depend relies on it + +# Put nothing here or make depend will gobble it up +.FORCE_DEPEND:: + @echo "You must run 'make depend' in $(TOP) first."; exit 1 +!NO!SUBS! +chmod 644 Makefile +$eunicefix Makefile + diff --git a/mcon/NOTES b/mcon/NOTES new file mode 100644 index 0000000..b6762e0 --- /dev/null +++ b/mcon/NOTES @@ -0,0 +1,174 @@ +This 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. diff --git a/mcon/README b/mcon/README new file mode 100644 index 0000000..0a6b26e --- /dev/null +++ b/mcon/README @@ -0,0 +1,24 @@ +This 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. diff --git a/mcon/U/AAAAA.U b/mcon/U/AAAAA.U new file mode 100644 index 0000000..bdcb211 --- /dev/null +++ b/mcon/U/AAAAA.U @@ -0,0 +1,46 @@ +?RCS: $Id: AAAAA.U,v 3.0.1.4 1994/06/20 06:50:26 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: AAAAA.U,v $ +?RCS: Revision 3.0.1.4 1994/06/20 06:50:26 ram +?RCS: patch30: changes from Jarkko Hietaniemi are tagged with JHI +?RCS: +?RCS: Revision 3.0.1.3 1994/05/06 14:01:39 ram +?RCS: patch23: initials for Wayne Davison are now WED +?RCS: patch23: added initials for new unit contributor Andy Dougherty +?RCS: +?RCS: Revision 3.0.1.2 1994/01/24 14:01:09 ram +?RCS: patch16: make metalint shut up on special unit definition for All target +?RCS: +?RCS: Revision 3.0.1.1 1993/09/13 15:43:57 ram +?RCS: patch10: documents initials used for Wayne Davison's contributions +?RCS: +?RCS: Revision 3.0 1993/08/18 12:04:44 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?X: +?X: The purpose of this file is to supply the head of the Makefile created +?X: by metaconfig. For this reason it must be first in alphabetical order. +?X: The leading '+' in front of the unit name is a hint for metalint, since +?X: the use of that special unit name as a "made" unit is legitimate here. +?X: +?MAKE:+All: Finish +?X: +?X: Throughout the units, the following initials are used to identify comments: +?X: +?X: HMS: Harlan Stenn +?X: RAM: Raphael Manfredi +?X: WED: Wayne Davison (was WAD by mistake--RAM) +?X: ADO: Andy Dougherty +?X: JHI: Jarkko Hietaniemi +?X: +?X: Agreed, this is a weird place to document it, but I couldn't find a better +?X: place to do so. I've bet on the curiosity of users, who would probably +?X: want to know what's in this strangely-named file--RAM. diff --git a/mcon/U/Begin.U b/mcon/U/Begin.U new file mode 100644 index 0000000..99d968d --- /dev/null +++ b/mcon/U/Begin.U @@ -0,0 +1,39 @@ +?RCS: $Id: Begin.U,v 3.0.1.3 1997/02/28 14:56:35 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: Begin.U,v $ +?RCS: Revision 3.0.1.3 1997/02/28 14:56:35 ram +?RCS: patch61: added Extractall dependency +?RCS: +?RCS: Revision 3.0.1.2 1995/01/30 14:25:08 ram +?RCS: patch49: avoid an empty rmlist: systems might choke on it (WED) +?RCS: +?RCS: Revision 3.0.1.1 1994/10/31 09:32:20 ram +?RCS: patch44: created +?RCS: +?X: +?X: This file comes after option processing had been done and after all +?X: the default values have been set up. It marks the beginning of questions. +?X: It is important that Options be listed *after* Myinit to ensure that the +?X: default initializations performed by Init and Myinit will not clobber +?X: any setting done on the command line via -D or -U. +?X: +?MAKE:Begin: Myinit Options package Extractall +?MAKE: -pick add $@ %< +: Eunice requires " " instead of "", can you believe it +echo " " +: Here we go... +echo "Beginning of configuration questions for $package." + +?X: Make sure the rm below is given a non-empty list for some systems. +?X: This is run only when within the UU directory, hence we can safely +?X: attempt to rm a non-existent 'X' file... +trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15 + diff --git a/mcon/U/Chk_MANI.U b/mcon/U/Chk_MANI.U new file mode 100644 index 0000000..52fc44c --- /dev/null +++ b/mcon/U/Chk_MANI.U @@ -0,0 +1,84 @@ +?RCS: $Id: Chk_MANI.U,v 3.0.1.2 1997/02/28 14:57:25 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: Chk_MANI.U,v $ +?RCS: Revision 3.0.1.2 1997/02/28 14:57:25 ram +?RCS: patch61: added support for src.U +?RCS: +?RCS: Revision 3.0.1.1 1994/10/31 09:33:14 ram +?RCS: patch44: now lists Begin instead of Myinit in its dependencies +?RCS: patch44: leading comment now explains how this unit is included +?RCS: +?RCS: Revision 3.0 1993/08/18 12:04:45 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?X: +?X: This unit checks the package by making sure every file listed in MANIFEST +?X: is present. It is systematically "included" via the Finish unit (which +?X: is always present in every Configure script), although it may result in +?X: an empty inclusion when no MANIFEST is present. +?X: +?MAKE:Chk_MANI: Begin c n rsrc +?MAKE: -pick wipe $@ %< +?T:filelist ans tmppwd +?X: This check happens at metaconfig-time, so it's ok to hard-code the path. +@if {test -f ../MANIFEST} +: 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 +?X: +?X: Files spelled uppercased and beginning with PACK are produced by the +?X: shell archive builder and may be removed by the user. Usually, they are +?X: not listed in the MANIFEST file, but you never know... +?X: + awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | 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 (). + +EOM +?X: Can't use $echo at this early stage + echo $n "Continue? [n] $c" >&4 + read ans + case "$ans" in + y*) + echo "Continuing..." >&4 + rm -f missing + ;; + *) +?X: +?X: Use kill and not exit, so that the trap gets executed to clean up +?X: + 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?? + +@end diff --git a/mcon/U/Chk_whoami.U b/mcon/U/Chk_whoami.U new file mode 100644 index 0000000..272e16b --- /dev/null +++ b/mcon/U/Chk_whoami.U @@ -0,0 +1,25 @@ +?RCS: $Id: Chk_whoami.U,v 3.0 1993/08/18 12:04:46 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: Chk_whoami.U,v $ +?RCS: Revision 3.0 1993/08/18 12:04:46 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?X: +?X: This unit makes sure we don't try to include whoami.h if uname() exists. +?X: +?MAKE:Chk_whoami: d_uname i_whoami +?MAKE: -pick add $@ %< +?LINT:change i_whoami +: weed out incompatibilities +case "$d_uname" in + "$define") i_whoami="$undef" ;; +esac + diff --git a/mcon/U/Config_h.U b/mcon/U/Config_h.U new file mode 100644 index 0000000..9793f61 --- /dev/null +++ b/mcon/U/Config_h.U @@ -0,0 +1,104 @@ +?RCS: $Id: Config_h.U,v 3.0.1.5 1997/02/28 14:57:43 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.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 +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,v 3.0.1.5 1997/02/28 14:57:43 ram Exp $ + */ + +/* + * Package name : $package + * Source directory : $src + * Configuration time: $cf_time + * Configured by : $cf_by + * Target system : $myuname + */ + +#ifndef _config_h_ +#define _config_h_ + diff --git a/mcon/U/Config_sh.U b/mcon/U/Config_sh.U new file mode 100644 index 0000000..3f9316c --- /dev/null +++ b/mcon/U/Config_sh.U @@ -0,0 +1,91 @@ +?RCS: $Id: Config_sh.U,v 3.0.1.3 1997/02/28 14:57:53 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: Config_sh.U,v $ +?RCS: Revision 3.0.1.3 1997/02/28 14:57:53 ram +?RCS: patch61: added support for src.U +?RCS: +?RCS: Revision 3.0.1.2 1995/01/11 14:53:31 ram +?RCS: patch45: moved path stripping from d_portable.U to end of Configure +?RCS: +?RCS: Revision 3.0.1.1 1994/10/29 15:50:37 ram +?RCS: patch36: added ?F: line for metalint file checking +?RCS: +?RCS: Revision 3.0 1993/08/18 12:04:48 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?X: +?X: This unit ends up producing the config.sh script, which contains all the +?X: definitions figured out by Configure. The add.Config_sh command knows +?X: which variables need to be remembered. It also adds the EOT (ends the +?X: here document redirection with variable substitution). +?X: +?MAKE:Config_sh: cf_time cf_by test spitshell startsh myuname Myread \ + End Obsol_sh Loc +d_portable package src +?MAKE: -pick add.Config_sh $@ %< +?MAKE: -pick add $@ ./Obsol_sh +?MAKE: -pick close.Config_sh $@ %< +?F:!config.over +?T:file +: back to where it started +if test -d ../UU; then + cd .. +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 + +@if d_portable +: in case they want portability, strip down executable paths +?X: +?X: Strip down paths in located executables. For each file, e.g. vi, there +?X: is a $vi variable whose value is for instance '/usr/bin/vi'. By resetting +?X: $vi to 'vi', we rely on the PATH variable to locate the executable... +?X: +case "$d_portable" in +"$define") + echo " " + echo "Stripping down executable paths..." >&4 + for file in $loclist $trylist; do + eval $file="\$file" + done + ;; +esac + +@end +: 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 + diff --git a/mcon/U/Configdir.U b/mcon/U/Configdir.U new file mode 100644 index 0000000..ceed327 --- /dev/null +++ b/mcon/U/Configdir.U @@ -0,0 +1,28 @@ +?RCS: $Id: Configdir.U,v 3.0.1.1 1997/02/28 14:58:36 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: Configdir.U,v $ +?RCS: Revision 3.0.1.1 1997/02/28 14:58:36 ram +?RCS: patch61: have README explicitely mention the package name +?RCS: +?RCS: Revision 3.0 1993/08/18 12:04:49 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?MAKE:Configdir: package +?MAKE: -pick add $@ %< +: create .config dir to save info across Configure sessions +test -d ../.config || mkdir ../.config +cat >../.config/README < -- RAM, 06/06/94 +?X: +?INIT:: list of known cpp symbols, sorted alphabetically +?INIT:al="AMIX BIT_MSF BSD BSD4_3 BSD_NET2 CMU CRAY DGUX DOLPHIN DPX2" +?INIT:al="$al GO32 GOULD_PN HP700 I386 I80960 I960 Lynx M68000 M68K MACH" +?INIT:al="$al MIPSEB MIPSEL MSDOS MTXINU MULTIMAX MVS" +?INIT:al="$al M_COFF M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM" +?INIT:al="$al M_SYS3 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX" +?INIT:al="$al NeXT OCS88 OSF1 PARISC PC532 PORTAR POSIX" +?INIT:al="$al PWB R3000 RES RISC6000 RT Sun386i SVR3 SVR4" +?INIT:al="$al SYSTYPE_BSD SYSTYPE_SVR4 SYSTYPE_SYSV Tek4132 Tek4300" +?INIT:al="$al UMAXV USGr4 USGr4_2 UTEK UTS UTek UnicomPBB UnicomPBD Utek" +?INIT:al="$al VMS Xenix286" +?INIT:al="$al _AIX _AIX32 _AIX370 _AM29000 _COFF _CRAY _CX_UX _EPI" +?INIT:al="$al _IBMESA _IBMR2 _M88K _M88KBCS_TARGET" +?INIT:al="$al _MIPSEB _MIPSEL _M_COFF _M_I86 _M_I86SM _M_SYS3" +?INIT:al="$al _M_SYS5 _M_SYSIII _M_SYSV _M_UNIX _M_XENIX _NLS _PGC_ _R3000" +?INIT:al="$al _SYSTYPE_BSD _SYSTYPE_BSD43 _SYSTYPE_SVR4" +?INIT:al="$al _SYSTYPE_SYSV _SYSV3 _U370 _UNICOS" +?INIT:al="$al __386BSD__ __BIG_ENDIAN __BIG_ENDIAN__ __BSD_4_4__" +?INIT:al="$al __DGUX__ __DPX2__ __H3050R __H3050RX" +?INIT:al="$al __LITTLE_ENDIAN __LITTLE_ENDIAN__ __MACH__" +?INIT:al="$al __MIPSEB __MIPSEB__ __MIPSEL __MIPSEL__" +?INIT:al="$al __Next__ __OSF1__ __PARAGON__ __PGC__ __PWB __STDC__" +?INIT:al="$al __SVR4_2__ __UMAXV__" +?INIT:al="$al ____386BSD____ __alpha __alpha__ __amiga" +?INIT:al="$al __bsd4_2 __bsd4_2__ __bsdi__ __convex__" +?INIT:al="$al __host_mips__" +?INIT:al="$al __hp9000s200 __hp9000s300 __hp9000s400 __hp9000s500" +?INIT:al="$al __hp9000s500 __hp9000s700 __hp9000s800" +?INIT:al="$al __hppa __hpux __hp_osf __i286 __i286__ __i386 __i386__" +?INIT:al="$al __i486 __i486__ __i860 __i860__ __ibmesa __ksr1__ __linux__" +?INIT:al="$al __m68k __m68k__ __m88100__ __m88k __m88k__" +?INIT:al="$al __mc68000 __mc68000__ __mc68020 __mc68020__" +?INIT:al="$al __mc68030 __mc68030__ __mc68040 __mc68040__" +?INIT:al="$al __mc88100 __mc88100__ __mips __mips__" +?INIT:al="$al __motorola__ __osf__ __pa_risc __sparc__ __stdc__" +?INIT:al="$al __sun __sun__ __svr3__ __svr4__ __ultrix __ultrix__" +?INIT:al="$al __unix __unix__ __uxpm__ __uxps__ __vax __vax__" +?INIT:al="$al _host_mips _mips _unix" +?INIT:al="$al a29k aegis aix aixpc alliant alpha am29000 amiga ansi ardent" +?INIT:al="$al apollo ardent att386 att3b" +?INIT:al="$al bsd bsd43 bsd4_2 bsd4_3 bsd4_4 bsdi bull" +?INIT:al="$al cadmus clipper concurrent convex cray ctix" +?INIT:al="$al dmert encore gcos gcx gimpel gould" +?INIT:al="$al hbullx20 hcx host_mips hp200 hp300 hp700 hp800" +?INIT:al="$al hp9000 hp9000s300 hp9000s400 hp9000s500" +?INIT:al="$al hp9000s700 hp9000s800 hp9k8 hppa hpux" +?INIT:al="$al i186 i286 i386 i486 i8086" +?INIT:al="$al i80960 i860 iAPX286 ibm ibm032 ibmrt interdata is68k" +?INIT:al="$al ksr1 linux luna luna88k m68k m88100 m88k" +?INIT:al="$al mc300 mc500 mc68000 mc68010 mc68020 mc68030" +?INIT:al="$al mc68040 mc68060 mc68k mc68k32 mc700" +?INIT:al="$al mc88000 mc88100 merlin mert mips mvs n16" +?INIT:al="$al ncl_el ncl_mr" +?INIT:al="$al news1500 news1700 news1800 news1900 news3700" +?INIT:al="$al news700 news800 news900 ns16000 ns32000" +?INIT:al="$al ns32016 ns32332 ns32k nsc32000 os osf" +?INIT:al="$al parisc pc532 pdp11 plexus posix pyr" +?INIT:al="$al riscix riscos scs sequent sgi sinix sony sony_news" +?INIT:al="$al sonyrisc sparc sparclite spectrum stardent stratos" +?INIT:al="$al sun sun3 sun386 svr4 sysV68 sysV88" +?INIT:al="$al titan tower tower32 tower32_200 tower32_600 tower32_700" +?INIT:al="$al tower32_800 tower32_850 tss u370 u3b u3b2 u3b20 u3b200" +?INIT:al="$al u3b20d u3b5 ultrix unix unixpc unos vax venix vms" +?INIT:al="$al xenix z8000" +?INIT: +: get C preprocessor symbols handy +echo " " +$echo $n "Hmm... $c" +?X: The following used to be tr '[ - ]' ... but this was rejected by AIX 3.2 +?X: since the endpoints where the same (from patch 12u8 to patch). +echo $al | $tr ' ' '\012' >Cppsym.know +$cat <Cppsym +$startsh +case "\$1" in +-l) list=true + shift + ;; +esac +unknown='' +case "\$list\$#" in +1|2) + for sym do + if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then + exit 0 + elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then + : + else + unknown="\$unknown \$sym" + fi + done + set X \$unknown + shift + ;; +esac +case \$# in +0) exit 1;; +esac +echo \$* | $tr ' ' '\012' | $sed -e 's/\(.*\)/\\ +#ifdef \1\\ +exit 0; _ _ _ _\1\\ \1\\ +#endif\\ +/' >Cppsym\$\$ +echo "exit 1; _ _ _" >>Cppsym\$\$ +$cppstdin $cppminus Cppsym2\$\$ +case "\$list" in +true) $awk 'NF > 5 {print substr(\$6,2,100)}' Cppsym.true + +: now check the C compiler for additional symbols +?X: suggested by Jarkko Hietaniemi , thanks! +$cat >ccsym <tmp.c <&1\` +do + case "\$i" in + -D*) echo "\$i" | $sed 's/^-D//';; + -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';; + esac +done +$rm -f try.c +EOS +chmod +x ccsym +$eunicefix ccsym +./ccsym | $sort | $uniq >ccsym.raw +?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"=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='' +symbols='symbols' +if $test -z ccsym.raw; then + echo "Your C compiler doesn't seem to define any symbol!" >&4 + echo " " + echo "However, your C preprocessor defines the following ones:" + $cat Cppsym.true +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' + $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 ' + $test "$silent" || sleep 1 + fi + if $test -s ccsym.own; then + $test "$also" && echo " " + echo "Your C compiler ${also}defines the following cpp variables:" + $sed -e 's/\(.*\)=1/\1/' ccsym.own + $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true + $test "$silent" || sleep 1 + fi +fi +$rm -f ccsym* + diff --git a/mcon/U/Csym.U b/mcon/U/Csym.U new file mode 100644 index 0000000..0b0bd2c --- /dev/null +++ b/mcon/U/Csym.U @@ -0,0 +1,96 @@ +?RCS: $Id: Csym.U,v 3.0.1.4 1995/07/25 13:36:29 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.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: Put symbol inside a printf to fool optimizing compilers... +?X: +?X: We use 'short' 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 'short' 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 'short' +?X: trick is obsoleted by future gcc releases). -- RAM +?X: + echo "main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > 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"' + diff --git a/mcon/U/End.U b/mcon/U/End.U new file mode 100644 index 0000000..2de82eb --- /dev/null +++ b/mcon/U/End.U @@ -0,0 +1,28 @@ +?RCS: $Id: End.U,v 3.0 1993/08/18 12:04:51 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.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." +echo " " + diff --git a/mcon/U/Extract.U b/mcon/U/Extract.U new file mode 100644 index 0000000..d4a8f55 --- /dev/null +++ b/mcon/U/Extract.U @@ -0,0 +1,119 @@ +?RCS: $Id: Extract.U,v 3.0.1.2 1997/02/28 14:58:52 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: Extract.U,v $ +?RCS: Revision 3.0.1.2 1997/02/28 14:58:52 ram +?RCS: patch61: added support for src.U +?RCS: +?RCS: Revision 3.0.1.1 1994/10/29 15:51:46 ram +?RCS: patch36: added ?F: line for metalint file checking +?RCS: +?RCS: Revision 3.0 1993/08/18 12:04:52 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?X: +?X: This unit produces a shell script which can be doted in order to extract +?X: .SH files with variable substitutions. +?X: +?X: When running Configure from a remote directory ($src is not '.'), +?X: then the files will be created in that directory, so beware! +?X: +?MAKE:Extract: src +?MAKE: -pick add $@ %< +?F:./extract +?T:CONFIG dir file name create mkdir_p +: script used to extract .SH files with variable substitutions +cat >extract <<'EOS' +CONFIG=true +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 +?X: script to emulate mkdir -p +mkdir_p=' +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 +' +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 + ;; + *) +?X: +?X: When running Configure remotely ($src is not '.'), we cannot source +?X: the files directly, since that would wrongly cause the extraction +?X: where the source lie instead of withing the current directory. Therefore, +?X: we need to 'sh src -> Options -> Extract +?X: The Begin.U unit now requires us before beginning to do anything +?X: interesting, to ensure proper semantics. -- RAM, 15/03/96 +?X: +?MAKE:Extractall: Extract Options rsrc +?MAKE: -pick wipe $@ %< +?T:config +: extract files and exit if asked to do so +case "$extractsh" in +true) +?X: Undo the forced silent=true when -S was supplied, by probing realsilent +?X: which was set iff -s was also given. See Options.U for details. + case "$realsilent" in + true) ;; + *) exec 1>&4;; + esac + case "$config_sh" in + '') config_sh='config.sh'; config="$rsrc/config.sh";; + /*) config="$config_sh";; + *) config="$rsrc/$config_sh";; + esac + echo " " + echo "Fetching answers from $config_sh..." + . $config + test "$override" && . ./optdef.sh + echo " " +?X: extract has to be run from the top directory, not within UU. + cd .. + . UU/extract + rm -rf UU + echo "Done." + exit 0 + ;; +esac + diff --git a/mcon/U/Filexp.U b/mcon/U/Filexp.U new file mode 100644 index 0000000..9713a87 --- /dev/null +++ b/mcon/U/Filexp.U @@ -0,0 +1,69 @@ +?RCS: $Id: Filexp.U,v 3.0.1.2 1994/10/29 15:52:53 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: Filexp.U,v $ +?RCS: Revision 3.0.1.2 1994/10/29 15:52:53 ram +?RCS: patch36: added ?F: line for metalint file checking +?RCS: patch36: added HOME to the ?T: line since metalint now checks ${HOME} +?RCS: +?RCS: Revision 3.0.1.1 1994/05/06 14:03:00 ram +?RCS: patch23: made sure error status from csh is propagated (WED) +?RCS: +?RCS: Revision 3.0 1993/08/18 12:04:53 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?X: +?X: This unit produces a shell script which will expand filenames beginning +?X: with tildes. The script is deleted at the end of Configure. +?X: +?MAKE:Filexp: startsh sed test expr eunicefix +?MAKE: -pick add $@ %< +?F:./filexp +?T:HOME LOGDIR dir me name failed +: 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 + diff --git a/mcon/U/Findhdr.U b/mcon/U/Findhdr.U new file mode 100644 index 0000000..48d4d75 --- /dev/null +++ b/mcon/U/Findhdr.U @@ -0,0 +1,106 @@ +?RCS: $Id: Findhdr.U,v 3.0.1.2 1994/10/29 15:53:08 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: Original Author: Thomas Neumann +?RCS: +?RCS: $Log: Findhdr.U,v $ +?RCS: Revision 3.0.1.2 1994/10/29 15:53:08 ram +?RCS: patch36: added ?F: line for metalint file checking +?RCS: +?RCS: Revision 3.0.1.1 1994/05/06 14:03:56 ram +?RCS: patch23: cppminus must be after other cppflags, not before +?RCS: +?RCS: Revision 3.0 1993/08/18 12:04:54 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?X: +?X: This unit produces a findhdr script which is used to locate the header +?X: files in $usrinc or other stranger places using cpp capabilities. The +?X: script is given an include file base name, like 'stdio.h' or 'sys/file.h' +?X: and it returns the full path of the include file and a zero status or an +?X: empty string with an error status if the file could not be located. +?X: +?MAKE:Findhdr: grep test tr rm +usrinc awk cat startsh \ + cppstdin cppminus +cppflags +?MAKE: -pick add $@ %< +?LINT:define fieldn +?S:fieldn: +?S: This variable is used internally by Configure. It contains the position +?S: of the included file name in cpp output. That is to say, when cpp +?S: pre-processes a #include line, it replaces it by a # line which +?S: contains the original position in the input file and the full name of +?S: included file, between "quotes". +?S:. +?V:fieldn +?F:./findhdr !fieldn +?T:cline pos wanted name awkprg +: determine filename position in cpp output +echo " " +echo "Computing filename position in cpp output for #include directives..." >&4 +echo '#include ' > foo.c +$cat >fieldn </dev/null | \ +$grep '^[ ]*#.*stdio\.h' | \ +while read cline; do + pos=1 + set \$cline + while $test \$# -gt 0; do + if $test -r \`echo \$1 | $tr -d '"'\`; then + echo "\$pos" + exit 0 + fi + shift + pos=\`expr \$pos + 1\` + done +done +EOF +chmod +x fieldn +fieldn=`./fieldn` +$rm -f foo.c fieldn +case $fieldn in +'') pos='???';; +1) pos=first;; +2) pos=second;; +3) pos=third;; +*) pos="${fieldn}th";; +esac +echo "Your cpp writes the filename in the $pos field of the line." + +?X: To locate a header file, we cannot simply check for $usrinc/file.h, since +?X: some machine have the headers in weird places and our only hope is that +?X: the C pre-processor will know how to find those headers. Thank you NexT! +: locate header file +$cat >findhdr <" > foo\$\$.c +$cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \ +$grep "^[ ]*#.*\$wanted" | \ +while read cline; do + name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\` + case "\$name" in + */\$wanted) echo "\$name"; exit 0;; + *) name='';; + esac; +done; +$rm -f foo\$\$.c; +case "\$name" in +'') exit 1;; +esac +EOF +chmod +x findhdr + diff --git a/mcon/U/Finish.U b/mcon/U/Finish.U new file mode 100644 index 0000000..9aedfdc --- /dev/null +++ b/mcon/U/Finish.U @@ -0,0 +1,122 @@ +?RCS: $Id: Finish.U,v 3.0.1.6 1995/02/15 14:09:30 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: Finish.U,v $ +?RCS: Revision 3.0.1.6 1995/02/15 14:09:30 ram +?RCS: patch51: now clearer about how to edit config.sh at the prompt (WED) +?RCS: +?RCS: Revision 3.0.1.5 1994/10/29 15:53:14 ram +?RCS: patch36: added ?F: line for metalint file checking +?RCS: +?RCS: Revision 3.0.1.4 1994/05/06 14:19:37 ram +?RCS: patch23: added blank lines around 'End of Configure' +?RCS: +?RCS: Revision 3.0.1.3 1993/10/16 13:46:09 ram +?RCS: patch12: replaced Config_h by Magic_h in the dependency line +?RCS: +?RCS: Revision 3.0.1.2 1993/09/13 15:45:26 ram +?RCS: patch10: fixed shell evaluation w/o shell escape while in silent mode +?RCS: +?RCS: Revision 3.0.1.1 1993/08/30 08:55:59 ram +?RCS: patch8: prevents myread from blocking on empty answers, exceptionally +?RCS: +?RCS: Revision 3.0 1993/08/18 12:04:55 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?X: +?X: This unit is the very last one in the Configure script. It runs all the +?X: SH files, which among other things produce config.h and (usually) Makefile. +?X: It offers to do a make depend if the Makefile contains that target. +?X: +?MAKE:Finish: Chk_MANI Extract Myread Oldsym Magic_h cat rm contains +?MAKE: -pick add $@ %< +?F:!config.sh +: Finish up by extracting the .SH files +case "$alldone" in +exit) + $rm -rf UU + echo "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 + +?X: +?X: Turn silent mode off from now on (we want a verbose file extraction). +?X: This means we have to explicitely test for '$silent' from now on to +?X: strip off any verbose messages. +?X: +echo " " +exec 1>&4 +. ./UU/extract + +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 a 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 "Done." +fi + +?X: +?X: kit*isdone files are left over by shell archives built using the makedist +?X: script which comes from dist, while ark*isdone files are left over by +?X: the cshar archive maker. +?X: +$rm -f kit*isdone ark*isdone +$rm -rf UU + +: End of Configure + diff --git a/mcon/U/Getfile.U b/mcon/U/Getfile.U new file mode 100644 index 0000000..787a62c --- /dev/null +++ b/mcon/U/Getfile.U @@ -0,0 +1,305 @@ +?RCS: $Id: Getfile.U,v 3.0.1.7 1997/02/28 15:01:06 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: Getfile.U,v $ +?RCS: Revision 3.0.1.7 1997/02/28 15:01:06 ram +?RCS: patch61: getfile script now begins with "startsh" +?RCS: +?RCS: Revision 3.0.1.6 1995/02/15 14:11:00 ram +?RCS: patch51: was not working if ~'s allowed with d_portable on (WED) +?RCS: +?RCS: Revision 3.0.1.5 1995/01/11 15:11:25 ram +?RCS: patch45: added support for escaping answers to skip various checks +?RCS: patch45: modified message issued after file expansion +?RCS: +?RCS: Revision 3.0.1.4 1994/10/29 15:53:19 ram +?RCS: patch36: added ?F: line for metalint file checking +?RCS: +?RCS: Revision 3.0.1.3 1994/05/06 14:23:36 ram +?RCS: patch23: getfile could be confused by file name in "locate" requests +?RCS: patch23: new 'p' directive to assume file is in people's path (WED) +?RCS: +?RCS: Revision 3.0.1.2 1994/01/24 14:01:31 ram +?RCS: patch16: added metalint hint on changed 'ans' variable +?RCS: +?RCS: Revision 3.0.1.1 1993/09/13 15:46:27 ram +?RCS: patch10: minor format problems and misspellings fixed +?RCS: patch10: now performs from package dir and not from UU subdir +?RCS: +?RCS: Revision 3.0 1993/08/18 12:04:56 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?X: +?X: This unit produces a bit of shell code that must be dotted in in order +?X: to get a file name and make some sanity checks. Optionally, a ~name +?X: expansion is performed. +?X: +?X: To use this unit, $rp and $dflt must hold the question and the +?X: default answer, which will be passed as-is to the myread script. +?X: The $fn variable must hold the file type (f or d, for file/directory). +?X: +?X: If is is followed by a ~, then ~name substitution will occur. Upon return, +?X: $ans is set with the filename value. If a / is specified, then only a full +?X: path name is accepted (but ~ substitution occurs before, if needed). The +?X: expanded path name is returned in that case. +?X: +?X: If a + is specified, the existence checks are skipped. This usually means +?X: the file/directory is under the full control of the program. +?X: +?X: If the 'n' (none) type is used, then the user may answer none. +?X: The 'e' (expand) switch may be used to bypass d_portable, expanding ~name. +?X: +?X: If the 'l' (locate) type is used, then it must end with a ':' and then a +?X: file name. If the answer is a directory, the file name will be appended +?X: before testing for file existence. This is useful in locate-style +?X: questions like "where is the active file?". In that case, one should +?X: use: +?X: +?X: dflt='~news/lib' +?X: fn='l~:active' +?X: rp='Where is the active file?' +?X: . ./getfile +?X: active="$ans" +?X: +?X: If the 'p' (path) letter is specified along with 'l', then an answer +?X: without a leading / will be expected to be found in everyone's path. +?X: +?X: It is also possible to include a comma-separated list of items within +?X: parentheses to specify which items should be accepted as-is with no +?X: further checks. This is useful when for instance a full path is expected +?X: but the user may escape out via "magical" answers. +?X: +?X: If the answer to the question is 'none', then the existence checks are +?X: skipped and the empty string is returned. +?X: +?MAKE:Getfile: d_portable contains startsh Myread Filexp +?MAKE: -pick add $@ %< +?V:ansexp:fn +?F:./getfile +?T:tilde type what orig_rp orig_dflt fullpath already redo skip none_ok \ + value exp_file nopath_ok loc_file +?LINT:change ans +: 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" + +?X: Begin by stripping out any (...) grouping. +case "$fn" in +*\(*) + expr $fn : '.*(\(.*\)).*' | tr ',' '\012' >getfile.ok + fn=`echo $fn | sed 's/(.*)//'` + ;; +esac + +?X: Catch up 'locate' requests early, so that we may strip the file name +?X: before looking at the one-letter commands, in case the file name contains +?X: one of them. Reported by Wayne Davison . +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 +?X: check for allowed escape sequence which may be accepted verbatim. + 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) +?X: Perform all the checks on ansexp and not value since when d_portable +?X: is defined, the original un-expanded answer which is stored in value +?X: would lead to "non-existent" error messages whilst ansexp has been +?X: properly expanded. -- Fixed by Jan.Djarv@sa.erisoft.se (Jan Djarv) +?X: Always expand ~user if '/' was requested + case "$ansexp" in + /*) 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) + if test -f "$ansexp"; then + type='' + elif test -r "$ansexp" || (test -h "$ansexp") >/dev/null 2>&1 + then + echo "($value is not a plain file, but that's ok.)" + type='' + fi + ;; + Directory) + if test -d "$ansexp"; then + type='' + fi + ;; + 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 +EOSC + diff --git a/mcon/U/Guess.U b/mcon/U/Guess.U new file mode 100644 index 0000000..faa4ea2 --- /dev/null +++ b/mcon/U/Guess.U @@ -0,0 +1,171 @@ +?RCS: $Id: Guess.U,v 3.0.1.5 1995/07/25 13:37:14 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: Guess.U,v $ +?RCS: Revision 3.0.1.5 1995/07/25 13:37:14 ram +?RCS: patch56: now knows about OS/2 platforms +?RCS: +?RCS: Revision 3.0.1.4 1994/10/29 15:53:55 ram +?RCS: patch36: added ?F: line for metalint file checking +?RCS: patch36: call ./xenix explicitely instead of relying on PATH +?RCS: +?RCS: Revision 3.0.1.3 1993/12/15 08:14:35 ram +?RCS: patch15: variable d_bsd was not always set properly +?RCS: +?RCS: Revision 3.0.1.2 1993/08/30 08:57:14 ram +?RCS: patch8: fixed comment which wrongly attributed the usrinc symbol +?RCS: patch8: no more ugly messages when no /usr/include/ctype.h +?RCS: +?RCS: Revision 3.0.1.1 1993/08/27 14:37:37 ram +?RCS: patch7: added support for OSF/1 machines +?RCS: +?RCS: Revision 3.0 1993/08/18 12:04:57 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?X: +?X: This unit hazards some guesses as to what the general nature of the system +?X: is. The information it collects here is used primarily to establish default +?X: answers to other questions. +?X: +?MAKE:Guess d_eunice d_xenix d_bsd: cat test echo n c contains rm Loc eunicefix +?MAKE: -pick add $@ %< +?S:d_eunice: +?S: This variable conditionally defines the symbols EUNICE and VAX, which +?S: alerts the C program that it must deal with ideosyncracies of VMS. +?S:. +?S:d_xenix: +?S: This variable conditionally defines the symbol XENIX, which alerts +?S: the C program that it runs under Xenix. +?S:. +?S:d_bsd: +?S: This symbol conditionally defines the symbol BSD when running on a +?S: BSD system. +?S:. +?C:EUNICE: +?C: This symbol, if defined, indicates that the program is being compiled +?C: under the EUNICE package under VMS. The program will need to handle +?C: things like files that don't go away the first time you unlink them, +?C: due to version numbering. It will also need to compensate for lack +?C: of a respectable link() command. +?C:. +?C:VMS: +?C: This symbol, if defined, indicates that the program is running under +?C: VMS. It is currently only set in conjunction with the EUNICE symbol. +?C:. +?C:XENIX: +?C: This symbol, if defined, indicates thet the program is running under +?C: Xenix (at least 3.0 ?). +?C:. +?C:BSD: +?C: This symbol, if defined, indicates that the program is running under +?C: a BSD system. +?C:. +?H:#$d_eunice EUNICE /**/ +?H:#$d_eunice VMS /**/ +?H:#$d_xenix XENIX /**/ +?H:#$d_bsd BSD /**/ +?H:. +?F:./bsd ./usg ./v7 ./osf1 ./eunice ./xenix ./venix ./os2 +?T:xxx +: make some quick guesses about what we are up against +echo " " +$echo $n "Hmm... $c" +echo exit 1 >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 +d_bsd="$undef" +?X: +?X: Do not use 'usrinc', or we get a circular dependency. because +?X: usrinc is defined in usrinc.U, which relies on us... +?X: +$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 +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... +lemme think...does HAL ring a bell?...no, of course, you're only running OS/2! +EOI + echo exit 0 >os2 + ;; +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 os2 +$eunicefix bsd usg v7 osf1 eunice xenix venix os2 +$rm -f foo + diff --git a/mcon/U/Head.U b/mcon/U/Head.U new file mode 100644 index 0000000..cdffded --- /dev/null +++ b/mcon/U/Head.U @@ -0,0 +1,246 @@ +?RCS: $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: Head.U,v $ +?RCS: Revision 3.0.1.9 1997/02/28 15:02:09 ram +?RCS: patch61: make sure we unset CDPATH for shells that support this +?RCS: patch61: improved Korn shell detection and handling +?RCS: +?RCS: Revision 3.0.1.8 1995/07/25 13:40:02 ram +?RCS: patch56: added SVR4-ish /opt directories to path list (ADO) +?RCS: patch56: OS/2 platforms are using another path separator +?RCS: +?RCS: Revision 3.0.1.7 1995/03/21 08:46:15 ram +?RCS: patch52: definition of paths wrongly added spurious ':' chars +?RCS: +?RCS: Revision 3.0.1.6 1994/10/29 15:54:19 ram +?RCS: patch36: make sure ENV is unset before calling /bin/ksh +?RCS: +?RCS: Revision 3.0.1.5 1994/08/29 16:03:44 ram +?RCS: patch32: now sets PATH only using existing directories +?RCS: +?RCS: Revision 3.0.1.4 1994/06/20 06:54:28 ram +?RCS: patch30: now computes its invocation name into 'me' +?RCS: patch30: symbol me is made visible to all units read-only +?RCS: +?RCS: Revision 3.0.1.3 1993/12/15 08:15:07 ram +?RCS: patch15: added /sbin:/usr/sbin:/usr/libexec in PATH for BSD/386 +?RCS: +?RCS: Revision 3.0.1.2 1993/11/10 17:32:35 ram +?RCS: patch14: ensure PATH is reset to '.' before testing for alias +?RCS: +?RCS: Revision 3.0.1.1 1993/08/27 14:38:07 ram +?RCS: patch7: not all 'test' programs support the -x option +?RCS: +?RCS: Revision 3.0 1993/08/18 12:04:58 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?X: +?X: This is the very first unit in the Configure script. It is mostly just +?X: things to keep people from getting into a tizzy right off the bat. +?X: +?MAKE:Head: +?MAKE: -pick wipe $@ %< +?V:PATH p_ me +?T:argv Id p paths OS2_SHELL +?T:inksh needksh avoidksh newsh changesh reason +#! /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.) +# +?X: +?X: NOTE THAT A CONFIGURE SCRIPT IS IN THE PUBLIC DOMAIN (whether or not +?X: the software which uses it is in the public domain). +?X: +# Yes, you may rip this off to use in other distribution packages. This +# script belongs to the public domain and cannot be copyrighted. +# +?X: +?X: WE ASK YOU NOT TO REMOVE OR ALTER THE FOLLOWING PARAGRAPH, PLEASE: +?X: +# (Note: this Configure script was generated automatically. Rather than +# working with this copy of Configure, you may wish to get metaconfig. +# The dist-3.0 package (which contains metaconfig) was posted in +# comp.sources.misc and is available on CPAN under authors/id/RAM so +# you may fetch it yourself from your nearest archive site.) +# +?X: +?X: NOTA BENE: +?X: If you develop you own version of metaconfig based on this work, +?X: you have to add some comments telling that the script was generated +?X: by your version, not mine: It credits your work. +?X: + +# $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $ +# +# Generated on [metaconfig PL] + +cat >/tmp/c1$$ </tmp/c2$$ </dev/null` + test "$me" || me=$0 + ;; +esac + +?X: +?X: To be able to run under OS/2, we must detect that early enough to use +?X: the proper path separator, stored in $p_. It is : on UNIX and \ on OS/2. +?X: +: Proper PATH separator +p_=: +: On OS/2 this directory should exist if this is not floppy only system :-] +if test -d c:/.; then + p_=\; + PATH=`cmd /c "echo %PATH%" | tr '\\\\' / ` +?X: That's a bug in ksh5.22 + OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'` +fi + +?X: +?X: There are two schools of thoughts here. Some people correctly argue that +?X: the user has a better chance than we do of setting a reasonable PATH and +?X: others argue that Configure is the best place there is to set up a suitable +?X: PATH. Well, here we try to compromize by keeping the user's PATH and +?X: appending some directories which are known to work on some machine or the +?X: other. The rationale behind this being that a novice user might not have a +?X: proper environment variable set, and some directories like /etc (where +?X: chown is located on some BSD systems) may be missing--RAM. +?X: +?X: SVR4 adds an /opt directory for optional packages. Some sites use +?X: various permutations on /opt as opposed to /usr or /usr/local.-- ADO +?X: +?X: We only add directories that are not already in the PATH of the +?X: user and the directories must exist also. +?X: +: 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" + +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='' +?X: Use (alias -x) and not (alias) since zsh and bash recognize the alias +?X: builtin but not the -x option which is typically ksh... +?X: We need to set up PATH before calling the "alias" built-in since some +?X: systems like HP-UX have a binary called /bin/alias. +if (PATH=.; alias -x) >/dev/null 2>&1; then + inksh=true +fi +?X: On HP-UX, large Configure scripts may exercise a bug in /bin/sh, use ksh +if test -f /hp-ux -a -f /bin/ksh; then + needksh='to avoid sh bug in "here document" expansion' +fi +?X: On AIX4, /bin/sh is really ksh and it causes problems, use sh +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 +?X: If we are not in ksh and need it, then feed us back to it +case "$inksh/$needksh" in +/[a-z]*) +?X: Unset ENV to avoid any ~/.kshrc that could alias cd or whatever... + unset ENV + changesh=true + reason="$needksh" + ;; +esac +?X: If we are in ksh and must avoid it, then feed us back to a new shell +case "$inksh/$avoidksh" in +true/[a-z]*) + changesh=true + reason="$avoidksh" + ;; +esac +?X: Warn them if they use ksh on other systems, which are those where +?X: we don't need ksh nor want to avoid it explicitely, yet are using it. +case "$inksh/$needksh-$avoidksh-" in +true/--) + 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 remaining 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 + diff --git a/mcon/U/Loc.U b/mcon/U/Loc.U new file mode 100644 index 0000000..e54b817 --- /dev/null +++ b/mcon/U/Loc.U @@ -0,0 +1,345 @@ +?RCS: $Id: Loc.U,v 3.0.1.10 1997/02/28 15:04:16 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: Loc.U,v $ +?RCS: Revision 3.0.1.10 1997/02/28 15:04:16 ram +?RCS: patch61: allow users to specify paths on the command line +?RCS: patch61: will now substitute cp for ln if not supported +?RCS: +?RCS: Revision 3.0.1.9 1995/09/25 09:11:24 ram +?RCS: patch59: commented the purpose of the #un-def directive +?RCS: patch59: abort Configure run when mandatory command is missing +?RCS: +?RCS: Revision 3.0.1.8 1995/07/25 13:40:40 ram +?RCS: patch56: now knows about OS/2 platforms +?RCS: +?RCS: Revision 3.0.1.7 1995/01/11 15:13:37 ram +?RCS: patch45: protected "sh -c" within backquotes for Linux and SGI +?RCS: patch45: added path lookup for the 'comm' program +?RCS: +?RCS: Revision 3.0.1.6 1994/10/29 15:56:14 ram +?RCS: patch36: added ?F: line for metalint file checking +?RCS: patch36: be careful and guard against wildcard searching (ADO) +?RCS: +?RCS: Revision 3.0.1.5 1994/06/20 06:54:55 ram +?RCS: patch30: now locates find +?RCS: +?RCS: Revision 3.0.1.4 1994/05/13 15:18:15 ram +?RCS: patch27: added byacc to the trylist (ADO) +?RCS: patch27: lint lines reformatted (ADO) +?RCS: +?RCS: Revision 3.0.1.3 1994/01/24 14:01:44 ram +?RCS: patch16: added metalint hint on changed PATH variable +?RCS: +?RCS: Revision 3.0.1.2 1993/12/15 08:16:52 ram +?RCS: patch15: now set _test variable when test is built-in +?RCS: patch15: fixed rare cases where echo is not needed +?RCS: +?RCS: Revision 3.0.1.1 1993/09/13 15:47:13 ram +?RCS: patch10: test program not always in /bin/test (WAD) +?RCS: +?RCS: Revision 3.0 1993/08/18 12:05:05 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?X: +?X: This unit produces a shell script "loc" which can be used to find out +?X: where in a list of directories something is. It then uses loc to +?X: determine the location of commonly used programs. It leaves loc sitting +?X: around for other Configure units to use, but arranges for its demise +?X: at the end of Configure. +?X: +?X: To add a new program to find, add it both to the ?MAKE: line and to either +?X: the loclist or trylist variable. +?X: +?X: I put startsh at the end of the dependency list, in order to avoid the +?X: loading of the spitshell unit before the instructions. +?X: +?MAKE:Loc Mcc awk ar bash bison byacc cat chgrp chmod chown \ + comm compress cp cpio cpp csh date echo egrep emacs expr find flex \ + gcc gzip grep inews ksh less line lint ln lp lpr ls mail mailx \ + make mkdir more mv nroff perl pg pmake pr rm rmail sed sendmail \ + shar sleep smail sort submit tail tar tbl test touch tr troff \ + uname uniq uuname vi zcat zip: eunicefix n c Instruct Myread \ + startsh +?MAKE: -pick weed $@ %< +?LINT:describe Loc Mcc awk ar bash bison byacc cat chgrp chmod chown \ + comm compress cp cpio cpp csh date echo egrep emacs expr find flex \ + gcc gzip grep inews ksh less line lint ln lp lpr ls mail mailx \ + make mkdir more mv nroff perl pg pmake pr rm rmail sed sendmail \ + shar sleep smail sort submit tail tar tbl test touch tr troff \ + uname uniq uuname vi zcat zip +?V::pth loclist trylist +?F:./loc +?T:thisthing thing xxx dir file say _test +?LINT:change PATH +: 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 + ;; + *) +?X: Be careful in case thing includes wildcards that might expand to multiple +?X: files. Choose the last one. This happens when searching for shared +?X: libraries with version numbers. How to choose which one we want is +?X: probably an insoluble problem, in general. +?X: Some folks leave things like libc.so.orig around w/o read +?X: permission. A -r test would handle that, but since ./loc is +?X: also used to find executables (which are installed w/o read +?X: permission on SCO ODT 3.0, we can't include the -r test. + 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 \$dir/\$thing.exe; then + : on Eunice apparently + echo \$dir/\$thing + exit 0 + fi + ;; + esac +done +echo \$dflt +exit 1 +EOSC +chmod +x loc +$eunicefix loc +loclist=" +?awk:awk +?cat:cat +?chgrp:chgrp +?chmod:chmod +?chown:chown +?comm:comm +?cp:cp +?echo:echo +?expr:expr +?find:find +?grep:grep +?ls:ls +?make:make +?mkdir:mkdir +?mv:mv +?rm:rm +?sed:sed +?sleep:sleep +?sort:sort +?tail:tail +?touch:touch +?tr:tr +?uniq:uniq +" +trylist=" +?Mcc:Mcc +?ar:ar +?bash:bash +?bison:bison +?byacc:byacc +?compress:compress +?cpio:cpio +?cpp:cpp +?csh:csh +?date:date +?egrep:egrep +?emacs:emacs +?flex:flex +?gcc:gcc +?gzip:gzip +?inews:inews +?ksh:ksh +?less:less +?line:line +?lint:lint +?ln:ln +?lp:lp +?lpr:lpr +?mail:mail +?mailx:mailx +?more:more +?nroff:nroff +?perl:perl +?pg:pg +?pmake:pmake +?pr:pr +?rmail:rmail +?sendmail:sendmail +?shar:shar +?smail:smail +?submit:submit +?tar:tar +?tbl:tbl +?test:test +?troff:troff +?uname:uname +?uuname:uuname +?vi:vi +?zcat:zcat +?zip:zip +" +?LINT:set Loc Mcc awk ar bash bison byacc cat chgrp chmod chown \ + comm compress cp cpio cpp csh date echo egrep emacs expr find flex \ + gcc gzip grep inews ksh less line lint ln lp lpr ls mail mailx \ + make mkdir more mv nroff perl pg pmake pr rm rmail sed sendmail \ + shar sleep smail sort submit tail tar tbl test touch tr troff \ + uname uniq uuname vi zcat zip +pth=`echo $PATH | sed -e "s/$p_/ /g"` +pth="$pth /lib /usr/lib" +for file in $loclist; do +?X: +?X: Allow them to -Dmake=pmake on the command line for instance... +?X: If the file is not fully qualified, as in -Dmake=pmake, then we +?X: look the for the specified command (pmake here). If they say +?X: -Dmake=/sbin/make for instance, then we make sure the file +?X: exists, or we die... +?X: + eval xxx=\$$file + case "$xxx" in + /*|?:[\\/]*) + if test -f "$xxx"; then + : ok + else + echo "WARNING: no $xxx -- ignoring your setting for $file." >&4 + xxx=`./loc $file $file $pth` + fi + ;; + '') xxx=`./loc $file $file $pth`;; + *) xxx=`./loc $xxx $xxx $pth`;; + esac + eval $file=$xxx + eval _$file=$xxx + case "$xxx" in + /*) + echo $file is in $xxx. + ;; +?X: Under OS/2, we have PC-like paths + ?:[\\/]*) + 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 +?X: Allow them to -Dmake=pmake on the command line for instance (see above) + eval xxx=\$$file + case "$xxx" in + /*|?:[\\/]*) + if test -f "$xxx"; then + : ok + else + echo "WARNING: no $xxx -- ignoring your setting for $file." >&4 + xxx=`./loc $file $file $pth` + fi + ;; + '') xxx=`./loc $file $file $pth`;; + *) xxx=`./loc $xxx $xxx $pth`;; + esac + eval $file=$xxx + eval _$file=$xxx + case "$xxx" in + /*) + echo $file is in $xxx. + ;; +?X: Under OS/2, we have PC-like paths + ?:[\\/]*) + 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 + ;; +esac +@if ln +case "$ln" in +ln) + echo "Substituting cp for ln." + ln=$cp + ;; +esac +@end +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." +?X: +?X: We need to set both test and _test, since Oldconfig.U will use the _test +?X: value to systematically restore computed paths, which may be wrong if +?X: we choose to load an old config.sh generated on another platform. +?X: + test=test + _test=test + fi + ;; +esac +?LINT:change n c +case "$echo" in +echo) + echo "Hopefully echo is built into your sh." + ;; +?X: For those rare cases where we don't need $echo... +'') ;; +*) + 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 + diff --git a/mcon/U/Loc_sed.U b/mcon/U/Loc_sed.U new file mode 100644 index 0000000..e587af6 --- /dev/null +++ b/mcon/U/Loc_sed.U @@ -0,0 +1,34 @@ +?RCS: $Id: Loc_sed.U,v 3.0.1.1 1997/02/28 15:04:22 ram Exp $ +?RCS: +?RCS: Copyright (c) 1996, Andy Dougherty +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?X: This is used in perl.c. +?MAKE:full_sed: sed +?MAKE: -pick add $@ %< +?S:full_sed: +?S: This variable contains the full pathname to 'sed', whether or +?S: not the user has specified 'portability'. This is only used +?S: in the compiled C program, and we assume that all systems which +?S: can share this executable will have the same full pathname to +?S: 'sed.' +?S:. +?X: Yes, I know about the C symbol PORTABLE, but I think sed +?X: is unlikely to move, and I'm too lazy to add all the +?X: #ifdef PORTABLE sections to the perl source. +?X: +?C:LOC_SED: +?C: This symbol holds the complete pathname to the sed program. +?C:. +?H:#define LOC_SED "$full_sed" /**/ +?H:. +?LINT:use sed +: Store the full pathname to the sed program for use in the C program +full_sed=$sed + diff --git a/mcon/U/Magic_h.U b/mcon/U/Magic_h.U new file mode 100644 index 0000000..27f1e19 --- /dev/null +++ b/mcon/U/Magic_h.U @@ -0,0 +1,42 @@ +?RCS: $Id: Magic_h.U,v 3.0.1.2 1993/11/10 17:32:58 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: Magic_h.U,v $ +?RCS: Revision 3.0.1.2 1993/11/10 17:32:58 ram +?RCS: patch14: forgot to mention Id in the dependencies +?RCS: +?RCS: Revision 3.0.1.1 1993/10/16 13:46:59 ram +?RCS: patch12: created for ?M: lines support (magic symbols) +?RCS: +?X: +?X: This file ends up producing the confmagic.h include, which is used to +?X: automagically remap some C symbols via cpp redefinitions. +?X: +?X: The file ./Magic_h below contains all the ?M: lines extracted out of all +?X: the units. Metaconfig itself adds the final #endif statement. +?X: Note that this code isn't included into Configure, but must be shipped with. +?X: +?MAKE:Magic_h: Id Config_h +?MAKE: -pick cm_h_weed $@ %< +?MAKE: -pick cm_h_weed $@ ./Magic_h +/* + * This file was produced by running metaconfig and is intended to be included + * after config.h and after all the other needed includes have been dealt with. + * + * This file may be empty, and should not be edited. Rerun metaconfig instead. + * If you wish to get rid of this magic, remove this file and rerun metaconfig + * without the -M option. + * + * $Id: Magic_h.U,v 3.0.1.2 1993/11/10 17:32:58 ram Exp $ + */ + +#ifndef _confmagic_h_ +#define _confmagic_h_ + diff --git a/mcon/U/MailAuthor.U b/mcon/U/MailAuthor.U new file mode 100644 index 0000000..741a978 --- /dev/null +++ b/mcon/U/MailAuthor.U @@ -0,0 +1,192 @@ +?RCS: $Id: MailAuthor.U,v 3.0.1.5 1997/02/28 15:04:41 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: Original Author: Graham Stoney +?RCS: +?RCS: $Log: MailAuthor.U,v $ +?RCS: Revision 3.0.1.5 1997/02/28 15:04:41 ram +?RCS: patch61: added support for src.U +?RCS: +?RCS: Revision 3.0.1.4 1994/08/29 16:05:09 ram +?RCS: patch32: avoid message sending if they said no previously +?RCS: +?RCS: Revision 3.0.1.3 1993/10/16 13:47:30 ram +?RCS: patch12: now makes sure user-specified address is in Internet format +?RCS: +?RCS: Revision 3.0.1.2 1993/09/13 15:48:49 ram +?RCS: patch10: reverted to original intent by the Author himself +?RCS: +?RCS: Revision 3.0.1.1 1993/08/27 14:38:38 ram +?RCS: patch7: now prompts user for its e-mail address +?RCS: patch7: no longer silent when mail has been sent +?RCS: +?RCS: Revision 3.0 1993/08/18 12:05:06 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?RCS: +?X: +?X: This unit asks the user to please send a message to the author. +?X: To force inclusion of this unit, you must add it's name to the +?X: dependancies on the MAKE line in your private copy of End.U. +?X: This allows a smart mailagent program to automatically let users know +?X: when their package is out of date, and to allow users to be notified of +?X: any future patches. +?X: +?MAKE:MailAuthor mailpatches notifypatches usermail: test cat mailer \ + package Myread patchlevel baserev rm rsrc Oldconfig Configdir +?MAKE: -pick wipe $@ %< +?S:mailpatches: +?S: Indicates whether the user would like future patches to be mailed +?S: directly to them. +?S:. +?S:notifypatches: +?S: Indicates whether the user would like notification of future patches +?S: mailed to them. +?S:. +?S:usermail: +?S: This variable is used internally by Configure to keep track of the +?S: user e-mail address, where notifications or patches should be sent. +?S: A '-' value means the return address will be extracted by parsing +?S: the mail headers. +?S:. +?T:opt mailpatches notifypatches atsh status +: notify author that his package is used +if $test -f ../.config/mailauthor && + cmp $rsrc/patchlevel.h ../.config/mailauthor >/dev/null 2>&1 +then + status="say that you're using $package"; + case "$mailpatches" in + true) status='have patches mailed to you as they are issued';; + esac + case "$notifypatches" in + true) status='be notified when new patches are issued';; + esac + $cat <) mail to +$status. If you wish, you may modify +your previous request by sending a new mail with different options. + +EOM + rp='Should I send a status update to ?' + dflt=n +else + $cat <..." >&4 +?X: Bizarre hack here. We can't just put @SH in the hereis lines below, because +?X: metaconfig will interpret it as a command, and there's no quoting mechanism. +?X: Do it via a variable instead. + atsh='@SH' + $mailer </dev/null 2>&1 +Subject: Command +Precedence: junk +To: + +$atsh package $usermail $package $baserev $patchlevel$opt +EOM + $rm -f ../.config/mailauthor ../.config/nomail + cp $rsrc/patchlevel.h ../.config/mailauthor + ;; +*) + case "$dflt" in + "y") + echo "Oh well, maybe next time." + cp /dev/null ../.config/nomail + ;; + esac + ;; +esac + diff --git a/mcon/U/MailList.U b/mcon/U/MailList.U new file mode 100644 index 0000000..80233fb --- /dev/null +++ b/mcon/U/MailList.U @@ -0,0 +1,82 @@ +?RCS: $Id: MailList.U,v 3.0.1.1 1994/01/24 14:01:49 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: Original Author: Graham Stoney +?RCS: +?RCS: $Log: MailList.U,v $ +?RCS: Revision 3.0.1.1 1994/01/24 14:01:49 ram +?RCS: patch16: created +?RCS: +?RCS: +?X: +?X: This unit offers the user the option of subscribing to the mailing +?X: list. To force inclusion of this unit, you must add it's name to the +?X: dependancies on the MAKE line in your private copy of End.U. +?X: The address of the mailing list server must be set via a "list_request=..." +?X: entry in the .package file. This is usually done by running packinit and +?X: answering the proper questions. +?X: +?MAKE:MailList: cat mailer package Myread cf_name cf_email +?MAKE: -pick wipe $@ %< +?T:list_request list_sub list_unsub list_name +?X: +?X: The cf_name dependency is used through list_sub when the mailing list +?X: manager happens to be listserv, whereas cf_email is used whith majordomo +?X: or when the mailing list request address is scanned by a human. Since +?X: they do not appear within the unit itself, we need a lint hint. +?X: +?LINT:use cf_name cf_email +: offer to join the mailing list +list_request='<$list_request>' +list_sub="<$list_sub>" +list_unsub="<$list_unsub>" +list_name="<$list_name>" +$cat <&4 + $mailer $list_request </dev/null 2>&1 +Precedence: junk +To: $list_request + +$list_sub +EOM + ;; +[uU]*) echo "Sending mail to unsubscribe you from the $list_name list..." >&4 + $mailer $list_request </dev/null 2>&1 +Precedence: junk +To: $list_request + +$list_unsub +EOM + ;; +esac + diff --git a/mcon/U/Myinit.U b/mcon/U/Myinit.U new file mode 100644 index 0000000..b4dab64 --- /dev/null +++ b/mcon/U/Myinit.U @@ -0,0 +1,26 @@ +?RCS: $Id: Myinit.U,v 3.0.1.1 1994/10/31 09:47:29 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: Myinit.U,v $ +?RCS: Revision 3.0.1.1 1994/10/31 09:47:29 ram +?RCS: patch44: leading comment states this unit comes before option processing +?RCS: +?RCS: Revision 3.0 1993/08/18 12:05:07 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?X: +?X: If you want to initialize any default values, copy this unit to your +?X: personal U directory and add the assignments to the end. This file +?X: is included after variables are initialized but before any old +?X: config.sh file is read in and before any Configure switch processing. +?X: +?MAKE:Myinit: Init +?MAKE: -pick add $@ %< + diff --git a/mcon/U/Myread.U b/mcon/U/Myread.U new file mode 100644 index 0000000..6a2fdb2 --- /dev/null +++ b/mcon/U/Myread.U @@ -0,0 +1,199 @@ +?RCS: $Id: Myread.U,v 3.0.1.6 1997/02/28 15:05:39 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: Myread.U,v $ +?RCS: Revision 3.0.1.6 1997/02/28 15:05:39 ram +?RCS: patch61: myread script now starts with a "startsh" +?RCS: patch61: miscellaneous fixes +?RCS: +?RCS: Revision 3.0.1.5 1995/01/11 15:14:22 ram +?RCS: patch45: added & escape allowing user to turn on -d from the prompt +?RCS: +?RCS: Revision 3.0.1.4 1994/10/31 09:48:04 ram +?RCS: patch44: added Options to the MAKE line since it's no longer in Init.U +?RCS: +?RCS: Revision 3.0.1.3 1994/10/29 15:56:20 ram +?RCS: patch36: added ?F: line for metalint file checking +?RCS: +?RCS: Revision 3.0.1.2 1993/08/30 08:57:59 ram +?RCS: patch8: added new visible 'nostick' symbol, mainly for Finish.U +?RCS: +?RCS: Revision 3.0.1.1 1993/08/27 14:39:20 ram +?RCS: patch7: now sticks to the question when no default and empty answer +?RCS: +?RCS: Revision 3.0 1993/08/18 12:05:08 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?X: +?X: This unit produces a bit of shell code that must be dotted in in order +?X: to do a read. It allows for shell escapes, default assignment and +?X: parameter evaluation. +?X: +?X: To use this unit, $rp and $dflt must hold the question and the +?X: default answer. The question will be printed by the script itself. +?X: Neither $rp nor $dflt is altered by the script. +?X: +?X: The myread script will stick to the question if no default is proposed +?X: and the user answer is empty, which prevents mistakes. However, at the +?X: end of Configure, there is an exception to this rule (Finish.U) where we +?X: set nostick to a non-empty value to allow the Return key to play its role! +?X: +?MAKE:Myread: Options startsh n c +?MAKE: -pick add $@ %< +?V:ans:dflt rp nostick +?F:./myread +?T:COLUMNS xxxm rp dflt answ aok myecho +?LINT:change fastread +?X: Some shells (Ultrix) do not understand ${COLUMNS:-80}, sigh! +: 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 +?X: +?X: This variable is intended to be eval'ed. It will echo the two +?X: variables $rp and $dflt (provided this latter has a non null value). +?X: It is mainly used by the myread script to echo the questions. +?X: +?X: The $n and $c below are substituted before Loc does its silly echo check +?X: so don't put a $ on the echo below so we get builtin, even if $echo is +?X: pointing to /bin/echo. +?X: +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 +?X: +?X: Save value of default -- do not alter original in case of eval +?X: +xxxm=\$dflt +$myecho +?X: +?X: If there is no default, then stop, regardless of the value in fastread. +?X: In silent mode, no new-line is to be echoed if the question is empty, +?X: since this is used to wait for the "return" key. +?X: +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 +?X: +?X: Run 'eval' on the answer, in order to do variable substitution, in case +?X: the user types $HOME or $WHATEVER. Variables must be evaluated now. +?X: Typing '\$HOME' won't currently prevent from substitution -- use '\\$HOME' +?X: The $1 .. $9 and $*, as well as $@, are available to refer to the +?X: default value. +?X: + set x \$xxxm + shift + aok=''; eval "ans=\\"\$answ\\"" && aok=y + case "\$answ" in +?X: +?X: Use "!" and not a plain ! because of a bug in BSD 4.4 shell +?X: (reported by Wayne Davison) +?X: We must handle the shell escapes before dealing with possible variable +?X: substitution, since the shell we're launching in that case will be able +?X: to do it as well as we can -- RAM, 15/03/96 +?X + "!") + sh 1>&4 + echo " " + $myecho + ;; + !*) + set x \`expr "X\$ans" : "X!\(.*\)\$"\` + shift + sh 1>&4 -c "\$*" + echo " " + $myecho + ;; + "\$ans") + case "\$ans" in +?X: +?X: Answers starting with & are hooks allowing to dynamically turn on/off +?X: some Configure options. That's for the future. -- RAM, 09/01/95 +?X: Today, we only recognize '& -d' to mean 'go on as if Configure -d, which +?X: is a hardwired behaviour compatible with our general scheme. +?X: + \\&*) + 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 '\012' ' '\` + xxxm="\$ans" + ans=! + ;; + *) + echo "*** Error -- try again." + ans=! + ;; + esac + $myecho + ;; + esac +?X: Stick in myread if no default answer and nothing was answered + case "\$ans\$xxxm\$nostick" in + '') + ans=! + $myecho + ;; + esac +done +case "\$ans" in +'') ans="\$xxxm";; +esac +EOSC + diff --git a/mcon/U/Nothing.U b/mcon/U/Nothing.U new file mode 100644 index 0000000..59c9e32 --- /dev/null +++ b/mcon/U/Nothing.U @@ -0,0 +1,19 @@ +?RCS: $Id: Nothing.U,v 3.0 1993/08/18 12:05:09 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: Nothing.U,v $ +?RCS: Revision 3.0 1993/08/18 12:05:09 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?X: +?X: The purpose of this file is to supply an empty target for the private +?X: Makefile built by metaconfig to order the units. +?X: +?MAKE:Nothing: Head diff --git a/mcon/U/Null.U b/mcon/U/Null.U new file mode 100644 index 0000000..d3b7f51 --- /dev/null +++ b/mcon/U/Null.U @@ -0,0 +1,20 @@ +?RCS: $Id: Null.U,v 3.0 1993/08/18 12:05:10 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: Null.U,v $ +?RCS: Revision 3.0 1993/08/18 12:05:10 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?X: +?X: This unit ends up producing shell code to set all variables to ''. This +?X: probably isn't necessary, but I'm paranoid. About certain things. +?X: +?MAKE:Null: Head +?MAKE: -pick add.Null $@ %< diff --git a/mcon/U/Obsol_h.U b/mcon/U/Obsol_h.U new file mode 100644 index 0000000..e11626d --- /dev/null +++ b/mcon/U/Obsol_h.U @@ -0,0 +1,27 @@ +?RCS: $Id: Obsol_h.U,v 3.0 1993/08/18 12:05:11 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: Obsol_h.U,v $ +?RCS: Revision 3.0 1993/08/18 12:05:11 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?X: +?X: This file is prepended to .MT/Obsol_h if that file is not empty. That file +?X: contains the necessary mappings of new symbols to obsolete ones. +?X: +?MAKE:Obsol_h: +?MAKE: -pick prepend $@ ./Obsol_h +/* + * The following symbols are obsolete. They are mapped to the the new + * symbols only to ease the transition process. The sources should be + * updated so as to use the new symbols only, as the support for these + * obsolete symbols may end without notice. + */ + diff --git a/mcon/U/Obsol_sh.U b/mcon/U/Obsol_sh.U new file mode 100644 index 0000000..ecabb9a --- /dev/null +++ b/mcon/U/Obsol_sh.U @@ -0,0 +1,26 @@ +?RCS: $Id: Obsol_sh.U,v 3.0 1993/08/18 12:05:11 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: Obsol_sh.U,v $ +?RCS: Revision 3.0 1993/08/18 12:05:11 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?X: +?X: This file is prepended to .MT/Obsol_sh if that file is not empty. That file +?X: contains the necessary mappings of new symbols to obsolete ones. +?X: +?MAKE:Obsol_sh: +?MAKE: -pick prepend $@ ./Obsol_sh +# +# The following symbols are obsolete. They are mapped to the the new +# symbols only to ease the transition process. The sources should be +# updated so as to use the new symbols only, since supporting of those +# obsolete symbols may end without notice. +# diff --git a/mcon/U/Oldconfig.U b/mcon/U/Oldconfig.U new file mode 100644 index 0000000..1e18b0f --- /dev/null +++ b/mcon/U/Oldconfig.U @@ -0,0 +1,599 @@ +?RCS: $Id: Oldconfig.U,v 3.0.1.10 1997/02/28 15:06:39 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: Oldconfig.U,v $ +?RCS: Revision 3.0.1.10 1997/02/28 15:06:39 ram +?RCS: patch61: added support for src.U +?RCS: patch61: new OSNAME define +?RCS: patch61: can now sense new OSes +?RCS: +?RCS: Revision 3.0.1.9 1995/07/25 13:40:51 ram +?RCS: patch56: now knows about OS/2 platforms +?RCS: +?RCS: Revision 3.0.1.8 1995/05/12 12:04:18 ram +?RCS: patch54: config.sh reload logic now knows about new -K switch +?RCS: patch54: cleaned up and extended osvers for DEC OSF/1 (ADO) +?RCS: patch54: added MachTen detection (ADO) +?RCS: +?RCS: Revision 3.0.1.7 1995/02/15 14:13:41 ram +?RCS: patch51: adapted osvers computation for AIX (ADO) +?RCS: +?RCS: Revision 3.0.1.6 1995/01/30 14:27:15 ram +?RCS: patch49: unit Options.U now exports file optdef.sh, not a variable +?RCS: patch49: update code for myuname changed (WED) +?RCS: +?RCS: Revision 3.0.1.5 1995/01/11 15:15:36 ram +?RCS: patch45: added quotes around the INITPROG variable (ADO) +?RCS: patch45: allows variable overriding after config file loading +?RCS: +?RCS: Revision 3.0.1.4 1994/10/29 15:57:05 ram +?RCS: patch36: added ?F: line for metalint file checking +?RCS: patch36: merged with the version used for perl5's Configure (ADO) +?RCS: +?RCS: Revision 3.0.1.3 1994/05/06 14:24:17 ram +?RCS: patch23: added support for osf1 hints +?RCS: patch23: new support for solaris and i386 systems (ADO) +?RCS: +?RCS: Revision 3.0.1.2 1994/01/24 14:05:02 ram +?RCS: patch16: added post-processing on myuname for Xenix targets +?RCS: patch16: message proposing config.sh defaults made consistent +?RCS: +?RCS: Revision 3.0.1.1 1993/09/13 15:56:32 ram +?RCS: patch10: force use of config.sh when -d option is used (WAD) +?RCS: patch10: complain about non-existent hint files (WAD) +?RCS: patch10: added Options dependency for fastread variable +?RCS: +?RCS: Revision 3.0 1993/08/18 12:05:12 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?X: +?X: This unit tries to remember what we did last time we ran Configure, mostly +?X: for the sake of setting defaults. +?X: +?MAKE:Oldconfig hint myuname osname osvers: Instruct Myread uname \ + sh awk sed test cat rm lns n c contains Loc Options Tr src +?MAKE: -pick wipe $@ %< +?S:myuname: +?S: The output of 'uname -a' if available, otherwise the hostname. On Xenix, +?S: pseudo variables assignments in the output are stripped, thank you. The +?S: whole thing is then lower-cased. +?S:. +?S:hint: +?S: Gives the type of hints used for previous answers. May be one of +?S: "default", "recommended" or "previous". +?S:. +?S:osname: +?S: This variable contains the operating system name (e.g. sunos, +?S: solaris, hpux, etc.). It can be useful later on for setting +?S: defaults. Any spaces are replaced with underscores. It is set +?S: to a null string if we can't figure it out. +?S:. +?S:osvers: +?S: This variable contains the operating system version (e.g. +?S: 4.1.3, 5.2, etc.). It is primarily used for helping select +?S: an appropriate hints file, but might be useful elsewhere for +?S: setting defaults. It is set to '' if we can't figure it out. +?S: We try to be flexible about how much of the version number +?S: to keep, e.g. if 4.1.1, 4.1.2, and 4.1.3 are essentially the +?S: same for this package, hints files might just be os_4.0 or +?S: os_4.1, etc., not keeping separate files for each little release. +?S:. +?C:OSNAME: +?C: This symbol contains the name of the operating system, as determined +?C: by Configure. You shouldn't rely on it too much; the specific +?C: feature tests from Configure are generally more reliable. +?C:. +?H:#define OSNAME "$osname" /**/ +?H:. +?F:!config.sh +?T:tmp tmp_n tmp_c tmp_sh file +?T:xxxxfile xxxfile xxfile xfile hintfile newmyuname +?T:tans _ isesix INITPROG +?LINT:change n c sh +: Try to determine whether config.sh was made on this system +case "$config_sh" in +'') +?X: indentation wrong on purpose--RAM +?X: Leave a white space between first two '(' for ksh. The sub-shell is needed +?X: on some machines to avoid the error message when uname is not found; e.g. +?X: old SUN-OS 3.2 would not execute hostname in (uname -a || hostname). Sigh! +myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1` +?X: Special mention for Xenix, whose 'uname -a' gives us output like this: +?X: sysname=XENIX +?X: nodename=whatever +?X: release=2.3.2 .. etc... +?X: Therefore, we strip all this variable assignment junk and remove all the +?X: new lines to keep the myuname variable sane... --RAM +myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \ + ./tr '[A-Z]' '[a-z]' | tr '\012' ' '` +?X: Save the value we just computed to reset myuname after we get done here. +newmyuname="$myuname" +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 + +@if {test -d ../hints} +: Get old answers from old config file if Configure was run on the +: same system, otherwise use the hints. +hint=default +cd .. +?X: Since we are now at the root of the source tree, we must use $src +?X: to access the sources and not $rsrc. See src.U for details... +if test -f config.sh; then + echo " " + rp="I see a config.sh file. Shall I use it to set the defaults?" + . UU/myread + case "$ans" in + n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;; + *) 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 UU + n="$tmp_n" + c="$tmp_c" + : Older versions did not always set $sh. Catch re-use of such + : an old config.sh. + case "$sh" in + '') sh="$tmp_sh" ;; + esac + hint=previous + ;; + esac +fi +if test ! -f config.sh; then + $cat <&4 + dflt='' + : Half the following guesses are probably wrong... If you have better + : tests or hints, please send them to + : The metaconfig authors would also appreciate a copy... + $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.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 + if $test -d /MachTen; then +?X: MachTen uname -a output looks like +?X: xxx 4 0.0 Macintosh +?X: MachTen /sbin/version output looks like +?X: MachTen 4.0 Mon Aug 28 10:18:00 1995 +?X: MachTen 3.x had the 'version' command in /usr/etc/version. + 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 +?X: If we have uname, we already computed a suitable uname -a output, correctly +?X: formatted for Xenix, and it lies in $myuname. + if $test -f $uname; 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 ;; + news*) osname=news ;; +?X: Interactive Unix. + i386*) + if $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 + ;; + esac + + case "$1" in + aix) osname=aix +?X: aix 4.1 uname -a output looks like +?X: AIX foo 1 4 000123456789 +?X: where $4 is the major release number and $3 is the (minor) version. +?X: More detail on the version is available with the oslevel command. +?X: in 3.2.x, it output a string (see case statements below). In 4.1, +?X: it puts out something like 4.1.1.0 + 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 + ;; + *dc.osx) osname=dcosx + osvers="$3" + ;; + dnix) osname=dnix + osvers="$3" + ;; + domainos) osname=apollo + osvers="$3" + ;; + dgux) osname=dgux + osvers="$3" + ;; +?X: uname -a returns +?X: DYNIX/ptx xxx 4.0 V4.1.2 i386 + dynixptx*) osname=dynixptx + osvers="$3" + ;; + freebsd) osname=freebsd + osvers="$3" ;; + genix) osname=genix ;; + hp*) osname=hpux + case "$3" in + *.08.*) osvers=9 ;; + *.09.*) osvers=9 ;; + *.10.*) osvers=10 ;; + *) osvers="$3" ;; + esac + ;; + irix*) osname=irix + case "$3" in + 4*) osvers=4 ;; + 5*) osvers=5 ;; + *) osvers="$3" ;; + esac + ;; + linux) osname=linux + case "$3" in + 1*) osvers=1 ;; + *) osvers="$3" ;; + esac + ;; + netbsd*) osname=netbsd + osvers="$3" + ;; + bsd386) osname=bsd386 + osvers=`$uname -r` + ;; + next*) osname=next ;; + 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) +?X: DEC OSF/1 myuname -a output looks like: osf1 xxxx t3.2 123.4 alpha +?X: where the version number can be either vn.n or tn.n. + osname=dec_osf + osvers=`echo "$3" | sed 's/^[vt]//'` + ;; + hp*) osname=hp_osf1 ;; + mips) osname=mips_osf1 ;; +?X: hp and mips were unsupported Technology Releases -- ADO, 24/10/94 + esac + ;; + uts) osname=uts + osvers="$3" + ;; + qnx) osname=qnx + osvers="$4" + ;; + $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 sco_$1_$2_$3.sh; then + osvers=$1.$2.$3 + elif $test -f sco_$1_$2.sh; then + osvers=$1.$2 + elif $test -f 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 +?X: Try to identify sony's NEWS-OS (BSD unix) + 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 +?X: Maybe it's an OS/2 + elif test -d c:/.; then + set X $myuname + osname=os2 + osvers="$5" + fi + fi + + : Now look for a hint file osname_osvers, unless one has been + : specified already. + case "$hintfile" in + ''|' ') + file=`echo "${osname}_${osvers}" | $sed -e 's@\.@_@g' -e 's@_$@@'` + : Also try without trailing minor version numbers. + xfile=`echo $file | $sed -e 's@_[^_]*$@@'` + xxfile=`echo $xfile | $sed -e 's@_[^_]*$@@'` + xxxfile=`echo $xxfile | $sed -e 's@_[^_]*$@@'` + xxxxfile=`echo $xxxfile | $sed -e 's@_[^_]*$@@'` + case "$file" in + '') dflt=none ;; + *) case "$osvers" in + '') dflt=$file + ;; + *) if $test -f $src/hints/$file.sh ; then + dflt=$file + elif $test -f $src/hints/$xfile.sh ; then + dflt=$xfile + elif $test -f $src/hints/$xxfile.sh ; then + dflt=$xxfile + elif $test -f $src/hints/$xxxfile.sh ; then + dflt=$xxxfile + elif $test -f $src/hints/$xxxxfile.sh ; then + dflt=$xxxxfile + elif $test -f "$src/hints/${osname}.sh" ; then + dflt="${osname}" + else + dflt=none + fi + ;; + esac + ;; + esac + ;; + *) + dflt=`echo $hintfile | $sed 's/\.sh$//'` + ;; + esac + + $cat <> UU/config.sh + elif $test X$tans = X -o X$tans = Xnone ; then + : nothing + else + : Give one chance to correct a possible typo. + echo "$file.sh does not exist" + dflt=$file + rp="hint to use instead?" + . UU/myread + for file in $ans; do + if $test -f "$src/hints/$file.sh"; then + . $src/hints/$file.sh + $cat $src/hints/$file.sh >> UU/config.sh + elif $test X$ans = X -o X$ans = Xnone ; then + : nothing + else + echo "$file.sh does not exist -- ignored." + fi + done + fi + done + + hint=recommended + : Remember our hint file for later. + if $test -f "$src/hints/$file.sh" ; then + hintfile="$file" + else + hintfile='' + fi +fi +cd UU +?X: From here on, we must use $rsrc instead of $src +@else +: Get old answers, if there is a config file out there +hint=default +hintfile='' +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.";; + *) echo "Fetching default answers from your old config.sh file..." >&4 + tmp_n="$n" + tmp_c="$c" + . ../config.sh + cp ../config.sh . + n="$tmp_n" + c="$tmp_c" + hint=previous + ;; + esac +fi +@end +?X: remember, indentation is wrong--RAM +;; +*) + echo " " + echo "Fetching default answers from $config_sh..." >&4 + tmp_n="$n" + tmp_c="$c" + cd .. +?X: preserve symbolic links, if any + 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 +test "$override" && . ./optdef.sh +myuname="$newmyuname" + +: Restore computed paths +for file in $loclist $trylist; do + eval $file="\$_$file" +done + +@if osname || osvers +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 +@end +@if osname +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 +@end +@if osvers +@if osname +echo " " +@end +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 + +@end diff --git a/mcon/U/Oldsym.U b/mcon/U/Oldsym.U new file mode 100644 index 0000000..c49cb64 --- /dev/null +++ b/mcon/U/Oldsym.U @@ -0,0 +1,62 @@ +?RCS: $Id: Oldsym.U,v 3.0.1.1 1997/02/28 15:06:58 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: Oldsym.U,v $ +?RCS: Revision 3.0.1.1 1997/02/28 15:06:58 ram +?RCS: patch61: added support for src.U +?RCS: +?RCS: Revision 3.0 1993/08/18 12:05:13 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?X: +?X: This unit follows the creation of the config.sh file. It adds some +?X: special symbols: defines from patchlevel.h file if any and CONFIG, +?X: which is set to true. Then, we try to keep all the new symbols that +?X: may come from a hint file or a previous config.sh file. +?X: +?MAKE:Oldsym: Config_sh test hint src +?MAKE: -pick add $@ %< +?T:CONFIG sym tmp s +: add special variables +$test -f $src/patchlevel.h && \ +awk '/^#define/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh +echo "CONFIG=true" >>config.sh + +: propagate old symbols +if $test -f UU/config.sh; then +?X: Make sure each symbol is unique in oldconfig.sh + UU/oldconfig.sh +?X: +?X: All the symbols that appear twice come only from config.sh (hence the +?X: two config.sh in the command line). These symbols will be removed by +?X: the uniq -u command. The oldsyms file thus contains all the symbols +?X: that did not appear in the produced config.sh (Larry Wall). +?X: + 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 + diff --git a/mcon/U/Options.U b/mcon/U/Options.U new file mode 100644 index 0000000..0985d3e --- /dev/null +++ b/mcon/U/Options.U @@ -0,0 +1,255 @@ +?RCS: $Id: Options.U,v 3.0.1.7 1997/02/28 15:08:15 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: Options.U,v $ +?RCS: Revision 3.0.1.7 1997/02/28 15:08:15 ram +?RCS: patch61: optdef.sh now starts with a "startsh" +?RCS: patch61: moved some code from Head.U +?RCS: +?RCS: Revision 3.0.1.6 1995/09/25 09:14:46 ram +?RCS: patch59: protected option parsing code against 'echo -*' option failure +?RCS: +?RCS: Revision 3.0.1.5 1995/05/12 12:04:52 ram +?RCS: patch54: added -K option for experts +?RCS: +?RCS: Revision 3.0.1.4 1995/01/30 14:27:52 ram +?RCS: patch49: this unit now exports file optdef.sh, not a variable +?RCS: +?RCS: Revision 3.0.1.3 1995/01/11 15:19:00 ram +?RCS: patch45: new -O option allowing -D and -U to override config.sh setttings +?RCS: patch45: file optdef.sh is no longer removed after sourcing +?RCS: +?RCS: Revision 3.0.1.2 1994/10/29 15:58:06 ram +?RCS: patch36: ensure option definition file is removed before appending +?RCS: patch36: protect variable definitions with spaces in them +?RCS: +?RCS: Revision 3.0.1.1 1994/06/20 06:55:44 ram +?RCS: patch30: now uses new me symbol to tag error messages +?RCS: patch30: new -D and -U options to define/undef symbols (JHI) +?RCS: +?RCS: Revision 3.0 1993/08/18 12:05:14 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?X: +?X: Command line parsing. It is really important that the variables used here +?X: be not listed in the MAKE line, or they will be saved in config.sh and +?X: loading this file to fetch default answers would clobber the values set +?X: herein. +?X: +?MAKE:Options: startsh +?MAKE: -pick wipe $@ %< +?V:reuseval alldone error realsilent silent extractsh fastread \ + override knowitall: config_sh +?T:arg symbol +?F:./optdef.sh +: produce awk script to parse command line options +cat >options.awk <<'EOF' +BEGIN { + optstr = "dD:eEf:hKOrsSU:V"; # getopt-style specification + + len = length(optstr); + for (i = 1; i <= len; i++) { + c = substr(optstr, i, 1); +?X: some older awk's do not have the C ?: construct + 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 +?X: Use "$@" to keep arguments with spaces in them from being split apart. +?X: For the same reason, awk will output quoted arguments and the final eval +?X: removes them and sets a proper $* array. An 'X' is prependend to each +?X: argument before being fed to echo to guard against 'echo -x', where -x +?X: would be understood as an echo option! It is removed before feeding awk. +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 +cat >optdef.sh <&4 redirection based on the value of the +?X: realsilent variable... -- RAM, 18/93/96 +?X: + +: option parsing +while test $# -gt 0; do + case "$1" in + -d) shift; fastread=yes;; + -e) shift; alldone=cont;; + -f) + shift + cd .. + if test -r "$1"; then + config_sh="$1" + else + echo "$me: cannot read config file $1." >&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 + ;; + -V) echo "$me generated by metaconfig PL." >&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 + diff --git a/mcon/U/Prefixit.U b/mcon/U/Prefixit.U new file mode 100644 index 0000000..91f11aa --- /dev/null +++ b/mcon/U/Prefixit.U @@ -0,0 +1,68 @@ +?RCS: $Id: Prefixit.U,v 3.0.1.1 1995/01/30 14:29:22 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: Prefixit.U,v $ +?RCS: Revision 3.0.1.1 1995/01/30 14:29:22 ram +?RCS: patch49: created +?RCS: +?X: +?X: Used as: "set dflt var dir; eval $prefixit" to set $dflt to be +?X: $prefix/dir by default, or the previous $var depending on certain +?X: conditions: +?X: - If the $oldprefix variable is empty, then $prefix holds the same +?X: value as on previous runs. Therefore, reuse $var if set, otherwise +?X: set $dflt to $prefix/dir. +?X: - If $oldprefix is not empty, then set $dflt to $prefix/dir if $var +?X: is empty (first run). Otherwise, if $var is $oldprefix/dir, then +?X: change it to $prefix/dir. If none of the above, reuse the old $var. +?X: +?X: When dir is omitted, the dflt variable is set to $var if prefix did not +?X: change, to an empty value otherwise. If dir=none, then a single space +?X: in var is kept as-is, even if the prefix changes. +?X: +?MAKE:Prefixit: prefix oldprefix +?MAKE: -pick add $@ %< +?LINT:define prefixit +?S:prefixit: +?S: This shell variable is used internally by Configure to reset +?S: the leading installation prefix correctly when it is changed. +?S: set dflt var [dir] +?S: eval $prefixit +?S: That will set $dflt to $var or $prefix/dir depending on the +?S: value of $var and $oldprefix. +?S:. +?V:prefixit +?T:tp +: set the prefixit variable, to compute a suitable default value +prefixit='case "$3" in +""|none) + case "$oldprefix" in + "") eval "$1=\"\$$2\"";; + *) + case "$3" in + "") eval "$1=";; + none) + eval "tp=\"\$$2\""; + case "$tp" in + ""|" ") eval "$1=\"\$$2\"";; + *) eval "$1=";; + esac;; + esac;; + esac;; +*) + eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\""; + case "$tp" in + --|/*--|\~*--) eval "$1=\"$prefix/$3\"";; + /*-$oldprefix/*|\~*-$oldprefix/*) + eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";; + *) eval "$1=\"\$$2\"";; + esac;; +esac' + diff --git a/mcon/U/Prefixup.U b/mcon/U/Prefixup.U new file mode 100644 index 0000000..11b633a --- /dev/null +++ b/mcon/U/Prefixup.U @@ -0,0 +1,38 @@ +?RCS: $Id: Prefixup.U,v 3.0.1.1 1995/01/30 14:30:40 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: Prefixup.U,v $ +?RCS: Revision 3.0.1.1 1995/01/30 14:30:40 ram +?RCS: patch49: created +?RCS: +?X: +?X: Used as: "set dflt; eval $prefixup" to set $dflt to be $prefix/dir +?X: instead of $prefixexp/dir, in case portability was involved somehow +?X: and $prefix uses ~name expansion. +?X: +?MAKE:Prefixup: prefix prefixexp +?MAKE: -pick add $@ %< +?LINT:define prefixup +?S:prefixup: +?S: This shell variable is used internally by Configure to reset +?S: the leading installation prefix correctly when $prefix uses +?S: ~name expansion. +?S: set dflt +?S: eval $prefixup +?S: That will set $dflt to $prefix/dir if it was $prefixexp/dir and +?S: $prefix differs from $prefixexp. +?S:. +?V:prefixup +: set the prefixup variable, to restore leading tilda escape +prefixup='case "$prefixexp" in +"$prefix") ;; +*) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";; +esac' + diff --git a/mcon/U/Rcs.U b/mcon/U/Rcs.U new file mode 100644 index 0000000..e7f4bd7 --- /dev/null +++ b/mcon/U/Rcs.U @@ -0,0 +1,34 @@ +?RCS: $Id: Rcs.U,v 3.0 1993/08/18 12:05:15 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: Rcs.U,v $ +?RCS: Revision 3.0 1993/08/18 12:05:15 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?X: +?X: This is a unit that helps people who write SH scripts and keep them under +?X: RCS, but don't think to protect the $Log and other $Id keywords from +?X: variable substitution (or people like me who do not like to). +?X: +?MAKE:Author Date Header Id Locker Log RCSfile Revision Source State: Oldconfig +?MAKE: -pick weed $@ %< +?LINT:describe Author Date Header Id Locker Log RCSfile Revision Source State +: preserve RCS keywords in files with variable substitution, grrr +?Author:Author='$Author' +?Date:Date='$Date' +?Header:Header='$Header' +?Id:Id='$Id' +?$Locker' +?Log:Log='$Log' +?RCSfile:RCSfile='$RCSfile' +?Revision:Revision='$Revision' +?Source:Source='$Source' +?State:State='$State' + diff --git a/mcon/U/Setvar.U b/mcon/U/Setvar.U new file mode 100644 index 0000000..645d271 --- /dev/null +++ b/mcon/U/Setvar.U @@ -0,0 +1,50 @@ +?RCS: $Id: Setvar.U,v 3.0.1.1 1994/10/29 15:58:28 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: Setvar.U,v $ +?RCS: Revision 3.0.1.1 1994/10/29 15:58:28 ram +?RCS: patch36: call ./whoa explicitely instead of relying on PATH +?RCS: +?RCS: Revision 3.0 1993/08/18 12:05:16 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?X: +?X: This unit produces a variable that is intended to be eval'ed in +?X: order to define/undefine a symbol. A consistency check is made +?X: regarding any previous value and a warning is issued if there +?X: is any discrepancy. +?X: +?X: To use it, say: +?X: val= +?X: set d_variable +?X: eval $setvar +?X: +?MAKE:Setvar: Whoa +?MAKE: -pick add $@ %< +?LINT:define setvar +?S:setvar: +?S: This shell variable is used internally by Configure to set a value +?S: to a given symbol that is defined or not. A typical use is: +?S: val= +?S: set d_variable +?S: eval $setvar +?S: That will print a message in case the $val value is not the same +?S: as the previous value of $d_variable. +?S:. +?V:setvar:val +?T:var was td tu +: function used to set $1 to $val +setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef; +case "$val$was" in +$define$undef) . ./whoa; eval "$var=\$td";; +$undef$define) . ./whoa; eval "$var=\$tu";; +*) eval "$var=$val";; +esac' + diff --git a/mcon/U/Signal.U b/mcon/U/Signal.U new file mode 100644 index 0000000..2eb4ea9 --- /dev/null +++ b/mcon/U/Signal.U @@ -0,0 +1,192 @@ +?RCS: $Id: Signal.U,v 3.0.1.1 1997/02/28 15:20:01 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: Signal.U,v $ +?RCS: Revision 3.0.1.1 1997/02/28 15:20:01 ram +?RCS: patch61: created +?RCS: +?X: +?X: This unit produces three files: +?X: 1- A signal.c file, which, when compiled and ran, produces an output like: +?X: +?X: HUP 1 +?X: INT 2 +?X: QUIT 3 +?X: etc... +?X: +?X: 2- A signal.awk script to parse the output of signal.c, fill +?X: in gaps (up to NSIG) and move duplicates to the end. +?X: 3- A signal_cmd script to compile signal.c and run it +?X: through sort -n +1 | uniq | awk -f signal.awk. +?X: (This is called signal_cmd to avoid OS/2 confusion with +?X: signal.cmd vs. signal. +?X: +?X: This unit is then used by sig_name.U. +?X: +?MAKE:Signal: test tr rm awk cat grep startsh eunicefix sed sort uniq \ + Findhdr cppstdin +cppflags cppminus +cc +ccflags +ldflags _o +?MAKE: -pick add $@ %< +?X:all files declared as "public" since they're used from other units +?F:signal.c signal_cmd signal.lst signal signal.awk +?T: xx xxx xxxfiles +: Trace out the files included by signal.h, then look for SIGxxx names. +: Remove SIGARRAYSIZE used by HPUX. +: Remove SIGTYP void lines used by OS2. +xxx=`echo '#include ' | + $cppstdin $cppminus $cppflags 2>/dev/null | + $grep '^[ ]*#.*include' | + $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq` +: Check this list of files to be sure we have parsed the cpp output ok. +: This will also avoid potentially non-existent files, such +: as ../foo/bar.h +xxxfiles='' +?X: Add /dev/null in case the $xxx list is empty. +for xx in $xxx /dev/null ; do + $test -f "$xx" && xxxfiles="$xxxfiles $xx" +done +: If we have found no files, at least try signal.h +case "$xxxfiles" in +'') xxxfiles=`./findhdr signal.h` ;; +esac +xxx=`awk ' +$1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $3 !~ /void/ { + print substr($2, 4, 20) +} +$1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ { + print substr($3, 4, 20) +}' $xxxfiles` +: Append some common names just in case the awk scan failed. +xxx="$xxx ABRT ALRM BUS CHLD CLD CONT DIL EMT FPE HUP ILL INT IO IOT KILL" +xxx="$xxx LOST PHONE PIPE POLL PROF PWR QUIT SEGV STKFLT STOP SYS TERM TRAP" +xxx="$xxx TSTP TTIN TTOU URG USR1 USR2 USR3 USR4 VTALRM" +xxx="$xxx WINCH WIND WINDOW XCPU XFSZ" +: generate a few handy files for later +$cat > signal.c <<'EOP' +#include +#include +int main() { + +/* Strange style to avoid deeply-nested #if/#else/#endif */ +#ifndef NSIG +# ifdef _NSIG +# define NSIG (_NSIG) +# endif +#endif + +#ifndef NSIG +# ifdef SIGMAX +# define NSIG (SIGMAX+1) +# endif +#endif + +#ifndef NSIG +# ifdef SIG_MAX +# define NSIG (SIG_MAX+1) +# endif +#endif + +#ifndef NSIG +# ifdef MAXSIG +# define NSIG (MAXSIG+1) +# endif +#endif + +#ifndef NSIG +# ifdef MAX_SIG +# define NSIG (MAX_SIG+1) +# endif +#endif + +#ifndef NSIG +# ifdef SIGARRAYSIZE +# define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */ +# endif +#endif + +#ifndef NSIG +# ifdef _sys_nsig +# define NSIG (_sys_nsig) /* Solaris 2.5 */ +# endif +#endif + +/* Default to some arbitrary number that's big enough to get most + of the common signals. +*/ +#ifndef NSIG +# define NSIG 50 +#endif + +printf("NSIG %d\n", NSIG); + +EOP +echo $xxx | $tr ' ' '\012' | $sort | $uniq | $awk ' +{ + printf "#ifdef SIG"; printf $1; printf "\n" + printf "printf(\""; printf $1; printf " %%d\\n\",SIG"; + printf $1; printf ");\n" + printf "#endif\n" +} +END { + printf "}\n"; +} +' >>signal.c +$cat >signal.awk <<'EOP' +BEGIN { ndups = 0 } +$1 ~ /^NSIG$/ { nsig = $2 } +($1 !~ /^NSIG$/) && (NF == 2) { + if ($2 > maxsig) { maxsig = $2 } + if (sig_name[$2]) { + dup_name[ndups] = $1 + dup_num[ndups] = $2 + ndups++ + } + else { + sig_name[$2] = $1 + sig_num[$2] = $2 + } + +} +END { + if (nsig == 0) { nsig = maxsig + 1 } + for (n = 1; n < nsig; n++) { + if (sig_name[n]) { + printf("%s %d\n", sig_name[n], sig_num[n]) + } + else { + printf("NUM%d %d\n", n, n) + } + } + for (n = 0; n < ndups; n++) { + printf("%s %d\n", dup_name[n], dup_num[n]) + } +} +EOP +$cat >signal_cmd </dev/null 2>&1; then + ./signal | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst +else + echo "(I can't seem be able to compile the test program -- Guessing)" + echo 'kill -l' >signal + set X \`csh -f signal.lst +fi +$rm -f signal.c signal signal$_o +EOS +chmod a+x signal_cmd +$eunicefix signal_cmd + diff --git a/mcon/U/Tr.U b/mcon/U/Tr.U new file mode 100644 index 0000000..883d13c --- /dev/null +++ b/mcon/U/Tr.U @@ -0,0 +1,60 @@ +?RCS: $Id: Tr.U,v 3.0.1.2 1994/10/29 18:00:54 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: Tr.U,v $ +?RCS: Revision 3.0.1.2 1994/10/29 18:00:54 ram +?RCS: patch43: forgot to quote $@ to protect against "evil" characters +?RCS: +?RCS: Revision 3.0.1.1 1994/10/29 15:58:35 ram +?RCS: patch36: created +?RCS: +?X: +?X: This unit produces a bit of shell code that must be dotted in in order +?X: to do a character translation. It catches translations to uppercase or +?X: to lowercase, and then invokes the real tr to perform the job. +?X: +?X: This unit is necessary on HP machines (HP strikes again!) with non-ascii +?X: ROMAN8-charset, where normal letters are not arranged in a row, so a-z +?X: covers not the whole alphabet but lots of special chars. This was reported +?X: by Andreas Sahlbach . +?X: +?X: Units performing a tr '[A-Z]' '[a-z]' or the other way round should include +?X: us in their dependency and use ./tr instead. +?X: +?MAKE:Tr: startsh tr eunicefix +?MAKE: -pick add $@ %< +?F:./tr +?T:up low +: see whether [:lower:] and [:upper:] are supported character classes +echo " " +up='[A-Z]' +low='[a-z]' +case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in +ABYZ) + echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4 + up='[:upper:]' + low='[:lower:]' + ;; +*) + echo "Your tr only supports [a-z] and [A-Z] to convert case." >&4 + ;; +esac +: set up the translation script tr, must be called with ./tr of course +cat >tr <whoa +$startsh +EOS +cat <<'EOSC' >>whoa +dflt=y +echo " " +echo "*** WHOA THERE!!! ***" >&4 +echo " The $hint value for \$$var on this machine was \"$was\"!" >&4 +rp=" Keep the $hint value?" +. ./myread +case "$ans" in +y) td=$was; tu=$was;; +esac +EOSC + diff --git a/mcon/U/abortsig.U b/mcon/U/abortsig.U new file mode 100644 index 0000000..f7b1efb --- /dev/null +++ b/mcon/U/abortsig.U @@ -0,0 +1,79 @@ +?RCS: $Id: abortsig.U,v 3.0.1.1 1994/10/29 16:02:19 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: abortsig.U,v $ +?RCS: Revision 3.0.1.1 1994/10/29 16:02:19 ram +?RCS: patch36: call ./usg explicitely instead of relying on PATH +?RCS: +?RCS: Revision 3.0 1993/08/18 12:05:20 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?MAKE:abortsig: Myread Oldconfig Guess cat +cc ccflags rm +?MAKE: -pick add $@ %< +?S:abortsig: +?S: This variable holds the name of the signal used by the abort() call. +?S:. +?C:ABORTSIG: +?C: This symbol holds the signal number (symbol) used by the abort() call. To +?C: actually define the signal symbol, should be included. +?C:. +?H:#define ABORTSIG $abortsig /**/ +?H:. +?T:signal +: which signal is sent by abort ? +echo " " +case "$abortsig" in +'') + echo "Checking to see which signal is sent to the process by abort()..." >&4 + echo "abort" > abort.sh + chmod +x abort.sh +?X: SIGABRT should replace SIGIOT on USG machines in a near future (1991). + for signal in SIGIOT SIGILL SIGABRT; do + case "$abortsig" in + '') $cat >abort.c < +caught() { exit(0); } +main() +{ +#ifdef $signal + signal($signal, caught); +#endif + if (-1 == abort()) + exit(1); + exit(1); +} +EOP +?X: We have to use the abort.sh script otherwise sh behaves strangely on AIX. + if $cc $ccflags -o abort abort.c >/dev/null 2>&1; then + (./abort.sh) >/dev/null 2>&1 + case $? in + 0) abortsig="$signal";; + esac + fi + ;; + esac + done + ;; +esac +case "$abortsig" in +'') echo "(I wasn't able to compute the signal name--guessing)" + if ./usg; then + dflt="SIGIOT" + else + dflt="SIGILL" + fi;; +*) dflt="$abortsig" + ;; +esac +rp="Which signal does abort() send to the process (signal name)?" +. ./myread +abortsig="$ans" +$rm -f core abort.sh abort abort.c + diff --git a/mcon/U/active.U b/mcon/U/active.U new file mode 100644 index 0000000..bd977c4 --- /dev/null +++ b/mcon/U/active.U @@ -0,0 +1,50 @@ +?RCS: $Id: active.U,v 3.0 1993/08/18 12:05:21 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: active.U,v $ +?RCS: Revision 3.0 1993/08/18 12:05:21 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?MAKE:active activeexp: newslib Oldconfig Getfile +?MAKE: -pick add $@ %< +?S:active: +?S: The name of the active file for the news system. This file contains +?S: the list of active newsgroups. The name may have ~ on the front. +?S: The variable myactive is the expanded form. +?S:. +?S:activeexp (myactive): +?S: This is the same as the active variable, but is filename expanded +?S: so that later Configure units can look at the active file if desired. +?S:. +?C:ACTIVE: +?C: The name of the active file for the news system. This file contains +?C: the list of active newsgroups. The name may have ~ on the front. +?C:. +?C:ACTIVE_EXP: +?C: This is the same as ACTIVE, but is filename expanded at configuration +?C: time, for programs that do not want to deal with it themselves. +?C:. +?H:#define ACTIVE "$active" /**/ +?H:#define ACTIVE_EXP "$activeexp" /**/ +?H:. +: locate active file +echo " " +case "$active" in +'') + dflt=$newslib/active + ;; +*) dflt="$active";; +esac +fn=l~:active +rp='Where is the active file?' +. ./getfile +active="$ans" +activeexp="$ansexp" + diff --git a/mcon/U/afs.U b/mcon/U/afs.U new file mode 100644 index 0000000..bcd787b --- /dev/null +++ b/mcon/U/afs.U @@ -0,0 +1,43 @@ +?RCS: $Id: afs.U,v 3.0.1.2 1997/02/28 15:23:06 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: afs.U,v $ +?RCS: Revision 3.0.1.2 1997/02/28 15:23:06 ram +?RCS: patch61: can now explicitely tell Configure whether AFS is running +?RCS: +?RCS: Revision 3.0.1.1 1993/08/24 12:24:43 ram +?RCS: patch3: created +?RCS: +?MAKE:afs: Nothing +?MAKE: -pick add $@ %< +?S:afs: +?S: This variable is set to 'true' if AFS (Andrew File System) is used +?S: on the system, 'false' otherwise. It is possible to override this +?S: with a hint value or command line option, but you'd better know +?S: what you are doing. +?S:. +: is AFS running? +echo " " +case "$afs" in +$define|true) afs=true ;; +$undef|false) afs=false ;; +*) if test -d /afs; 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 + diff --git a/mcon/U/alignbytes.U b/mcon/U/alignbytes.U new file mode 100644 index 0000000..94f1826 --- /dev/null +++ b/mcon/U/alignbytes.U @@ -0,0 +1,64 @@ +?RCS: $Id: alignbytes.U,v 3.0.1.2 1994/10/29 16:02:28 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: alignbytes.U,v $ +?RCS: Revision 3.0.1.2 1994/10/29 16:02:28 ram +?RCS: patch36: added ?F: line for metalint file checking +?RCS: +?RCS: Revision 3.0.1.1 1994/05/06 14:25:20 ram +?RCS: patch23: avoid ALIGNBYTES, since it conflicts on NetBSD +?RCS: +?RCS: Revision 3.0 1993/08/18 12:05:23 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?MAKE:alignbytes: Myread cat cc ccflags rm +?MAKE: -pick add $@ %< +?S:alignbytes: +?S: This variable holds the number of bytes required to align a +?S: double. Usual values are 2, 4 and 8. +?S:. +?X: This used to be called ALIGNBYTES, but that conflicts with +?X: in NetBSD. +?C:MEM_ALIGNBYTES (ALIGNBYTES): +?C: This symbol contains the number of bytes required to align a +?C: double. Usual values are 2, 4 and 8. +?C:. +?H:#define MEM_ALIGNBYTES $alignbytes /**/ +?H:. +?F:!try +: check for alignment requirements +echo " " +case "$alignbytes" in +'') echo "Checking alignment constraints..." >&4 + $cat >try.c <<'EOCP' +struct foobar { + char foo; + double bar; +} try; +main() +{ + printf("%d\n", (char *)&try.bar - (char *)&try.foo); +} +EOCP + if $cc $ccflags try.c -o try >/dev/null 2>&1; then + dflt=`./try` + else + dflt='8' + echo"(I can't seem to compile the test program...)" + fi + ;; +*) dflt="$alignbytes" + ;; +esac +rp="Doubles must be aligned on a how-many-byte boundary?" +. ./myread +alignbytes="$ans" +$rm -f try.c try + diff --git a/mcon/U/archlib.U b/mcon/U/archlib.U new file mode 100644 index 0000000..343e032 --- /dev/null +++ b/mcon/U/archlib.U @@ -0,0 +1,125 @@ +?RCS: $Id: archlib.U,v 3.0.1.5 1997/02/28 15:23:38 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: Original Author: Andy Dougherty +?RCS: +?RCS: $Log: archlib.U,v $ +?RCS: Revision 3.0.1.5 1997/02/28 15:23:38 ram +?RCS: patch61: skip existence checks for archlib +?RCS: +?RCS: Revision 3.0.1.4 1995/09/25 09:15:18 ram +?RCS: patch59: unit is now forced to the top of Configure, if possible +?RCS: +?RCS: Revision 3.0.1.3 1995/02/15 14:14:14 ram +?RCS: patch51: architecture name is now computed by a separate unit +?RCS: +?RCS: Revision 3.0.1.2 1995/01/30 14:32:22 ram +?RCS: patch49: archname is now systematically recomputed +?RCS: patch49: can now handle installation prefix changes (from WED) +?RCS: +?RCS: Revision 3.0.1.1 1994/10/29 16:02:36 ram +?RCS: patch36: created by ADO +?RCS: +?MAKE:d_archlib archlib archlibexp installarchlib: archname afs spackage \ + cat Getfile Loc Oldconfig prefixexp privlib test Prefixit Prefixup +?MAKE: -pick add $@ %< +?Y:TOP +?S:d_archlib: +?S: This variable conditionally defines ARCHLIB to hold the pathname +?S: of architecture-dependent library files for $package. If +?S: $archlib is the same as $privlib, then this is set to undef. +?S:. +?S:archlib: +?S: This variable holds the name of the directory in which the user wants +?S: to put architecture-dependent public library files for $package. +?S: It is most often a local directory such as /usr/local/lib. +?S: Programs using this variable must be prepared to deal +?S: with filename expansion. +?S:. +?S:archlibexp: +?S: This variable is the same as the archlib variable, but is +?S: filename expanded at configuration time, for convenient use. +?S:. +?S:installarchlib: +?S: This variable is really the same as archlibexp but may differ on +?S: those systems using AFS. For extra portability, only this variable +?S: should be used in makefiles. +?S:. +?C:ARCHLIB: +?C: This variable, if defined, holds the name of the directory in +?C: which the user wants to put architecture-dependent public +?C: library files for $package. It is most often a local directory +?C: such as /usr/local/lib. Programs using this variable must be +?C: prepared to deal with filename expansion. If ARCHLIB is the +?C: same as PRIVLIB, it is not defined, since presumably the +?C: program already searches PRIVLIB. +?C:. +?C:ARCHLIB_EXP: +?C: This symbol contains the ~name expanded version of ARCHLIB, to be used +?C: in programs that are not prepared to deal with ~ expansion at run-time. +?C:. +?H:#$d_archlib ARCHLIB "$archlib" /**/ +?H:#$d_archlib ARCHLIB_EXP "$archlibexp" /**/ +?H:. +: determine where public architecture dependent libraries go +set archlib archlib +eval $prefixit +case "$archlib" in +'') + case "$privlib" in + '') + dflt=`./loc . "." $prefixexp/lib /usr/local/lib /usr/lib /lib` + set dflt + eval $prefixup + ;; + *) dflt="$privlib/$archname";; + esac + ;; +*) dflt="$archlib";; +esac +cat < tmparch 2>&1 ; then + tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \ + -e 's/$/'"-$osname/" tmparch` + else + tarch="$osname" + fi + $rm -f tmparch +else + tarch="$osname" +fi +case "$myarchname" in +''|"$tarch") ;; +*) + echo "(Your architecture name used to be $myarchname.)" + archname='' + ;; +esac +case "$archname" in +'') dflt="$tarch";; +*) dflt="$archname";; +esac +rp='What is your architecture name' +. ./myread +archname="$ans" +myarchname="$tarch" + diff --git a/mcon/U/baserev.U b/mcon/U/baserev.U new file mode 100644 index 0000000..6dd04b0 --- /dev/null +++ b/mcon/U/baserev.U @@ -0,0 +1,22 @@ +?RCS: $Id: baserev.U,v 3.0 1993/08/18 12:05:24 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: baserev.U,v $ +?RCS: Revision 3.0 1993/08/18 12:05:24 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?MAKE:baserev: Null +?MAKE: -pick wipe $@ %< +?S:baserev: +?S: The base revision level of this package, from the .package file. +?S:. +: set the base revision +baserev= + diff --git a/mcon/U/basicshell.U b/mcon/U/basicshell.U new file mode 100644 index 0000000..36f03b9 --- /dev/null +++ b/mcon/U/basicshell.U @@ -0,0 +1,47 @@ +?RCS: $Id: basicshell.U,v 3.0 1993/08/18 12:05:25 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: basicshell.U,v $ +?RCS: Revision 3.0 1993/08/18 12:05:25 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?MAKE:basicshell: Getfile Oldconfig bash csh ksh sh +?MAKE: -pick add $@ %< +?S:basicshell: +?S: This variable contains the eventual value of the BASICSHELL symbol, +?S: which contains the full name of the basic script shell on this +?S: system. Usual values are /bin/sh, /bin/ksh, /bin/csh. +?S:. +?C:BASICSHELL: +?C: This symbol contains the full name of the basic script shell on this +?C: system. Usual values are /bin/sh, /bin/ksh, /bin/csh. +?C:. +?H:#define BASICSHELL "$basicshell" /**/ +?H:. +: find the most basic shell for scripts +echo " " +case "$basicshell" in +'') + case "$sh $bash $csh $ksh" in + */sh*) dflt="$sh" ;; + */ksh*) dflt="$ksh" ;; + */csh*) dflt="$csh" ;; + */bash*) dflt="$bash" ;; + *) dflt='/bin/sh' ;; + esac + ;; +*) + dflt="$basicshell";; +esac +fn=f +rp="Give the full path name of the most basic shell used on your system" +. ./getfile +basicshell=$ans + diff --git a/mcon/U/bin.U b/mcon/U/bin.U new file mode 100644 index 0000000..26ec89d --- /dev/null +++ b/mcon/U/bin.U @@ -0,0 +1,88 @@ +?RCS: $Id: bin.U,v 3.0.1.4 1995/09/25 09:15:32 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: bin.U,v $ +?RCS: Revision 3.0.1.4 1995/09/25 09:15:32 ram +?RCS: patch59: unit is now forced to the top of Configure, if possible +?RCS: +?RCS: Revision 3.0.1.3 1995/01/30 14:32:40 ram +?RCS: patch49: can now handle installation prefix changes (from WED) +?RCS: +?RCS: Revision 3.0.1.2 1994/08/29 16:05:28 ram +?RCS: patch32: now uses installation prefix +?RCS: +?RCS: Revision 3.0.1.1 1993/09/13 15:56:51 ram +?RCS: patch10: made prompting more explicit (WAD) +?RCS: +?RCS: Revision 3.0 1993/08/18 12:05:26 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?MAKE:bin binexp installbin: Prefixit Getfile Oldconfig afs cat test +?MAKE: -pick add $@ %< +?Y:TOP +?S:bin: +?S: This variable holds the name of the directory in which the user wants +?S: to put publicly executable images for the package in question. It +?S: is most often a local directory such as /usr/local/bin. Programs using +?S: this variable must be prepared to deal with ~name substitution. +?S:. +?S:binexp: +?S: This is the same as the bin variable, but is filename expanded at +?S: configuration time, for use in your makefiles. +?S:. +?S:installbin: +?S: This variable is the same as binexp unless AFS is running in which case +?S: the user is explicitely prompted for it. This variable should always +?S: be used in your makefiles for maximum portability. +?S:. +?C:BIN: +?C: This symbol holds the path of the bin directory where the package will +?C: be installed. Program must be prepared to deal with ~name substitution. +?C:. +?C:BIN_EXP: +?C: This symbol is the filename expanded version of the BIN symbol, for +?C: programs that do not want to deal with that at run-time. +?C:. +?H:#define BIN "$bin" /**/ +?H:#define BIN_EXP "$binexp" /**/ +?H:. +?D:bin='/usr/local/bin' +: determine where public executables go +echo " " +set dflt bin bin +eval $prefixit +fn=d~ +rp='Pathname where the public executables will reside?' +. ./getfile +if $test "X$ansexp" != "X$binexp"; then + installbin='' +fi +bin="$ans" +binexp="$ansexp" +if $afs; then + $cat <&4 + $cat >try.c <<'EOCP' +#include +?X: Standard C requires a macro CHAR_BIT in +#ifdef __STDC__ +#include +#ifndef CHAR_BIT +#define CHAR_BIT 8 +#endif +#ifndef BITSPERBYTE +#define BITSPERBYTE CHAR_BIT +#endif +#else +?X: On non standard C, try with +#include +#ifndef BITSPERBYTE +#define BITSPERBYTE 8 +#endif +#endif +main() +{ + printf("%d\n", BITSPERBYTE); +} +EOCP + if $cc $ccflags try.c -o try >/dev/null 2>&1 ; then + dflt=`./try` + else + dflt='8' + echo "(I can't seem to compile the test program. Guessing...)" + fi + ;; +*) + dflt="$bitpbyte" + ;; +esac +rp="What is the length of a byte (in bits)?" +. ./myread +bitpbyte="$ans" +$rm -f try.c try + diff --git a/mcon/U/byteorder.U b/mcon/U/byteorder.U new file mode 100644 index 0000000..1ef79f8 --- /dev/null +++ b/mcon/U/byteorder.U @@ -0,0 +1,99 @@ +?RCS: $Id: byteorder.U,v 3.0.1.2 1997/02/28 15:24:55 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: byteorder.U,v $ +?RCS: Revision 3.0.1.2 1997/02/28 15:24:55 ram +?RCS: patch61: no longer ask the user if the test runs ok +?RCS: +?RCS: Revision 3.0.1.1 1994/10/29 16:02:58 ram +?RCS: patch36: added ?F: line for metalint file checking +?RCS: +?RCS: Revision 3.0 1993/08/18 12:05:28 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?MAKE:byteorder: cat Myread Oldconfig Loc +cc +ccflags rm +?MAKE: -pick add $@ %< +?S:byteorder: +?S: This variable holds the byte order. In the following, larger digits +?S: indicate more significance. The variable byteorder is either 4321 +?S: on a big-endian machine, or 1234 on a little-endian, or 87654321 +?S: on a Cray ... or 3412 with weird order ! +?S:. +?C:BYTEORDER: +?C: This symbol hold the hexadecimal constant defined in byteorder, +?C: i.e. 0x1234 or 0x4321, etc... +?C:. +?H:#define BYTEORDER 0x$byteorder /* large digits for MSB */ +?H:. +?T:xxx_prompt +?F:!try +: check for ordering of bytes in a long +case "$byteorder" in +'') + $cat <<'EOM' + +In the following, larger digits indicate more significance. A big-endian +machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A +little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other +machines may have weird orders like 3412. A Cray will report 87654321. If +the test program works the default is probably right. +I'm now running the test program... +EOM + $cat >try.c <<'EOCP' +#include +main() +{ + int i; + union { + unsigned long l; + char c[sizeof(long)]; + } u; + + if (sizeof(long) > 4) + u.l = (0x08070605L << 32) | 0x04030201L; + else + u.l = 0x04030201L; + for (i = 0; i < sizeof(long); i++) + printf("%c", u.c[i]+'0'); + printf("\n"); + exit(0); +} +EOCP + xxx_prompt=y + if $cc $ccflags try.c -o try >/dev/null 2>&1 && ./try > /dev/null; then + dflt=`./try` + case "$dflt" in + [1-4][1-4][1-4][1-4]|12345678|87654321) + echo "(The test program ran ok.)" + echo "byteorder=$dflt" + xxx_prompt=n + ;; + ????|????????) echo "(The test program ran ok.)" ;; + *) echo "(The test program didn't run right for some reason.)" ;; + esac + else + dflt='4321' + cat <<'EOM' +(I can't seem to compile the test program. Guessing big-endian...) +EOM + fi + case "$xxx_prompt" in + y) + rp="What is the order of bytes in a long?" + . ./myread + byteorder="$ans" + ;; + *) byteorder=$dflt + ;; + esac + ;; +esac +$rm -f try.c try + diff --git a/mcon/U/cc.U b/mcon/U/cc.U new file mode 100644 index 0000000..0c63735 --- /dev/null +++ b/mcon/U/cc.U @@ -0,0 +1,129 @@ +?RCS: $Id: cc.U,v 3.0.1.4 1995/05/12 12:06:47 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: cc.U,v $ +?RCS: Revision 3.0.1.4 1995/05/12 12:06:47 ram +?RCS: patch54: may now abort Configure when cc does not work +?RCS: +?RCS: Revision 3.0.1.3 1995/01/11 15:20:11 ram +?RCS: patch45: changed gcc checking message to a more explicit one (WED) +?RCS: +?RCS: Revision 3.0.1.2 1994/10/29 16:04:29 ram +?RCS: patch36: detect gcc even when not called as 'gcc' (ADO) +?RCS: patch36: simplified gcc version checking (ADO) +?RCS: patch36: added ?F: line for metalint file checking +?RCS: +?RCS: Revision 3.0.1.1 1994/05/06 14:26:06 ram +?RCS: patch23: added support for gcc version (ADO) +?RCS: +?RCS: Revision 3.0 1993/08/18 12:05:30 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?MAKE:cc gccversion: cat contains sysman +large cpp rm \ + Mcc Myread Guess Options Oldconfig Loc +?MAKE: -pick add $@ %< +?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:. +?S:gccversion: +?S: If GNU cc (gcc) is used, this variable holds '1' or '2' to +?S: indicate whether the compiler is version 1 or 2. This is used in +?S: setting some of the default cflags. It is set to '' if not gcc. +?S:. +?F:!gccvers +?D:cc='cc' +?D:gccversion='' +?LINT:change cpp +: 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 +?X: Check if they have gcc in any guise. This is really only needed +?X: if the user has version 1.x.x and needs -fpcc-struct-return. Alas +?X: BSD/386 ships a version of gcc 1.4.2 and calls it cc. Hence the +?X: paranoid test -- ADO. +echo " " +echo "Checking for GNU cc in disguise and/or its version number..." >&4 +$cat >gccvers.c < +int main() { +#ifdef __GNUC__ +#ifdef __VERSION__ + printf("%s\n", __VERSION__); +#else + printf("%s\n", "1"); +#endif +#endif + exit(0); +} +EOM +if $cc -o gccvers gccvers.c >/dev/null 2>&1; then + gccversion=`./gccvers` + case "$gccversion" in + '') echo "You are not using GNU cc." ;; + *) echo "You are using GNU cc $gccversion." ;; + esac +else + echo " " + echo "*** WHOA THERE!!! ***" >&4 + echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4 +?X: using -K will prevent aborting--maybe they're cross compiling? + case "$knowitall" in + '') + echo " You'd better start hunting for one and let me know about it." >&4 + exit 1 + ;; + esac +fi +$rm -f gccvers* +case "$gccversion" in +1*) cpp=`./loc gcc-cpp $cpp $pth` ;; +esac + diff --git a/mcon/U/ccflags.U b/mcon/U/ccflags.U new file mode 100644 index 0000000..dc8beb7 --- /dev/null +++ b/mcon/U/ccflags.U @@ -0,0 +1,399 @@ +?RCS: $Id: ccflags.U,v 3.0.1.9 1997/02/28 15:27:07 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: ccflags.U,v $ +?RCS: Revision 3.0.1.9 1997/02/28 15:27:07 ram +?RCS: patch61: removed support for NO_PROTOTYPE detection on SCO +?RCS: patch61: new locincpth variable +?RCS: patch61: added info on the "additional ld flags" question +?RCS: +?RCS: Revision 3.0.1.8 1995/07/25 13:48:54 ram +?RCS: patch56: re-arranged compile line to include ldflags before objects +?RCS: +?RCS: Revision 3.0.1.7 1995/05/12 12:08:33 ram +?RCS: patch54: now checks for cc/ccflags/ldflags coherency +?RCS: +?RCS: Revision 3.0.1.6 1994/10/29 16:07:02 ram +?RCS: patch36: gcc versionning no longer relies on the C compiler's name +?RCS: patch36: simplified check for gcc version checking (ADO) +?RCS: +?RCS: Revision 3.0.1.5 1994/08/29 16:06:35 ram +?RCS: patch32: propagate -posix flag from ccflags to ldflags +?RCS: +?RCS: Revision 3.0.1.4 1994/05/06 14:28:45 ram +?RCS: patch23: -fpcc-struct-return only needed in gcc 1.x (ADO) +?RCS: patch23: cppflags now computed on an option-by-option basis +?RCS: patch23: magically added cc flags now only done the first time +?RCS: +?RCS: Revision 3.0.1.3 1993/09/13 15:58:29 ram +?RCS: patch10: explicitely mention -DDEBUG just in case they need it (WAD) +?RCS: patch10: removed all the "tans" variable usage (WAD) +?RCS: +?RCS: Revision 3.0.1.2 1993/08/27 14:39:38 ram +?RCS: patch7: added support for OSF/1 machines +?RCS: +?RCS: Revision 3.0.1.1 1993/08/25 14:00:24 ram +?RCS: patch6: added defaults for cppflags, ccflags and ldflags +?RCS: +?RCS: Revision 3.0 1993/08/18 12:05:31 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?MAKE:ccflags ldflags lkflags cppflags optimize locincpth: test cat \ + Myread Guess Options Oldconfig +gccversion mips_type +usrinc \ + package contains rm +cc cppstdin cppminus cpprun cpplast libpth \ + loclibpth hint +?MAKE: -pick add $@ %< +?S:ccflags: +?S: This variable contains any additional C compiler flags desired by +?S: the user. It is up to the Makefile to use this. +?S:. +?S:cppflags: +?S: This variable holds the flags that will be passed to the C pre- +?S: processor. It is up to the Makefile to use it. +?S:. +?S:optimize: +?S: This variable contains any optimizer/debugger flag that should be used. +?S: It is up to the Makefile to use it. +?S:. +?S:ldflags: +?S: This variable contains any additional C loader flags desired by +?S: the user. It is up to the Makefile to use this. +?S:. +?S:lkflags: +?S: This variable contains any additional C partial linker flags desired by +?S: the user. It is up to the Makefile to use this. +?S:. +?S:locincpth: +?S: This variable contains a list of additional directories to be +?S: searched by the compiler. The appropriate -I directives will +?S: be added to ccflags. This is intended to simplify setting +?S: local directories from the Configure command line. +?S: It's not much, but it parallels the loclibpth stuff in libpth.U. +?S:. +?T:inctest thisincl xxx flag inclwanted ftry previous thislibdir +?D:cppflags='' +?D:ccflags='' +?D:ldflags='' +?D:optimize='' +?INIT:: Possible local include directories to search. +?INIT:: Set locincpth to "" in a hint file to defeat local include searches. +?INIT:locincpth="/usr/local/include /opt/local/include /usr/gnu/include" +?INIT:locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include" +?INIT:: +?INIT:: no include file wanted by default +?INIT:inclwanted='' +?INIT: +: determine optimize, if desired, or use for debug flag also +case "$optimize" in +' ') dflt='none';; +'') dflt='-O';; +*) dflt="$optimize";; +esac +$cat </dev/null 2>&1 + then + dflt="$dflt -posix" + fi + ;; + esac + ;; +esac + +?X: In USG mode, a MIPS system may need some BSD includes +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 + +?X: Include test function (header, symbol) +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' + +?X: +?X: OSF/1 uses __LANGUAGE_C__ instead of LANGUAGE_C +?X: +if ./osf1; then + set signal.h __LANGUAGE_C__; eval $inctest +else + set signal.h LANGUAGE_C; eval $inctest +fi + +case "$hint" in +none|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 +?X: +?X: For each cc flag, try it out with both cppstdin and cpprun, since the +?X: first is almost surely a cc wrapper. We have to try both in case +?X: of cc flags like '-Olimit 2900' that are actually two words... +?X: + 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' ;; +esac + +$cat <&4 +?X: Strip extra blanks in case some of the following variables are empty +set X $cc $optimize $ccflags $ldflags try.c -o try +shift +$cat >try.msg < try.c <<'EOF' +#include +main() { exit(0); } +EOF +dflt=y +?X: Use "sh -c" to avoid error messages tagged with leading "Configure:". +?X: We need to try the resulting executable, because cc might yield a 0 status +?X: even when ld failed, in which case the executable will not run properly, +?X: if its x bit is set at all... +if sh -c "$cc $optimize $ccflags try.c -o try $ldflags" >>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 +?X: using -K will prevent default aborting--maybe they're cross compiling? + 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 + diff --git a/mcon/U/cf_email.U b/mcon/U/cf_email.U new file mode 100644 index 0000000..979cfd4 --- /dev/null +++ b/mcon/U/cf_email.U @@ -0,0 +1,57 @@ +?RCS: $Id: cf_email.U,v 3.0.1.1 1994/01/24 14:05:06 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.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 +$cat < +?RCS: +?RCS: $Log: cf_name.U,v $ +?RCS: Revision 3.0.1.2 1994/05/06 14:29:36 ram +?RCS: patch23: fixed user name computation from /etc/passwd in bsd systems +?RCS: +?RCS: Revision 3.0.1.1 1994/01/24 14:05:11 ram +?RCS: patch16: created +?RCS: +?RCS: +?MAKE:+cf_name: cf_by passcat Filexp nametype cat test +?MAKE: -pick add $@ %< +?S:cf_name: +?S: Full name of the person who ran the Configure script and answered the +?S: questions. This can be used by units that require the user's full name. +?S: This variable is for internal use only. +?S:. +?T:xxx fn NAME +: figure out their full name +case "$NAME" in +'') case "$nametype" in + other) + fn=`./filexp ~/.fullname` + xxx=usg + $test -f $fn && xxx=other + ;; + *) + xxx="$nametype" + ;; + esac + + case "$xxx" in + bsd) + cf_name=`$passcat | grep "^$cf_by:" | \ + sed -e 's/^[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\):.*/\1/' \ + -e 's/,.*//'` + ;; + usg) + cf_name=`$passcat | grep "^$cf_by:" | \ + sed -e 's/^[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\):.*/\1/' \ + -e 's/[^-]*-\(.*\)(.*)/\1/'` + ;; + *) + cf_name=`$cat $fn` + ;; + esac + ;; +*) + cf_name="$NAME" + ;; +esac +?X: +?X: In the original unit, Graham asked for the user name, in case the above +?X: code was unable to figure it out correctly. Since now cf_name has been +?X: made an internal variable only (i.e. it is not saved in config.sh), letting +?X: the user override the computed default each time would be a pain. +?X: Therefore, I have decided to trust the above code to get it right, and for +?X: those rare cases where it will fail, too bad :-) --RAM. +?X: +echo " " +echo "Pleased to meet you, $cf_name." + diff --git a/mcon/U/cf_who.U b/mcon/U/cf_who.U new file mode 100644 index 0000000..7c7deac --- /dev/null +++ b/mcon/U/cf_who.U @@ -0,0 +1,60 @@ +?RCS: $Id: cf_who.U,v 3.0.1.2 1997/02/28 15:28:50 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: cf_who.U,v $ +?RCS: Revision 3.0.1.2 1997/02/28 15:28:50 ram +?RCS: patch61: new computation method avoiding use of temporary file +?RCS: +?RCS: Revision 3.0.1.1 1994/05/06 14:42:34 ram +?RCS: patch23: login name now computed the hard way +?RCS: +?RCS: Revision 3.0 1993/08/18 12:05:32 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?X: +?X: Oldconfig dependency is there to ensure computation occurs after old values +?X: from config.sh have been loaded, so that we can supersede them. +?X: +?MAKE:cf_time cf_by: date Oldconfig +?MAKE: -pick add $@ %< +?S:cf_time: +?S: Holds the output of the "date" command when the configuration file was +?S: produced. This is used to tag both config.sh and config_h.SH. +?S:. +?S:cf_by: +?S: Login name of the person who ran the Configure script and answered the +?S: questions. This is used to tag both config.sh and config_h.SH. +?S:. +: who configured the system +cf_time=`$date 2>&1` +?X: +?X: Leave a white space between first two '(' for ksh. The sub-shell is needed +?X: on some machines to avoid the error message when logname is not found; e.g. +?X: on SUN-OS 3.2, (logname || whoami) would not execute whoami if logname was +?X: not found. Sigh! +?X: +?X: Convex had a broken logname executable which returned a non-zero status, +?X: and that broke the previous: +?X: cf_by=`( (logname) 2>/dev/null || whoami) 2>&1` +?X: Switch to emergency mode... -- RAM, 19/04/94 +?X: +?X: Parens needed to avoid error message if the program does not exist. +?X: Uses case instead of $test so it can be put before $test is defined. +?X: Don't redirect to a file because on Ultrix (under script?) logname +?X: outputs a blank line first. This method will apparently work. +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 + diff --git a/mcon/U/charorder.U b/mcon/U/charorder.U new file mode 100644 index 0000000..2731c61 --- /dev/null +++ b/mcon/U/charorder.U @@ -0,0 +1,143 @@ +?RCS: $Id: charorder.U,v 3.0.1.1 1994/10/29 16:07:08 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: charorder.U,v $ +?RCS: Revision 3.0.1.1 1994/10/29 16:07:08 ram +?RCS: patch36: added ?F: line for metalint file checking +?RCS: +?RCS: Revision 3.0 1993/08/18 12:05:33 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?MAKE:chorder_int chorder_short chorder_long: Myread cat +cc +ccflags rm +?MAKE: -pick add $@ %< +?S:chorder_short (d_cos d_bos): +?S: Holds the value describing the byte ordering of characters in a short. +?S: On a Big-Endian machine, that would be "c0c1". +?S:. +?S:chorder_int (charoder): +?S: Holds the value describing the byte ordering of characters in an int. +?S: For instance, on a Big-Endian machine, this would be: "c0c1c2c3". +?S:. +?S:chorder_long (d_col d_bol): +?S: Holds the value describing the byte ordering of characters in a long. +?S: On a 64 bits Big-Endian machine, that would yield: "c0c1c2c3c4c5c6c7". +?S:. +?C:CHAR_ORDER_SHORT: +?C: Holds the byte ordering of characters in a short. It's a string +?C: value like "c0c1" on a Big-Endian machine. +?C:. +?C:CHAR_ORDER_INT: +?C: Holds the byte ordering of characters in an int. It's a string +?C: value like "c0c1c2c3" on a Big-Endian machine. +?C:. +?C:CHAR_ORDER_LONG: +?C: Holds the byte ordering of characters in a long. It's a string +?C: value like "c0c1c2c3c4c5c6c7" on a 64 bits Big-Endian machine. +?C:. +?H:#define CHAR_ORDER_SHORT "$chorder_short" /* byte order in a short */ +?H:#define CHAR_ORDER_INT "$chorder_int" /* byte order in an int */ +?H:#define CHAR_ORDER_LONG "$chorder_long" /* byte order in a long */ +?H:. +?F:!byteorder +: check for character ordering +echo " " +echo "Checking out byte order..." >&4 +$cat >byteorder.c <<'EOCP' +#include + +main(argc, argv) + int argc; + char *argv[]; { + int i; + int max; + union { + short u_s; + int u_i; + long u_l; + char u_c[sizeof(long)]; + } u; + switch (argv[1][0]) { + case 'l': + u.u_l = 0L; + /* HMS: ASSERT: sizeof(long) < 10. */ + for(i = 0; i < sizeof(long); ++i) { + u.u_l *= 0x100L; + u.u_l += (0xc0 + i); + } + max = sizeof(long); + break; + case 's': + u.u_s = 0; + /* HMS: ASSERT: sizeof(short) < 10. */ + for(i = 0; i < sizeof(short); ++i) { + u.u_s *= 0x100L; + u.u_s += (0xc0 + i); + } + max = sizeof(short); + break; + case 'i': + u.u_i = 0; + /* RAM: ASSERT: sizeof(int) < 10. */ + for(i = 0; i < sizeof(int); ++i) { + u.u_l *= 0x100L; + u.u_l += (0xc0 + i); + } + max = sizeof(int); + break; + default: + max = 0; + break; + } + for(i = 0; i < max; i++) { + printf("%x", u.u_c[i] & 0x00FF); + } + printf("\n"); + exit(0); +} +EOCP +if $cc $ccflags -o byteorder byteorder.c >/dev/null 2>&1 ; then + : null statement +@if chorder_short + chorder_short=`./byteorder s` +@end +@if chorder_int + chorder_int=`./byteorder i` +@end +@if chorder_long + chorder_long=`./byteorder l` +@end +else + $cat <&4 + $cat >try.c <<'EOCP' +#include +main() +{ + printf("%d\n", sizeof(char)); +} +EOCP + if $cc $ccflags try.c -o try >/dev/null 2>&1 ; then + dflt=`./try` + else + dflt='1' + echo "(I can't seem to compile the test program. Guessing...)" + fi + ;; +*) + dflt="$charsize" + ;; +esac +rp="What is the size of a character (in bytes)?" +. ./myread +charsize="$ans" +$rm -f try.c try + diff --git a/mcon/U/contains.U b/mcon/U/contains.U new file mode 100644 index 0000000..7d9883a --- /dev/null +++ b/mcon/U/contains.U @@ -0,0 +1,43 @@ +?RCS: $Id: contains.U,v 3.0 1993/08/18 12:05:35 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: contains.U,v $ +?RCS: Revision 3.0 1993/08/18 12:05:35 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?MAKE:contains: Nothing +?MAKE: -pick add $@ %< +?S:contains: +?S: This variable holds the command to do a grep with a proper return +?S: status. On most sane systems it is simply "grep". On insane systems +?S: it is a grep followed by a cat followed by a test. This variable +?S: is primarily for the use of other Configure units. +?S:. +: 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 + diff --git a/mcon/U/cpp_stuff.U b/mcon/U/cpp_stuff.U new file mode 100644 index 0000000..67b16c6 --- /dev/null +++ b/mcon/U/cpp_stuff.U @@ -0,0 +1,118 @@ +?RCS: $Id: cpp_stuff.U,v 3.0.1.2 1997/02/28 15:30:48 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: cpp_stuff.U,v $ +?RCS: Revision 3.0.1.2 1997/02/28 15:30:48 ram +?RCS: patch61: added cute quoting trick for wild stringify support +?RCS: +?RCS: Revision 3.0.1.1 1994/10/29 16:08:24 ram +?RCS: patch36: now uses cppstdin instead of plain cpp for consistency (ADO) +?RCS: patch36: remove temporary files when done +?RCS: +?RCS: Revision 3.0 1993/08/18 12:05:36 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?MAKE:cpp_stuff: cat contains cppstdin cppflags cppminus rm +?MAKE: -pick add $@ %< +?S:cpp_stuff: +?S: This variable contains an identification of the catenation mechanism +?S: used by the C preprocessor. +?S:. +?C:CAT2: +?C: This macro catenates 2 tokens together. +?C:. +?C:CAT3: +?C: This macro catenates 3 tokens together. +?C:. +?C:CAT4: +?C: This macro catenates 4 tokens together. +?C:. +?C:CAT5: +?C: This macro catenates 5 tokens together. +?C:. +?C:STRINGIFY: +?C: This macro surrounds its token with double quotes. +?C:. +?C:SCAT2: +?C: This macro catenates 2 tokens together and stringifies the result. +?C:. +?C:SCAT3: +?C: This macro catenates 3 tokens together and stringifies the result. +?C:. +?C:SCAT4: +?C: This macro catenates 4 tokens together and stringifies the result. +?C:. +?C:SCAT5: +?C: This macro catenates 5 tokens together and stringifies the result. +?C:. +?H:?%<:#if $cpp_stuff == 1 +?H:?CAT2:#define CAT2(a,b)a/**/b +?H:?CAT3:#define CAT3(a,b,c)a/**/b/**/c +?H:?CAT4:#define CAT4(a,b,c,d)a/**/b/**/c/**/d +?H:?CAT5:#define CAT5(a,b,c,d,e)a/**/b/**/c/**/d/**/e +?H:?STRINGIFY:#define STRINGIFY(a)"a" +?H:?%<:#define SQuoTe(a)"a +?H:?%<:#define EQuoTe(a)a" +?H:?SCAT2:#define SCAT2(a,b)EQuoTe(SQuoTe(a)b) +?H:?SCAT3:#define SCAT3(a,b,c)EQuoTe(SQuoTe(a)b/**/c) +?H:?SCAT4:#define SCAT4(a,b,c,d)EQuoTe(SQuoTe(a)b/**/c/**/d) +?H:?SCAT5:#define SCAT5(a,b,c,d,e)EQuoTe(SQuoTe(a)b/**/c/**/d/**/e) +?H:?%<:#endif +?H:?%<:#if $cpp_stuff == 42 +?H:?CAT2:#define CAT2(a,b)a ## b +?H:?CAT3:#define CAT3(a,b,c)a ## b ## c +?H:?CAT4:#define CAT4(a,b,c,d)a ## b ## c ## d +?H:?CAT5:#define CAT5(a,b,c,d,e)a ## b ## c ## d ## e +?H:?%<:#define StGiFy(a)# a +?H:?STRINGIFY:#define STRINGIFY(a)StGiFy(a) +?H:?SCAT2:#define SCAT2(a,b)StGiFy(a) StGiFy(b) +?H:?SCAT3:#define SCAT3(a,b,c)StGiFy(a) StGiFy(b) StGiFy(c) +?H:?SCAT4:#define SCAT4(a,b,c,d)StGiFy(a) StGiFy(b) StGiFy(c) StGiFy(d) +?H:?SCAT5:#define SCAT5(a,b,c,d,e)StGiFy(a) StGiFy(b) StGiFy(c) StGiFy(d) StGiFy(e) +?H:?%<:#endif +?H:?%<:#if $cpp_stuff != 1 && $cpp_stuff != 42 +?H:?%<:#include "Bletch: How does this C preprocessor catenate tokens?" +?H:?%<:#endif +?H:. +?W:%<:CAT2 CAT3 CAT4 CAT5 STRINGIFY SCAT2 SCAT3 SCAT4 SCAT5 +?LINT:known StGiFy EQuoTe SQuoTe +: how do we catenate cpp tokens here? +echo " " +echo "Checking to see how your cpp does stuff like catenate tokens..." >&4 +$cat >cpp_stuff.c <<'EOCP' +#define RCAT(a,b)a/**/b +#define ACAT(a,b)a ## b +RCAT(Rei,ser) +ACAT(Cir,cus) +EOCP +$cppstdin $cppflags $cppminus cpp_stuff.out 2>&1 +if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then + echo "Oh! Smells like ANSI's been here." + echo "We can catify or stringify, separately or together!" + cpp_stuff=42 +elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then + $cat <&4 < +?RCS: +?RCS: $Log: cppfilecom.U,v $ +?RCS: Revision 3.0 1993/08/18 12:05:37 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?MAKE:cppfilecom cppstdinflags d_cppignhdrs d_cppcanstdin: \ + contains package test Myread Oldconfig Loc Setvar cpp cc cat rm +?MAKE: -pick add $@ %< +?S:cppfilecom: +?S: This variable contains the first part of the string which will invoke +?S: the C preprocessor a file and produce to standard output, preserving +?S: comments. Typical value of "cc -E -C" or "/lib/cpp -C". +?S:. +?S:cppstdinflags: +?S: This variable contains any flags necessary to get cppfilecom to read +?S: from the standard input. +?S:. +?S:d_cppignhdrs: +?S: This symbol conditionally defines CPP_IGN_HDRS if CPP_FILE_COM ignores +?S: *.h files. +?S:. +?S:d_cppcanstdin: +?S: This symbol conditionally defines CPP_CAN_STDIN if CPP_FILE_COM can +?S: read standard input directly. +?S:. +?C:CPP_FILE_COM (CPPFILECOM): +?C: This symbol contains the first part of the string which will invoke +?C: the C preprocessor a file and produce to standard output, preserving +?C: comments. Typical value of "cc -E -C" or "/lib/cpp -C". +?C:. +?C:CPP_STDIN_FLAGS (CPPSTDINFLAGS): +?C: This variable contains any flags necessary to get CPP_FILE_COM to +?C: read from the standard input. +?C:. +?C:CPP_IGN_HDRS (CPPIGNHDRS): +?C: This symbol is defined if CPP_FILE_COM ignores *.h files. +?C:. +?C:CPP_CAN_STDIN (CPPCANSTDIN): +?C: This symbol is defined if CPP_FILE_COM can read standard input +?C: directly. +?C:. +?H:#define CPP_FILE_COM "$cppfilecom" +?H:#define CPP_STDIN_FLAGS "$cppstdinflags" +?H:#$d_cppignhdrs CPP_IGN_HDRS /* does CPP ignore .h files? */ +?H:#$d_cppcanstdin CPP_CAN_STDIN /* can CPP read stdin directly? */ +?H:. +?T:cont +?LINT:set d_cppcanstdin d_cppignhdrs +: see how we invoke the C preprocessor +$cat <testcpp.c +#define ABC abc +#define XYZ xyz +ABC.XYZ +/* comment */ +EOT +: +if $test "X$cppfilecom" != "X" && \ + $cppfilecom testcpp.c testcpp.out 2>/dev/null && \ + $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 && \ + $contains comment testcpp.out >/dev/null 2>&1 +then + echo "You used to use $cppfilecom so we'll use that again." +elif echo 'Maybe "'$cc' -E -C" will work...' && \ + $cc -E -C testcpp.c testcpp.out 2>/dev/null && \ + $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 && \ + $contains comment testcpp.out >/dev/null 2>&1 +then + echo "It works!" + cppfilecom="$cc -E -C" +elif echo 'Nope...maybe "'"$cc"' -P -C" will work...' && \ + $cc -P -C testcpp.c testcpp.out 2>/dev/null && \ + $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 && \ + $contains comment testcpp.out >/dev/null 2>&1 +then + echo "Yup, that does." + cppfilecom="$cc -P -C" +elif echo 'No such luck, maybe "'"$cpp"' -C" will work...' && \ + $cpp -C testcpp.c testcpp.out 2>/dev/null && \ + $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 && \ + $contains comment testcpp.out >/dev/null 2>&1 +then + echo "Yup, it does." + cppfilecom="$cpp -C" +else + cppfilecom='' + $cat <<'EOM' +I can't find a C preprocessor that will preserve comments. Please name one. +EOM +fi +: +dflt="$cppfilecom" +cont=true +while $test "$cont" ; do + echo " " + rp="How should $package run your preprocessor preserving comments?" + . ./myread + cppfilecom="$ans" + $cppfilecom testcpp.c >testcpp.out 2>&1 + if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 && \ + $contains comment testcpp.out >/dev/null 2>&1 + then + echo "OK, that will do." + cont='' + else + echo "Sorry, I can't get that to work." + fi +done + +@if CPP_IGN_HDRS || d_cppignhdrs +: Now see if it ignores header files. +cp testcpp.c testcpp.h +$cppfilecom testcpp.h >testcpp.out 2>&1 +if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 && \ + $contains comment testcpp.out >/dev/null 2>&1 +then + echo "Terrific; it processes .h files passed on the command line too." + val="$undef" +else + echo "It ignores .h files on the command line; pity." + val="$define" +fi +set d_cppignhdrs +eval $setvar + +@end +@if CPP_STDIN_FLAGS || CPP_CAN_STDIN || cppstdinflags || d_cppcanstdin +: Now see how to send stdin to it. +echo " " +cp testcpp.c testcpp.h +$cppfilecom testcpp.out 2>&1 +if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 && \ + $contains comment testcpp.out >/dev/null 2>&1 +then + echo "Great; and it will read stdin if passed no arguments." + val="$define" + cppstdinflags='' +else + $cppfilecom - testcpp.out 2>&1 + if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 && \ + $contains comment testcpp.out >/dev/null 2>&1 + then + echo "Great; and it can read stdin by passing it '-'." + val="$define" + cppstdinflags='-' + else + $cat <testcpp.out 2>&1 + if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 && \ + $contains comment testcpp.out >/dev/null 2>&1 + then + echo "Good; that works fine." + val="$define" + cppstdinflags="$ans" + else + echo "Sorry, I couldn't get that to work." + fi + fi + done + fi +fi +set d_cppcanstdin +eval $setvar + +@end +: cleanup cpp test files anyway +$rm -f testcpp.* + diff --git a/mcon/U/cppstdin.U b/mcon/U/cppstdin.U new file mode 100644 index 0000000..7153ac3 --- /dev/null +++ b/mcon/U/cppstdin.U @@ -0,0 +1,235 @@ +?RCS: $Id: cppstdin.U,v 3.0.1.4 1994/10/29 16:08:34 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: cppstdin.U,v $ +?RCS: Revision 3.0.1.4 1994/10/29 16:08:34 ram +?RCS: patch36: added ?F: line for metalint file checking +?RCS: +?RCS: Revision 3.0.1.3 1994/01/24 14:05:38 ram +?RCS: patch16: comment for CPPLAST was missing +?RCS: +?RCS: Revision 3.0.1.2 1993/12/15 08:18:58 ram +?RCS: patch15: new variables cpprun and cpplast, guaranteed wrapper-free +?RCS: patch15: cppstdin now tries to use cc, even at the cost of a wrapper +?RCS: +?RCS: Revision 3.0.1.1 1993/08/25 14:00:53 ram +?RCS: patch6: remove wrapper when not actually used +?RCS: +?RCS: Revision 3.0 1993/08/18 12:05:38 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?MAKE:cppstdin cppminus cpprun cpplast: contains test Myread Oldconfig Loc \ + cpp +cc rm +?MAKE: -pick add $@ %< +?S:cppstdin: +?S: This variable contains the command which will invoke the C +?S: preprocessor on standard input and put the output to stdout. +?S: It is primarily used by other Configure units that ask about +?S: preprocessor symbols. +?S:. +?S:cppminus: +?S: This variable contains the second part of the string which will invoke +?S: the C preprocessor on the standard input and produce to standard +?S: output. This variable will have the value "-" if cppstdin needs a minus +?S: to specify standard input, otherwise the value is "". +?S:. +?S:cpprun: +?S: This variable contains the command which will invoke a C preprocessor +?S: on standard input and put the output to stdout. It is guaranteed not +?S: to be a wrapper and may be a null string if no preprocessor can be +?S: made directly available. This preprocessor might be different from the +?S: one used by the C compiler. Don't forget to append cpplast after the +?S: preprocessor options. +?S:. +?S:cpplast: +?S: This variable has the same functionality as cppminus, only it applies to +?S: cpprun and not cppstdin. +?S:. +?C:CPPSTDIN: +?C: This symbol contains the first part of the string which will invoke +?C: the C preprocessor on the standard input and produce to standard +?C: output. Typical value of "cc -E" or "/lib/cpp", but it can also +?C: call a wrapper. See CPPRUN. +?C:. +?C:CPPMINUS: +?C: This symbol contains the second part of the string which will invoke +?C: the C preprocessor on the standard input and produce to standard +?C: output. This symbol will have the value "-" if CPPSTDIN needs a minus +?C: to specify standard input, otherwise the value is "". +?C:. +?C:CPPRUN: +?C: This symbol contains the string which will invoke a C preprocessor on +?C: the standard input and produce to standard output. It needs to end +?C: with CPPLAST, after all other preprocessor flags have been specified. +?C: The main difference with CPPSTDIN is that this program will never be a +?C: pointer to a shell wrapper, i.e. it will be empty if no preprocessor is +?C: available directly to the user. Note that it may well be different from +?C: the preprocessor used to compile the C program. +?C:. +?C:CPPLAST: +?C: This symbol is intended to be used along with CPPRUN in the same manner +?C: symbol CPPMINUS is used with CPPSTDIN. It contains either "-" or "". +?C:. +?H:#define CPPSTDIN "$cppstdin" +?H:#define CPPMINUS "$cppminus" +?H:#define CPPRUN "$cpprun" +?H:#define CPPLAST "$cpplast" +?H:. +?F:cppstdin +?T:wrapper x_cpp x_minus ok +: 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 .. +echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin +chmod 755 cppstdin +wrapper=`pwd`/cppstdin +ok='false' +cd UU + +?X: +?X: We'll run the cpp tests again if we don't have any valid C preprocessor +?X: yet or don't know how to proceed without a wrapper (in which case cpprun +?X: is empty and that's really annoying...) +?X: +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" +?X: +?X: If /lib/cpp is used, try using a wrapper to increase our chances to have +?X: the C compiler and our $cppstdin agree on the same symbols... However, +?X: since cpprun is guaranteed not to be a wrapper, we must clear it if the +?X: only preprocessor we found was a wrapper, with all our luck... +?X: + 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") ;; +*) $rm -f $wrapper;; +esac +$rm -f testcpp.c testcpp.out + diff --git a/mcon/U/d_NOFILE.U b/mcon/U/d_NOFILE.U new file mode 100644 index 0000000..45ebabd --- /dev/null +++ b/mcon/U/d_NOFILE.U @@ -0,0 +1,189 @@ +?RCS: $Id: d_NOFILE.U,v 3.0.1.1 1994/10/29 16:08:38 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: d_NOFILE.U,v $ +?RCS: Revision 3.0.1.1 1994/10/29 16:08:38 ram +?RCS: patch36: added ?F: line for metalint file checking +?RCS: +?RCS: Revision 3.0 1993/08/18 12:05:39 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?MAKE:nofile d_gettblsz tablesize: Myread Guess libc cat +cc +ccflags +libs \ + test rm Csym +?MAKE: -pick add $@ %< +?S:nofile: +?S: This variable contains the number of file descriptors available to the +?S: process. +?S:. +?S:d_gettblsz: +?S: This variable conditionally handles remapping of the getdtablesize() +?S: subroutine to ulimit(4,0), or the NOFILE manifest constant. +?S:. +?S:tablesize: +?S: This variable contains either the 'NOFILE' constant or 'ulimit(4, 0L)' +?S: and is used as the remapped value for the getdtablesize() macro. +?S:. +?C:getdtablesize: +?C: This catches use of the getdtablesize() subroutine, and remaps it +?C: to either ulimit(4,0) or NOFILE, if getdtablesize() isn't available. +?C:. +?C:VAL_NOFILE: +?C: This symbol contains the number of file descriptors available to the +?C: process, as determined at configuration time. Unless a static constant +?C: is needed, you should rely on getdtablesize() to obtain that number. +?C:. +?H:#$d_gettblsz getdtablesize() $tablesize /**/ +?H:#define VAL_NOFILE $nofile /* Number of file descriptors */ +?H:. +?F:!nofile +?T:d_ulimit4 val +: see if getdtablesize exists +echo " " +?X: Revert logical value (d_gettblsz is undef iff getdtablesize is present) +case "$d_gettblsz" in +$define) d_gettblsz="$undef";; +$undef) d_gettblsz="$define";; +esac +if set getdtablesize val -f d_gettblsz; eval $csym; $val; then + echo 'getdtablesize() found.' >&4 + d_gettblsz="$undef" + tablesize='' +@if VAL_NOFILE || nofile + $cat >nofile.c <<'EOCP' +#include +main() +{ + printf("%d\n", getdtablesize()); +} +EOCP + nofile='' + if $cc $ccflags nofile.c -o nofile $libs >/dev/null 2>&1; then + nofile=`./nofile 2>/dev/null` + fi + if $test "$nofile"; then + echo "(You have $nofile file descriptors available per process.)" + else + nofile='20' + if ./bsd; then + nofile='64' + fi + echo "(Hmm... Let's say you have $nofile file descriptors available.)" + fi +@end +else + echo 'getdtablesize() NOT found...' >&4 + if set ulimit val -f; eval $csym; $val; then + echo 'Maybe ulimit(4,0) will work...' + $cat >nofile.c <<'EOCP' +#include +#ifdef GETPARAM_H +#include +#endif +main() +{ + printf("%d %d\n", +#ifdef NOFILE + NOFILE, +#else + 0, +#endif + ulimit(4,0)); + exit(0); +} +EOCP + if $cc $ccflags -DGETPARAM_H nofile.c -o nofile $libs >/dev/null 2>&1 \ + || $cc $ccflags nofile.c -o nofile $libs >/dev/null 2>&1 ; then + set `./nofile` + d_gettblsz=$1 + d_ulimit4=$2 + if $test "$d_ulimit4" -lt 0; then + echo "Your ulimit() call doesn't tell me what I want to know." + echo "We'll just use NOFILE in this case." + nofile=$d_gettblsz + d_gettblsz="$define" + tablesize='NOFILE' + else + if $test "$d_gettblsz" -gt 0; then + echo "Your system defines NOFILE to be $d_gettblsz, and" >&4 + else + echo "I had trouble getting NOFILE from your system, but" >&4 + fi +echo "ulimit returns $d_ulimit4 as the number of available file descriptors." >&4 + dflt='y'; + echo " " + rp='Should I use ulimit to get the number of available file descriptors?' + . ./myread + case "$ans" in + y*) + nofile=$d_ulimit4 + d_gettblsz="$define" + tablesize='ulimit(4, 0L)' + echo "Using ulimit(4,0)." + ;; + *) + nofile=$d_gettblsz + d_gettblsz="$define" + tablesize='NOFILE' + echo "Using NOFILE." + ;; + esac + fi + else + echo "Strange, I couldn't get my test program to compile." + echo "We'll just use NOFILE in this case." + d_gettblsz="$define" + tablesize='NOFILE' + nofile='' + fi + else + echo 'Using NOFILE instead.' + d_gettblsz="$define" + tablesize='NOFILE' + nofile='' + fi +fi +@if VAL_NOFILE || nofile +case "$nofile" in +'') + $cat >nofile.c <<'EOCP' +#include +#ifdef GETPARAM_H +#include +#endif +main() +{ + printf("%d\n", +#ifdef NOFILE + NOFILE, +#else + 0, +#endif + ); + exit(0); +} +EOCP + if $cc $ccflags -DGETPARAM_H nofile.c -o nofile $libs >/dev/null 2>&1 \ + || $cc $ccflags nofile.c -o nofile $libs >/dev/null 2>&1 ; then + nofile=`./nofile 2>/dev/null` + fi + if $test "$nofile"; then + echo "(You have $nofile file descriptors available per process.)" + else + nofile='20' + if ./bsd; then + nofile='64' + fi + echo "(Hmm... Let's say you have $nofile file descriptors available.)" + fi + ;; +esac +@end +$rm -f nofile* + diff --git a/mcon/U/d_NeWS.U b/mcon/U/d_NeWS.U new file mode 100644 index 0000000..687e01e --- /dev/null +++ b/mcon/U/d_NeWS.U @@ -0,0 +1,101 @@ +?RCS: $Id: d_NeWS.U,v 3.0 1993/08/18 12:05:39 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: d_NeWS.U,v $ +?RCS: Revision 3.0 1993/08/18 12:05:39 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?MAKE:d_news d_news0 d_newshome d_textcan: test rm Myread Getfile +?MAKE: -pick add $@ %< +?S:d_news: +?S: Set if running NeWS 1.1 +?S:. +?S:d_news0: +?S: Set if running NeWS 1.0 +?S:. +?S:d_newshome: +?S: Path to the top directory of the NeWS structure. +?S:. +?S:d_textcan: +?S: Path to where the textcan.ps stuff is... +?S:. +?C:HAS_NEWS1_1 (NEWS1_1): +?C: This symbol defined if running NeWS 1.1. +?C:. +?C:HAS_NEWS1_0 (NEWS1_0): +?C: This symbol defined if running NeWS 1.0. +?C:. +?C:TEXTCAN: +?C: Tells path to where the textcan.ps stuff is... +?C:. +?H:#$d_news HAS_NEWS1_1 /**/ +?H:#$d_news0 HAS_NEWS1_0 /**/ +?H:#define TEXTCAN $d_textcan /**/ +?H:. +?INIT:: default path for NeWS +?INIT:d_newshome="/usr/NeWS" +?INIT: +: Check to see what version of NeWS is being run? +cd .. +echo " " +echo "Now for the interesting stuff... Lets see what kind of NeWS" +echo "they grow round here...." +echo " " +dflt='y' +if $test -d $d_newshome; then + d_newshome=`(cd $d_newshome ; /bin/pwd)` + echo "Ah...found myself a NeWS in $d_newshome..." + dflt='y' + rp="Is this the NeWS you want your children to grow up with?" + . UU/myread +fi +while $test $ans = "n"; do +dflt=$d_newshome +fn=d +rp="Path to NeWS you want:" +. UU/getfile +d_newshome=$ans + +echo " " +if $test ! -d $d_newshome/lib; then + echo "ARG! No lib directory in $d_newshome!!!" + : heavy medicine. I wonder what the disease is... + $rm -f kit*isdone + $rm -rf UU + : bye bye + set -t; echo "Sorry... no NeWS is bad news..." +fi + +if $test -r $d_newshome/lib/NeWS/colors.ps ; then + echo 'Ahh... your running NeWS 1.1! Boy... that makes stuff easy....' + echo " " + d_news="$define" + d_news0="$undef" + if $test -r $d_newshome/lib/NeWS/textcan.ps; then + d_textcan=$d_newshome/lib/NeWS + echo "The textcan.ps stuff seems to be in : $d_textcan" + else + d_textcan=$d_newshome/clientsrc/client/nterm + if $test ! -r $d_textcan/textcan.ps; then + d_news="$undef" + d_news0="$define" + echo 'Hmm... must have been fooled... gotta be NeWS 1.1 beta!' + else + echo "The textcan.ps stuff seems to be in : $d_textcan" + fi + fi +else + echo 'snif... snif... I smell the dilapidated smell of NeWS 1.0..' + echo 'Some things will not work under NeWS 1.0...' + d_news="$undef" + d_news0="$define" +fi +cd UU + diff --git a/mcon/U/d_PORTAR.U b/mcon/U/d_PORTAR.U new file mode 100644 index 0000000..4be99b2 --- /dev/null +++ b/mcon/U/d_PORTAR.U @@ -0,0 +1,79 @@ +?RCS: $Id: d_PORTAR.U,v 3.0.1.1 1994/10/29 16:08:42 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: d_PORTAR.U,v $ +?RCS: Revision 3.0.1.1 1994/10/29 16:08:42 ram +?RCS: patch36: added ?F: line for metalint file checking +?RCS: +?RCS: Revision 3.0 1993/08/18 12:05:40 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?MAKE:d_PORTAR: cat +cc rm Setvar +?MAKE: -pick add $@ %< +?S:d_PORTAR: +?S: This variable conditionally handles definition of PORTAR, +?S: a creation of greater minds than I can imagine. +?S:. +?C:PORTAR: +?C: This manifest constant must be defined to 1 for some implementations +?C: of ar.h to get the portable ar most everybody uses. +?C:. +?L:ar_fmag: +?L:ARFMAG: +?L:SARMAG: +?H:#$d_PORTAR PORTAR 1 /**/ +?H:. +?F:!portar +?LINT:set d_PORTAR +: see if we need to define PORTAR +echo " " +echo 'Checking to see if we need to define PORTAR for portable archives...' >&4 +$cat >portar.c <<'EOCP' +#include +main() { + char *arfmag = ARFMAG; + int sarmag = SARMAG; + struct ar_hdr arh; + + strncpy(arh.ar_fmag, arfmag, 2); + +#ifdef PORTAR + printf("D\n"); +#else + printf("U\n"); +#endif + exit(0);} +EOCP +if $cc portar.c -o portar >/dev/null 2>&1 || \ + $cc -DPORTAR=1 portar.c -o portar >/dev/null 2>&1 ; then + case "`./portar`" in + D) + val="$define" + echo "We'll be defining PORTAR for you." + ;; + U) + val="$undef" + echo "We don't seem to need PORTAR defined here." + ;; + *) + val="$define" + echo "(My test program gave me an unexpected value!)" + echo "I'll just define PORTAR to be sure." + ;; + esac +else + echo "(Strange, I couldn't get my test program to compile.)" + echo "We'll just define PORTAR in this case." + val="$define" +fi +set d_PORTAR +eval $setvar +$rm -f portar* + diff --git a/mcon/U/d_SHM_MAC.U b/mcon/U/d_SHM_MAC.U new file mode 100644 index 0000000..78ea122 --- /dev/null +++ b/mcon/U/d_SHM_MAC.U @@ -0,0 +1,141 @@ +?RCS: $Id: d_SHM_MAC.U,v 3.0 1993/08/18 12:05:41 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: d_SHM_MAC.U,v $ +?RCS: Revision 3.0 1993/08/18 12:05:41 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?MAKE:d_SHM_MAC d_SHM_PRM d_SHM_SEG d_SHM_IMMU: cat d_shm test rm +cc +ccflags +?MAKE: -pick add $@ %< +?S:d_SHM_MAC: +?S: Sometimes, the SHMLBA manifest needs sys/sysmacros.h, usually for +?S: the ctob() macro. +?S:. +?S:d_SHM_PRM: +?S: Sometimes, the SHMLBA manifest needs sys/param.h, usually for the +?S: NBPC constant. +?S:. +?S:d_SHM_SEG: +?S: Sometimes, the SHMLBA manifest needs sys/seg.h, usually for the +?S: SNUMSHFT constant. +?S:. +?S:d_SHM_IMMU: +?S: Sometimes, the SHMLBA manifest needs sys/immu.h, usually for the +?S: stob() macro. +?S:. +?C:SHMLBA_WANTS_SYSMACROS: +?C: This value tells us to include because SHMLBA +?C: needs something from there, probably the ctob() macro. +?C:. +?C:SHMLBA_WANTS_PARAM: +?C: This value tells us to include because SHMLBA needs +?C: something from there, probably the NBPC constant. +?C:. +?C:SHMLBA_WANTS_SEG: +?C: This value tells us to include because SHMLBA needs +?C: something from there, probably the SNUMSHFT constant. +?C:. +?C:SHMLBA_WANTS_IMMU: +?C: This value tells us to include because SHMLBA needs +?C: something from there, probably the stob() macro. (tower_600 only?) +?C:. +?H:#$d_SHM_MAC SHMLBA_WANTS_SYSMACROS /* SHMLBA wants ctob()? */ +?H:#$d_SHM_PRM SHMLBA_WANTS_PARAM /* SHMLBA wants NBPC? */ +?H:#$d_SHM_SEG SHMLBA_WANTS_SEG /* SHMLBA wants SNUMSHFT? */ +?H:#$d_SHM_IMMU SHMLBA_WANTS_IMMU /* SHMLBA wants stob()? */ +?H:. +?T:flags D_sys_immu D_sys_seg D_sys_sysmacros D_sys_param +: check for SHMLBA braindamage +d_SHM_MAC="$undef" +d_SHM_PRM="$undef" +d_SHM_SEG="$undef" +d_SHM_IMMU="$undef" +if $test "$d_shm" = "$define" ; then + echo " " + $cat >&4 <shm_mac.c <<'EOCP' +#include +#include +#include +#ifdef I_SYS_IMMU +#include +#endif +#ifdef I_SYS_SYSMACROS +#include +#endif +#ifdef I_SYS_PARAM +#include +#endif +#ifdef I_SYS_SEG +#include +#endif + +main() { + int foo = SHMLBA ; + } +EOCP + flags='xxx' + for D_sys_immu in '' '-DI_SYS_IMMU'; do + for D_sys_seg in '' '-DI_SYS_SEG'; do + for D_sys_sysmacros in '' '-DI_SYS_SYSMACROS'; do + for D_sys_param in '' '-DI_SYS_PARAM'; do + case "$flags" in + 'xxx') + case "$D_sys_immu$D_sys_param$D_sys_sysmacros$D_sys_seg" in + '') + echo "Trying it normally..." + ;; + *) + echo "Trying $D_sys_immu $D_sys_param $D_sys_sysmacros $D_sys_seg" + ;; + esac + if $cc shm_mac.c $ccflags \ + $D_sys_immu $D_sys_param $D_sys_sysmacros $D_sys_seg \ + -o shm_mac >/dev/null 2>&1 ; then + set X $D_sys_immu $D_sys_param $D_sys_sysmacros $D_sys_seg + shift + flags="$*" + echo "Succeeded with $flags" + fi + ;; + esac + done + done + done + done + case "$flags" in + xxx) + echo "I don't know how to keep SHMLBA happy. Good luck!" + ;; + esac + case "$flags" in + *I_SYS_PARAM*) d_SHM_PRM="$define";; + esac + case "$flags" in + *I_SYS_SYSMACROS*) d_SHM_MAC="$define";; + esac + case "$flags" in + *I_SYS_SEG*) d_SHM_SEG="$define";; + esac + case "$flags" in + *I_SYS_IMMU*) d_SHM_IMMU="$define";; + esac +fi +$rm -f shm_mac* + diff --git a/mcon/U/d_access.U b/mcon/U/d_access.U new file mode 100644 index 0000000..ddef65f --- /dev/null +++ b/mcon/U/d_access.U @@ -0,0 +1,74 @@ +?RCS: $Id: d_access.U,v 3.0 1993/08/18 12:05:42 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: d_access.U,v $ +?RCS: Revision 3.0 1993/08/18 12:05:42 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?MAKE:d_access: test +cc cat +cppflags h_fcntl h_sysfile rm Inlibc Findhdr +?MAKE: -pick add $@ %< +?S:d_access: +?S: This variable conditionally defines HAS_ACCESS if the access() system +?S: call is available to check for access permissions using real IDs. +?S:. +?C:HAS_ACCESS: +?C: This manifest constant lets the C program know that the access() +?C: system call is available to check for accessibility using real UID/GID. +?C: (always present on UNIX.) +?C:. +?H:#$d_access HAS_ACCESS /**/ +?H:. +?W:%<:R_OK W_OK X_OK F_OK +?LINT:set d_access +?LINT:change h_fcntl h_sysfile +: access call always available on UNIX +set access d_access +eval $inlibc + +: locate the flags for 'access()' +case "$d_access" in +"$define") + echo " " + $cat >access.c <<'EOCP' +#include +#ifdef I_FCNTL +#include +#endif +#ifdef I_SYS_FILE +#include +#endif +#ifdef I_UNISTD +#include +#endif +main() { + exit(R_OK); +} +EOCP + : check sys/file.h first, no particular reason here + if $test `./findhdr sys/file.h` && \ + $cc $cppflags -DI_SYS_FILE access.c -o access >/dev/null 2>&1 ; then + h_sysfile=true; + echo " defines the *_OK access constants." >&4 + elif $test `./findhdr fcntl.h` && \ + $cc $cppflags -DI_FCNTL access.c -o access >/dev/null 2>&1 ; then + h_fcntl=true; + echo " defines the *_OK access constants." >&4 +@if I_UNISTD + elif $test `./findhdr unistd.h` && \ + $cc $cppflags -DI_UNISTD access.c -o access >/dev/null 2>&1 ; then + echo " defines the *_OK access constants." >&4 +@end + else + echo "I can't find the four *_OK access constants--I'll use mine." >&4 + fi + ;; +esac +$rm -f access* + diff --git a/mcon/U/d_alarm.U b/mcon/U/d_alarm.U new file mode 100644 index 0000000..db57207 --- /dev/null +++ b/mcon/U/d_alarm.U @@ -0,0 +1,33 @@ +?RCS: $Id: d_alarm.U,v 3.0.1.1 1994/08/29 16:06:58 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: Original Author: Andy Dougherty +?RCS: +?RCS: $Log: d_alarm.U,v $ +?RCS: Revision 3.0.1.1 1994/08/29 16:06:58 ram +?RCS: patch32: created by ADO +?RCS: +?MAKE:d_alarm: Inlibc +?MAKE: -pick add $@ %< +?S:d_alarm: +?S: This variable conditionally defines the HAS_ALARM symbol, which +?S: indicates to the C program that the alarm() routine is available. +?S:. +?C:HAS_ALARM : +?C: This symbol, if defined, indicates that the alarm routine is +?C: available. +?C:. +?H:#$d_alarm HAS_ALARM /**/ +?H:. +?LINT:set d_alarm +: see if alarm exists +set alarm d_alarm +eval $inlibc + diff --git a/mcon/U/d_attribut.U b/mcon/U/d_attribut.U new file mode 100644 index 0000000..bcd3ae1 --- /dev/null +++ b/mcon/U/d_attribut.U @@ -0,0 +1,64 @@ +?RCS: $Id: d_attribut.U,v 3.0.1.3 1995/01/30 14:33:45 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.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* + diff --git a/mcon/U/d_bcmp.U b/mcon/U/d_bcmp.U new file mode 100644 index 0000000..5090523 --- /dev/null +++ b/mcon/U/d_bcmp.U @@ -0,0 +1,44 @@ +?RCS: $Id: d_bcmp.U,v 3.0.1.2 1993/10/16 13:47:52 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: d_bcmp.U,v $ +?RCS: Revision 3.0.1.2 1993/10/16 13:47:52 ram +?RCS: patch12: added magic support for bcmp() +?RCS: +?RCS: Revision 3.0.1.1 1993/09/13 16:00:44 ram +?RCS: patch10: now only defines HAS_BCMP, no macro remap on memcmp (WAD) +?RCS: +?RCS: Revision 3.0 1993/08/18 12:05:42 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?MAKE:d_bcmp: Inlibc +?MAKE: -pick add $@ %< +?S:d_bcmp: +?S: This variable conditionally defines the HAS_BCMP symbol if +?S: the bcmp() routine is available to compare strings. +?S:. +?C:HAS_BCMP: +?C: This symbol is defined if the bcmp() routine is available to +?C: compare blocks of memory. +?C:. +?H:#$d_bcmp HAS_BCMP /**/ +?H:. +?M:bcmp: HAS_BCMP +?M:#ifndef HAS_BCMP +?M:#ifndef bcmp +?M:#define bcmp(s,d,l) memcmp((s),(d),(l)) +?M:#endif +?M:#endif +?M:. +?LINT:set d_bcmp +: see if bcmp exists +set bcmp d_bcmp +eval $inlibc + diff --git a/mcon/U/d_bcopy.U b/mcon/U/d_bcopy.U new file mode 100644 index 0000000..c373d29 --- /dev/null +++ b/mcon/U/d_bcopy.U @@ -0,0 +1,44 @@ +?RCS: $Id: d_bcopy.U,v 3.0.1.2 1993/10/16 13:48:04 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: d_bcopy.U,v $ +?RCS: Revision 3.0.1.2 1993/10/16 13:48:04 ram +?RCS: patch12: added magic support for bcopy() +?RCS: +?RCS: Revision 3.0.1.1 1993/09/13 16:01:11 ram +?RCS: patch10: now only defines HAS_BCOPY, no macro remap on memcpy (WAD) +?RCS: +?RCS: Revision 3.0 1993/08/18 12:05:44 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?MAKE:d_bcopy: Inlibc +?MAKE: -pick add $@ %< +?S:d_bcopy: +?S: This variable conditionally defines the HAS_BCOPY symbol if +?S: the bcopy() routine is available to copy strings. +?S:. +?C:HAS_BCOPY: +?C: This symbol is defined if the bcopy() routine is available to +?C: copy blocks of memory. +?C:. +?H:#$d_bcopy HAS_BCOPY /**/ +?H:. +?M:bcopy: HAS_BCOPY +?M:#ifndef HAS_BCOPY +?M:#ifndef bcopy +?M:#define bcopy(s,d,l) memcpy((d),(s),(l)) +?M:#endif +?M:#endif +?M:. +?LINT:set d_bcopy +: see if bcopy exists +set bcopy d_bcopy +eval $inlibc + diff --git a/mcon/U/d_brokstat.U b/mcon/U/d_brokstat.U new file mode 100644 index 0000000..29886f3 --- /dev/null +++ b/mcon/U/d_brokstat.U @@ -0,0 +1,72 @@ +?RCS: $Id: d_brokstat.U,v 3.0.1.1 1997/02/28 15:30:53 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: d_brokstat.U,v $ +?RCS: Revision 3.0.1.1 1997/02/28 15:30:53 ram +?RCS: patch61: created +?RCS: +?MAKE:d_brokstat: cat contains cppstdin cppminus +cppflags rm Setvar +?MAKE: -pick add $@ %< +?S:d_brokstat: +?S: This variable conditionally defines STAT_MACROS_BROKEN if some +?S: of the S_IS*() macros from give false positive on +?S: regular files. +?S:. +?C:STAT_MACROS_BROKEN: +?C: This symbol, if defined, indicates that the S_IS*() stat macros +?C: such as S_ISBLK() give false positive and are thus unusable. +?C: Your best bet is then to supply your own set. +?C:. +?H:#$d_brokstat STAT_MACROS_BROKEN /**/ +?H:. +?LINT:set d_brokstat +?X: This test inspired by autoconf -- RAM, 28/02/97 +echo " " +echo "Checking whether your stat() macros are broken..." +$cat >try.c <<'EOC' +#include +#include + +#if defined(S_ISBLK) && defined(S_IFDIR) +#if S_ISBLK(S_IFDIR) +Broken +#endif +#endif + +#if defined(S_ISBLK) && defined(S_IFCHR) +#if S_ISBLK(S_IFCHR) +Broken +#endif +#endif + +#if defined(S_ISLNK) && defined(S_IFREG) +#if S_ISLNK(S_IFREG) +Broken. +#endif +#endif + +#if defined(S_ISSOCK) && defined(S_IFREG) +#if S_ISSOCK(S_IFREG) +Broken. +#endif +#endif +EOC +$cppstdin $cppflags $cppminus /dev/null >try +if $contains Broken try >/dev/null 2>&1; then + echo "Alas, they are. I'll use my own macro set then." >&4 + val="$define" +else + echo "Nope, working just fine." >&4 + val="$undef" +fi +$rm -f try try.c +set d_brokstat +eval $setvar + diff --git a/mcon/U/d_bsdjmp.U b/mcon/U/d_bsdjmp.U new file mode 100644 index 0000000..61ed61c --- /dev/null +++ b/mcon/U/d_bsdjmp.U @@ -0,0 +1,86 @@ +?RCS: $Id: d_bsdjmp.U,v 3.0.1.2 1997/02/28 15:31:10 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: d_bsdjmp.U,v $ +?RCS: Revision 3.0.1.2 1997/02/28 15:31:10 ram +?RCS: patch61: added ?F: metalint hint +?RCS: +?RCS: Revision 3.0.1.1 1994/10/29 16:09:09 ram +?RCS: patch36: call ./usg explicitely instead of relying on PATH +?RCS: +?RCS: Revision 3.0 1993/08/18 12:05:45 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?MAKE:d_bsdjmp: Guess Setvar cat +cc libs rm +?MAKE: -pick add $@ %< +?S:d_bsdjmp: +?S: This variable conditionally defines USE_BSDJMP if BSD _setjmp and +?S: _longjmp routines are available to do non-local gotos without saving +?S: or restoring the signal mask flag. +?S:. +?C:USE_BSDJMP (BSDJMP): +?C: This symbol, if defined, indicates that the BSD _setjmp and _longjmp +?C: routines are available to do non-local gotos wihtout saving or restoring +?C: the signal mask flag. +?C:. +?H:#$d_bsdjmp USE_BSDJMP /**/ +?H:. +?F:!set +?LINT:set d_bsdjmp +: see if _setjmp and _longjmp exists +?X: We can't check for these symbols with Inlibc because of the leading "_" +echo " " +case "$d_bsdjmp" in +'') + $cat >set.c < +jmp_buf env; +int set = 1; +main() +{ + if (_setjmp(env)) + exit(set); + set = 0; + _longjmp(env, 1); + exit(1); +} +EOP + if $cc set.c -o set $libs >/dev/null 2>&1; then + if ./set >/dev/null 2>&1; then + echo "Good! You have BSD _setjmp and _longjmp routines." >&4 + val="$define" + else + $cat <&4 + else + cat <&4;; + $undef) echo "You do not have _setjmp and _longjmp, but that's fine." >&4;; + esac + ;; +esac +set d_bsdjmp +eval $setvar +$rm -f set.c set + diff --git a/mcon/U/d_byacc.U b/mcon/U/d_byacc.U new file mode 100644 index 0000000..75bfbf0 --- /dev/null +++ b/mcon/U/d_byacc.U @@ -0,0 +1,33 @@ +?RCS: $Id: d_byacc.U,v 3.0.1.1 1997/02/28 15:31:14 ram Exp $ +?RCS: +?RCS: Copyright (c) 1996, Andy Dougherty +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: d_byacc.U,v $ +?RCS: Revision 3.0.1.1 1997/02/28 15:31:14 ram +?RCS: patch61: created +?RCS: +?MAKE:d_byacc: byacc Setvar +?MAKE: -pick add $@ %< +?S:d_byacc: +?S: This variable indicates whether byacc is available. +?S: If the user has specified 'portability', then Makefile.SH +?S: sees $byacc='byacc' whether or not the user actually has +?S: byacc. This variable allows us to determine in a makefile +?S: if we really have byacc. +?S:. +?LINT:set d_byacc +: Check if we really have byacc +case "$byacc" in +''|'byacc') val="$undef" ;; +*) val="$define" ;; +esac +set d_byacc +eval $setvar + diff --git a/mcon/U/d_bzero.U b/mcon/U/d_bzero.U new file mode 100644 index 0000000..a891c26 --- /dev/null +++ b/mcon/U/d_bzero.U @@ -0,0 +1,44 @@ +?RCS: $Id: d_bzero.U,v 3.0.1.2 1993/10/16 13:48:15 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: d_bzero.U,v $ +?RCS: Revision 3.0.1.2 1993/10/16 13:48:15 ram +?RCS: patch12: added magic support for bzero() +?RCS: +?RCS: Revision 3.0.1.1 1993/09/13 16:01:33 ram +?RCS: patch10: now only defines HAS_BZERO, no macro remap on memset (WAD) +?RCS: +?RCS: Revision 3.0 1993/08/18 12:05:46 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?MAKE:d_bzero: Inlibc +?MAKE: -pick add $@ %< +?S:d_bzero: +?S: This variable conditionally defines the HAS_BZERO symbol if +?S: the bzero() routine is available to set memory to 0. +?S:. +?C:HAS_BZERO: +?C: This symbol is defined if the bzero() routine is available to +?C: set a memory block to 0. +?C:. +?H:#$d_bzero HAS_BZERO /**/ +?H:. +?M:bzero: HAS_BZERO +?M:#ifndef HAS_BZERO +?M:#ifndef bzero +?M:#define bzero(s,l) memset((s),0,(l)) +?M:#endif +?M:#endif +?M:. +?LINT:set d_bzero +: see if bzero exists +set bzero d_bzero +eval $inlibc + diff --git a/mcon/U/d_casti32.U b/mcon/U/d_casti32.U new file mode 100644 index 0000000..7a0a189 --- /dev/null +++ b/mcon/U/d_casti32.U @@ -0,0 +1,86 @@ +?RCS: $Id: d_casti32.U,v 3.0.1.3 1995/05/12 12:10:45 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: Original Author: Andy Dougherty +?RCS: +?RCS: $Log: d_casti32.U,v $ +?RCS: Revision 3.0.1.3 1995/05/12 12:10:45 ram +?RCS: patch54: made sure cc and ccflags are conditional dependencies +?RCS: +?RCS: Revision 3.0.1.2 1994/10/29 16:09:37 ram +?RCS: patch36: declare signal handler correctly (ADO) +?RCS: +?RCS: Revision 3.0.1.1 1994/08/29 16:07:06 ram +?RCS: patch32: created by ADO +?RCS: +?X: +?X: Can the compiler cast large floats to 32-bit integers? +?X: +?MAKE:d_casti32: cat +cc +ccflags rm intsize Setvar test signal_t +?MAKE: -pick add $@ %< +?S:d_casti32: +?S: This variable conditionally defines CASTI32, which indicates +?S: whether the C compiler can cast large floats to 32-bit ints. +?S:. +?C:CASTI32: +?C: This symbol is defined if the C compiler can cast negative +?C: or large floating point numbers to 32-bit ints. +?C:. +?T:xxx yyy +?H:#$d_casti32 CASTI32 /**/ +?H:. +?LINT:set d_casti32 +: check for ability to cast large floats to 32-bit ints. +echo " " +echo 'Checking whether your C compiler can cast large floats to int32.' >&4 +if $test "$intsize" -eq 4; then + xxx=int +else + xxx=long +fi +$cat >try.c < +#include +$signal_t blech() { exit(3); } +main() +{ + $xxx i32; + double f; + int result = 0; + signal(SIGFPE, blech); + + f = (double) 0x7fffffff; + f = 10 * f; + i32 = ($xxx) f; + + if (i32 != ($xxx) f) + result |= 1; + exit(result); +} +EOCP +if $cc -o try $ccflags try.c >/dev/null 2>&1; then + ./try + yyy=$? +else + echo "(I can't seem to compile the test program--assuming it can't)" + yyy=1 +fi +case "$yyy" in +0) val="$define" + echo "Yup, it can." + ;; +*) val="$undef" + echo "Nope, it can't." + ;; +esac +set d_casti32 +eval $setvar +$rm -f try try.* + diff --git a/mcon/U/d_castneg.U b/mcon/U/d_castneg.U new file mode 100644 index 0000000..815003f --- /dev/null +++ b/mcon/U/d_castneg.U @@ -0,0 +1,142 @@ +?RCS: $Id: d_castneg.U,v 3.0.1.2 1995/05/12 12:11:21 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: d_castneg.U,v $ +?RCS: Revision 3.0.1.2 1995/05/12 12:11:21 ram +?RCS: patch54: made sure cc and ccflags are conditional dependencies +?RCS: patch54: added improved test case for Interactive Unix +?RCS: +?RCS: Revision 3.0.1.1 1994/10/29 16:10:50 ram +?RCS: patch36: don't forget to tell user about compilation failures (ADO) +?RCS: patch36: declare signal handler correctly using 'signal_t' (ADO) +?RCS: +?RCS: Revision 3.0 1993/08/18 12:05:47 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?X: +?X: Can the compiler cast negative / odd floats to unsigned values. +?X: +?MAKE:d_castneg castflags: cat +cc +ccflags rm Setvar signal_t +?MAKE: -pick add $@ %< +?S:d_castneg: +?S: This variable conditionally defines CASTNEG, which indicates +?S: wether the C compiler can cast negative float to unsigned. +?S:. +?S:castflags: +?S: This variable contains a flag that precise difficulties the +?S: compiler has casting odd floating values to unsigned long: +?S: 0 = ok +?S: 1 = couldn't cast < 0 +?S: 2 = couldn't cast >= 0x80000000 +?S: 4 = couldn't cast in argument expression list +?S:. +?C:CASTNEGFLOAT: +?C: This symbol is defined if the C compiler can cast negative +?C: numbers to unsigned longs, ints and shorts. +?C:. +?C:CASTFLAGS: +?C: This symbol contains flags that say what difficulties the compiler +?C: has casting odd floating values to unsigned long: +?C: 0 = ok +?C: 1 = couldn't cast < 0 +?C: 2 = couldn't cast >= 0x80000000 +?C: 4 = couldn't cast in argument expression list +?C:. +?H:#$d_castneg CASTNEGFLOAT /**/ +?H:#define CASTFLAGS $castflags /**/ +?H:. +?LINT:set d_castneg +: check for ability to cast negative floats to unsigned +echo " " +echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4 +$cat >try.c < +#include +$signal_t blech() { exit(7); } +$signal_t blech_in_list() { exit(4); } +unsigned long dummy_long(p) unsigned long p; { return p; } +unsigned int dummy_int(p) unsigned int p; { return p; } +unsigned short dummy_short(p) unsigned short p; { return p; } +main() +{ + double f = -123.; + unsigned long along; + unsigned int aint; + unsigned short ashort; + int result = 0; + + signal(SIGFPE, blech); + along = (unsigned long)f; + aint = (unsigned int)f; + ashort = (unsigned short)f; + if (along != (unsigned long)-123) + result |= 1; + if (aint != (unsigned int)-123) + result |= 1; + if (ashort != (unsigned short)-123) + result |= 1; + f = (double)0x40000000; + f = f + f; + along = 0; + along = (unsigned long)f; + if (along != 0x80000000) + result |= 2; + f -= 1.; + along = 0; + along = (unsigned long)f; + if (along != 0x7fffffff) + result |= 1; + f += 2.; + along = 0; + along = (unsigned long)f; + if (along != 0x80000001) + result |= 2; + if (result) + exit(result); +?X: +?X: The following is a test for Interactive Unix Version 4.1, which +?X: has an 'improved' compiler which can correctly cast negative +?X: floats in expression lists, but apparently not in argument lists. +?X: Contributed by Winfried Koenig +?X: + signal(SIGFPE, blech_in_list); + f = 123.; + along = dummy_long((unsigned long)f); + aint = dummy_int((unsigned int)f); + ashort = dummy_short((unsigned short)f); + if (along != (unsigned long)123) + result |= 4; + if (aint != (unsigned int)123) + result |= 4; + if (ashort != (unsigned short)123) + result |= 4; + exit(result); + +} +EOCP +if $cc -o try $ccflags try.c >/dev/null 2>&1; then + ./try + castflags=$? +else + echo "(I can't seem to compile the test program--assuming it can't)" + castflags=7 +fi +case "$castflags" in +0) val="$define" + echo "Yup, it can." + ;; +*) val="$undef" + echo "Nope, it can't." + ;; +esac +set d_castneg +eval $setvar +$rm -f try.* + diff --git a/mcon/U/d_cbrt.U b/mcon/U/d_cbrt.U new file mode 100644 index 0000000..a245789 --- /dev/null +++ b/mcon/U/d_cbrt.U @@ -0,0 +1,32 @@ +?RCS: $Id: d_cbrt.U,v 3.0 1993/08/18 12:05:48 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: d_cbrt.U,v $ +?RCS: Revision 3.0 1993/08/18 12:05:48 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?MAKE:d_cbrt: Inlibc +?MAKE: -pick add $@ %< +?S:d_cbrt: +?S: This variable conditionally defines the CBRT symbol, which +?S: indicates to the C program that the cbrt() (cube root) function +?S: is available. +?S:. +?C:HAS_CBRT (CBRT): +?C: This symbol, if defined, indicates that the cbrt() (cube root) +?C: function is available. +?C:. +?H:#$d_cbrt HAS_CBRT /**/ +?H:. +?LINT:set d_cbrt +: see if cbrt exists +set cbrt d_cbrt +eval $inlibc + diff --git a/mcon/U/d_charsprf.U b/mcon/U/d_charsprf.U new file mode 100644 index 0000000..473ba97 --- /dev/null +++ b/mcon/U/d_charsprf.U @@ -0,0 +1,51 @@ +?RCS: $Id: d_charsprf.U,v 3.0 1993/08/18 12:05:49 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: d_charsprf.U,v $ +?RCS: Revision 3.0 1993/08/18 12:05:49 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?MAKE:d_charsprf: cat rm +cc Setvar +?MAKE: -pick add $@ %< +?S:d_charsprf: +?S: This variable conditionally defines CHARSPRINTF if this system +?S: declares "char *sprintf()" in stdio.h. The trend seems to be to +?S: declare it as "int sprintf()". +?S:. +?C:CHARSPRINTF: +?C: This symbol is defined if this system declares "char *sprintf()" in +?C: stdio.h. The trend seems to be to declare it as "int sprintf()". It +?C: is up to the package author to declare sprintf correctly based on the +?C: symbol. +?C:. +?H:#$d_charsprf CHARSPRINTF /**/ +?H:. +?LINT:set d_charsprf +: see if sprintf is declared as int or pointer to char +echo " " +$cat >ucbsprf.c <<'EOF' +main() +{ + int sprintf(); + char buf[10]; + exit((unsigned long)sprintf(buf,"%s","foo") > 10L); +} +EOF +if $cc ucbsprf.c -o ucbsprf >/dev/null 2>&1 && ./ucbsprf; then + echo "Your sprintf() returns (int)." >&4 + val="$undef" +else + echo "Your sprintf() returns (char*)." >&4 + val="$define" +fi +set d_charsprf +eval $setvar +$rm -f ucbsprf* + diff --git a/mcon/U/d_chown.U b/mcon/U/d_chown.U new file mode 100644 index 0000000..f7e619f --- /dev/null +++ b/mcon/U/d_chown.U @@ -0,0 +1,33 @@ +?RCS: $Id: d_chown.U,v 3.0.1.1 1994/08/29 16:07:14 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: Original Author: Andy Dougherty +?RCS: +?RCS: $Log: d_chown.U,v $ +?RCS: Revision 3.0.1.1 1994/08/29 16:07:14 ram +?RCS: patch32: created by ADO +?RCS: +?MAKE:d_chown: Inlibc +?MAKE: -pick add $@ %< +?S:d_chown: +?S: This variable conditionally defines the HAS_CHOWN symbol, which +?S: indicates to the C program that the chown() routine is available. +?S:. +?C:HAS_CHOWN : +?C: This symbol, if defined, indicates that the chown routine is +?C: available. +?C:. +?H:#$d_chown HAS_CHOWN /**/ +?H:. +?LINT:set d_chown +: see if chown exists +set chown d_chown +eval $inlibc + diff --git a/mcon/U/d_chroot.U b/mcon/U/d_chroot.U new file mode 100644 index 0000000..3a31a23 --- /dev/null +++ b/mcon/U/d_chroot.U @@ -0,0 +1,33 @@ +?RCS: $Id: d_chroot.U,v 3.0.1.1 1994/08/29 16:07:17 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: Original Author: Andy Dougherty +?RCS: +?RCS: $Log: d_chroot.U,v $ +?RCS: Revision 3.0.1.1 1994/08/29 16:07:17 ram +?RCS: patch32: created by ADO +?RCS: +?MAKE:d_chroot: Inlibc +?MAKE: -pick add $@ %< +?S:d_chroot: +?S: This variable conditionally defines the HAS_CHROOT symbol, which +?S: indicates to the C program that the chroot() routine is available. +?S:. +?C:HAS_CHROOT : +?C: This symbol, if defined, indicates that the chroot routine is +?C: available. +?C:. +?H:#$d_chroot HAS_CHROOT /**/ +?H:. +?LINT:set d_chroot +: see if chroot exists +set chroot d_chroot +eval $inlibc + diff --git a/mcon/U/d_chsize.U b/mcon/U/d_chsize.U new file mode 100644 index 0000000..a815c4c --- /dev/null +++ b/mcon/U/d_chsize.U @@ -0,0 +1,32 @@ +?RCS: $Id: d_chsize.U,v 3.0 1993/08/18 12:05:50 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: d_chsize.U,v $ +?RCS: Revision 3.0 1993/08/18 12:05:50 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?MAKE:d_chsize: Inlibc +?MAKE: -pick add $@ %< +?S:d_chsize: +?S: This variable conditionally defines the CHSIZE symbol, which +?S: indicates to the C program that the chsize() routine is available +?S: to truncate files. You might need a -lx to get this routine. +?S:. +?C:HAS_CHSIZE (CHSIZE): +?C: This symbol, if defined, indicates that the chsize routine is available +?C: to truncate files. You might need a -lx to get this routine. +?C:. +?H:#$d_chsize HAS_CHSIZE /**/ +?H:. +?LINT:set d_chsize +: see if chsize exists +set chsize d_chsize +eval $inlibc + diff --git a/mcon/U/d_ckeypad.U b/mcon/U/d_ckeypad.U new file mode 100644 index 0000000..c1f8307 --- /dev/null +++ b/mcon/U/d_ckeypad.U @@ -0,0 +1,54 @@ +?RCS: $Id: d_ckeypad.U,v 3.0 1993/08/18 12:05:50 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: d_ckeypad.U,v $ +?RCS: Revision 3.0 1993/08/18 12:05:50 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?MAKE:d_ckeypad: cat cc termlib Setvar +?MAKE: -pick add $@ %< +?S:d_ckeypad: +?S: This variable controls the definition of HAS_CURSES_KEYPAD, +?S: which tells the application that the keypad() curses function +?S: is available. +?S:. +?C:HAS_CURSES_KEYPAD: +?C: This symbol indicates the availability of the keypad() function +?C: of the curses library. +?C:. +?H:#$d_ckeypad HAS_CURSES_KEYPAD /**/ +?H:. +?LINT:set d_ckeypad +: check for the keypad() function in the curses library +echo " " +case "$termlib" in +'') + echo "You don't have a curses library, so I won't waste time looking" >&4 + echo "to see if has the keypad() function." >&4 +*) +echo "Checking the curses library ($termlib) for the keypad() function..." >&4 + $cat >c_keypad.c <<'EOCP' +#include +main() { + keypad(stdscr, TRUE); + exit(0); +} +EOCP + if $cc c_keypad.c >c_keypad.out 2>&1 ; then + val=$define + echo "It appears to have the keypad() function." + else + val=$undef + echo "Your curses library doesn't appear to have the keypad() function." + fi +esac +set d_ckeypad +eval $setvar + diff --git a/mcon/U/d_closedir.U b/mcon/U/d_closedir.U new file mode 100644 index 0000000..94f02ad --- /dev/null +++ b/mcon/U/d_closedir.U @@ -0,0 +1,107 @@ +?RCS: $Id: d_closedir.U,v 3.0.1.3 1997/02/28 15:31:26 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: Original Author: Andy Dougherty +?RCS: +?RCS: $Log: d_closedir.U,v $ +?RCS: Revision 3.0.1.3 1997/02/28 15:31:26 ram +?RCS: patch61: added ?F: metalint hint +?RCS: +?RCS: Revision 3.0.1.2 1994/10/29 16:11:18 ram +?RCS: patch36: added 'ldflags' to the test compile line (ADO) +?RCS: +?RCS: Revision 3.0.1.1 1994/08/29 16:07:21 ram +?RCS: patch32: created by ADO +?RCS: +?MAKE:d_closedir d_void_closedir: Inlibc i_dirent i_sysdir i_sysndir \ + cc ccflags ldflags libs Setvar rm +?MAKE: -pick add $@ %< +?S:d_closedir: +?S: This variable conditionally defines HAS_CLOSEDIR if closedir() is +?S: available. +?S:. +?C:HAS_CLOSEDIR: +?C: This symbol, if defined, indicates that the closedir() routine is +?C: available. +?C:. +?H:#$d_closedir HAS_CLOSEDIR /**/ +?H:. +?S:d_void_closedir: +?S: This variable conditionally defines VOID_CLOSEDIR if closedir() +?S: does not return a value. +?S:. +?C:VOID_CLOSEDIR: +?C: This symbol, if defined, indicates that the closedir() routine +?C: does not return a value. +?C:. +?H:#$d_void_closedir VOID_CLOSEDIR /**/ +?H:. +?F:!closedir +?LINT:set d_closedir d_void_closedir +: see if closedir exists +set closedir d_closedir +eval $inlibc + +@if VOID_CLOSEDIR || d_void_closedir +?X: The following contortions are designed so we can call closedir() +?X: and check whether it returns a value. The contortions are designed +?X: to portably pick up the correct directory header, for those +?X: systems that support various mutually incompatible directory functions. +?X: This is from perl5's perl.h +case "$d_closedir" in +"$define") + echo " " + echo "Checking whether closedir() returns a status..." >&4 + cat > closedir.c < +#if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */ +#include +#endif +#else +#ifdef I_SYS_NDIR +#include +#else +#ifdef I_SYS_DIR +#ifdef hp9000s500 +#include /* may be wrong in the future */ +#else +#include +#endif +#endif +#endif +#endif +int main() { return closedir(opendir(".")); } +EOM + if $cc $ccflags $ldflags -o closedir closedir.c $libs > /dev/null 2>&1; then + if ./closedir > /dev/null 2>&1 ; then + echo "Yes, it does." + val="$undef" + else + echo "No, it doesn't." + val="$define" + fi + else + echo "(I can't seem to compile the test program--assuming it doesn't)" + val="$define" + fi + ;; +*) + val="$undef"; + ;; +esac +set d_void_closedir +eval $setvar +$rm -f closedir* +@end diff --git a/mcon/U/d_const.U b/mcon/U/d_const.U new file mode 100644 index 0000000..cde8bd1 --- /dev/null +++ b/mcon/U/d_const.U @@ -0,0 +1,64 @@ +?RCS: $Id: d_const.U,v 3.0.1.1 1993/11/10 17:33:41 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: d_const.U,v $ +?RCS: Revision 3.0.1.1 1993/11/10 17:33:41 ram +?RCS: patch14: stronger const check with added typedef for MIPS cc +?RCS: +?RCS: Revision 3.0 1993/08/18 12:05:51 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?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' +?X: mmcg@bruce.cs.monash.edu.au reports that: +?X: The MIPS cc compiler (V2.10) on a dec 5000 running Ultrix 4.2A +?X: pretends to understand `const' but doesn't - it'll also fail to +?X: handle typedefs properly if they're declared const. To guard +?X: against this, boost up the test by using an explicit typedef... +typedef struct spug { int drokk; } spug; +main() +{ + const char *foo; + const spug y; +} +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 + diff --git a/mcon/U/d_crypt.U b/mcon/U/d_crypt.U new file mode 100644 index 0000000..ff5d791 --- /dev/null +++ b/mcon/U/d_crypt.U @@ -0,0 +1,70 @@ +?RCS: $Id: d_crypt.U,v 3.0.1.1 1997/02/28 15:31:47 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: d_crypt.U,v $ +?RCS: Revision 3.0.1.1 1997/02/28 15:31:47 ram +?RCS: patch61: replaced .a with $_a all over the place +?RCS: +?RCS: Revision 3.0 1993/08/18 12:05:52 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?MAKE:d_crypt cryptlib: Loc test xlibpth libpth Csym Setvar _a +?MAKE: -pick add $@ %< +?S:d_crypt: +?S: This variable conditionally defines the CRYPT symbol, which +?S: indicates to the C program that the crypt() routine is available +?S: to encrypt passwords and the like. +?S:. +?S:cryptlib: +?S: This variable holds -lcrypt or the path to a libcrypt.a archive if +?S: the crypt() function is not defined in the standard C library. It is +?S: up to the Makefile to use this. +?S:. +?C:HAS_CRYPT (CRYPT): +?C: This symbol, if defined, indicates that the crypt routine is available +?C: to encrypt passwords and the like. +?C:. +?H:#$d_crypt HAS_CRYPT /**/ +?H:. +?LINT:set d_crypt +?T:val +: see if crypt exists +echo " " +if set crypt val -f d_crypt; eval $csym; $val; then + echo 'crypt() found.' >&4 + val="$define" + cryptlib='' +else + cryptlib=`./loc Slibcrypt$_a "" $xlibpth` + if $test -z "$cryptlib"; then + cryptlib=`./loc Mlibcrypt$_a "" $xlibpth` + else + cryptlib=-lcrypt + fi + if $test -z "$cryptlib"; then + cryptlib=`./loc Llibcrypt$_a "" $xlibpth` + else + cryptlib=-lcrypt + fi + if $test -z "$cryptlib"; then + cryptlib=`./loc libcrypt$_a "" $libpth` + else + cryptlib=-lcrypt + fi + if $test -z "$cryptlib"; then + echo 'crypt() NOT found.' >&4 + val="$undef" + else + val="$define" + fi +fi +set d_crypt +eval $setvar + diff --git a/mcon/U/d_csh.U b/mcon/U/d_csh.U new file mode 100644 index 0000000..47d64b7 --- /dev/null +++ b/mcon/U/d_csh.U @@ -0,0 +1,50 @@ +?RCS: $Id: d_csh.U,v 3.0.1.1 1997/02/28 15:32:18 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: d_csh.U,v $ +?RCS: Revision 3.0.1.1 1997/02/28 15:32:18 ram +?RCS: patch61: added full_csh to preserve the full path even when portable +?RCS: +?RCS: Revision 3.0 1993/08/18 12:05:53 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?MAKE:d_csh full_csh: csh Setvar +?MAKE: -pick add $@ %< +?S:d_csh: +?S: This variable conditionally defines the CSH symbol, which +?S: indicates to the C program that the C-shell exists. +?S:. +?S:full_csh: +?S: This variable contains the full pathname to 'csh', whether or +?S: not the user has specified 'portability'. This is only used +?S: in the compiled C program, and we assume that all systems which +?S: can share this executable will have the same full pathname to +?S: 'csh.' +?S:. +?X: Yes, I know about the C symbol PORTABLE, but I think csh +?X: is unlikely to move, and I'm too lazy to add all the +?X: #ifdef PORTABLE sections to the perl source. +?X: +?C:CSH: +?C: This symbol, if defined, indicates that the C-shell exists. +?C: If defined, contains the full pathname of csh. +?C:. +?H:#$d_csh CSH "$full_csh" /**/ +?H:. +?LINT:set d_csh +: get csh whereabouts +case "$csh" in +'csh') val="$undef" ;; +*) val="$define" ;; +esac +set d_csh +eval $setvar +full_csh=$csh + diff --git a/mcon/U/d_ctermid.U b/mcon/U/d_ctermid.U new file mode 100644 index 0000000..8d363e7 --- /dev/null +++ b/mcon/U/d_ctermid.U @@ -0,0 +1,31 @@ +?RCS: $Id: d_ctermid.U,v 3.0 1993/08/18 12:05:54 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: d_ctermid.U,v $ +?RCS: Revision 3.0 1993/08/18 12:05:54 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?MAKE:d_ctermid: Inlibc +?MAKE: -pick add $@ %< +?S:d_ctermid: +?S: This variable conditionally defines CTERMID if ctermid() is +?S: available to generate filename for terminal. +?S:. +?C:HAS_CTERMID (CTERMID): +?C: This symbol, if defined, indicates that the ctermid routine is +?C: available to generate filename for terminal. +?C:. +?H:#$d_ctermid HAS_CTERMID /**/ +?H:. +?LINT:set d_ctermid +: see if ctermid exists +set ctermid d_ctermid +eval $inlibc + diff --git a/mcon/U/d_cuserid.U b/mcon/U/d_cuserid.U new file mode 100644 index 0000000..7b38dbb --- /dev/null +++ b/mcon/U/d_cuserid.U @@ -0,0 +1,34 @@ +?RCS: $Id: d_cuserid.U,v 3.0.1.1 1994/08/29 16:07:25 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: Original Author: Andy Dougherty +?RCS: +?RCS: $Log: d_cuserid.U,v $ +?RCS: Revision 3.0.1.1 1994/08/29 16:07:25 ram +?RCS: patch32: created by ADO +?RCS: +?MAKE:d_cuserid: Inlibc +?MAKE: -pick add $@ %< +?S:d_cuserid: +?S: This variable conditionally defines the HAS_CUSERID symbol, which +?S: indicates to the C program that the cuserid() routine is available +?S: to get character login names. +?S:. +?C:HAS_CUSERID : +?C: This symbol, if defined, indicates that the cuserid routine is +?C: available to get character login names. +?C:. +?H:#$d_cuserid HAS_CUSERID /**/ +?H:. +?LINT:set d_cuserid +: see if cuserid exists +set cuserid d_cuserid +eval $inlibc + diff --git a/mcon/U/d_dbl_dig.U b/mcon/U/d_dbl_dig.U new file mode 100644 index 0000000..12f824e --- /dev/null +++ b/mcon/U/d_dbl_dig.U @@ -0,0 +1,60 @@ +?RCS: $Id: d_dbl_dig.U,v 3.0.1.1 1994/08/29 16:07:28 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: Original Author: Andy Dougherty +?RCS: +?RCS: $Log: d_dbl_dig.U,v $ +?RCS: Revision 3.0.1.1 1994/08/29 16:07:28 ram +?RCS: patch32: created by ADO +?RCS: +?MAKE:d_dbl_dig: Myread contains cat rm Setvar i_limits i_float \ + cppstdin cppflags cppminus +?MAKE: -pick add $@ %< +?S:d_dbl_dig: +?S: This variable conditionally defines d_dbl_dig if this system's +?S: header files provide DBL_DIG, which is the number of significant +?S: digits in a double precision number. +?S:. +?C:HAS_DBL_DIG: +?C: This symbol, if defined, indicates that this system's +?C: or defines the symbol DBL_DIG, which is the number +?C: of significant digits in a double precision number. If this +?C: symbol is not defined, a guess of 15 is usually pretty good. +?C:. +?H:#$d_dbl_dig HAS_DBL_DIG /* */ +?H:. +?LINT:set d_dbl_dig +: See if number of significant digits in a double precision number is known +echo " " +$cat >dbl_dig.c < +#endif +#ifdef I_FLOAT +#include +#endif +#ifdef DBL_DIG +printf("Contains DBL_DIG"); +#endif +EOM +$cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null +if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then + echo "DBL_DIG found." >&4 + val="$define" +else + echo "DBL_DIG NOT found." >&4 + val="$undef" +fi +$rm -f dbl_dig.? +set d_dbl_dig +eval $setvar + diff --git a/mcon/U/d_difftime.U b/mcon/U/d_difftime.U new file mode 100644 index 0000000..f83c78d --- /dev/null +++ b/mcon/U/d_difftime.U @@ -0,0 +1,33 @@ +?RCS: $Id: d_difftime.U,v 3.0.1.1 1994/08/29 16:07:31 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: Original Author: Andy Dougherty +?RCS: +?RCS: $Log: d_difftime.U,v $ +?RCS: Revision 3.0.1.1 1994/08/29 16:07:31 ram +?RCS: patch32: created by ADO +?RCS: +?MAKE:d_difftime: Inlibc +?MAKE: -pick add $@ %< +?S:d_difftime: +?S: This variable conditionally defines the HAS_DIFFTIME symbol, which +?S: indicates to the C program that the difftime() routine is available. +?S:. +?C:HAS_DIFFTIME : +?C: This symbol, if defined, indicates that the difftime routine is +?C: available. +?C:. +?H:#$d_difftime HAS_DIFFTIME /**/ +?H:. +?LINT:set d_difftime +: see if difftime exists +set difftime d_difftime +eval $inlibc + diff --git a/mcon/U/d_dlerror.U b/mcon/U/d_dlerror.U new file mode 100644 index 0000000..d019764 --- /dev/null +++ b/mcon/U/d_dlerror.U @@ -0,0 +1,46 @@ +?RCS: $Id: d_dlerror.U,v 3.0.1.2 1995/07/25 13:52:49 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: Original Author: Andy Dougherty +?RCS: +?RCS: $Log: d_dlerror.U,v $ +?RCS: Revision 3.0.1.2 1995/07/25 13:52:49 ram +?RCS: patch56: force compile-link test since symbol might lie in crt0.o (ADO) +?RCS: +?RCS: Revision 3.0.1.1 1994/10/29 16:11:23 ram +?RCS: patch36: created by ADO +?RCS: +?MAKE:d_dlerror: Inlibc runnm +?MAKE: -pick add $@ %< +?S:d_dlerror: +?S: This variable conditionally defines the HAS_DLERROR symbol, which +?S: indicates to the C program that the dlerror() routine is available. +?S:. +?C:HAS_DLERROR : +?C: This symbol, if defined, indicates that the dlerror routine is +?C: available to return a string describing the last error that +?C: occurred from a call to dlopen(), dlclose() or dlsym(). +?C:. +?H:#$d_dlerror HAS_DLERROR /**/ +?H:. +?T: xxx_runnm +?LINT:set d_dlerror +?X: We don't permanently change runnm, but we do temporarily. +?LINT: change runnm +: see if dlerror exists +?X: On NetBSD and FreeBSD, dlerror might be available, but it is in +?X: /usr/lib/crt0.o, not in any of the libraries. Therefore, do not +?X: use the nm extraction, but use a real compile and link test instead. +xxx_runnm="$runnm" +runnm=false +set dlerror d_dlerror +eval $inlibc +runnm="$xxx_runnm" + diff --git a/mcon/U/d_dlopen.U b/mcon/U/d_dlopen.U new file mode 100644 index 0000000..9491ba7 --- /dev/null +++ b/mcon/U/d_dlopen.U @@ -0,0 +1,45 @@ +?RCS: $Id: d_dlopen.U,v 3.0.1.2 1995/07/25 13:52:56 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: Original Author: Andy Dougherty +?RCS: +?RCS: $Log: d_dlopen.U,v $ +?RCS: Revision 3.0.1.2 1995/07/25 13:52:56 ram +?RCS: patch56: force compile-link test since symbol might lie in crt0.o (ADO) +?RCS: +?RCS: Revision 3.0.1.1 1994/08/29 16:07:34 ram +?RCS: patch32: created by ADO +?RCS: +?MAKE:d_dlopen: Inlibc runnm +?MAKE: -pick add $@ %< +?S:d_dlopen: +?S: This variable conditionally defines the HAS_DLOPEN symbol, which +?S: indicates to the C program that the dlopen() routine is available. +?S:. +?C:HAS_DLOPEN : +?C: This symbol, if defined, indicates that the dlopen routine is +?C: available. +?C:. +?H:#$d_dlopen HAS_DLOPEN /**/ +?H:. +?T: xxx_runnm +?LINT:set d_dlopen +?X: We don't permanently change runnm, but we do temporarily. +?LINT: change runnm +: see if dlopen exists +?X: On NetBSD and FreeBSD, dlopen is available, but it is in +?X: /usr/lib/crt0.o, not in any of the libraries. Therefore, do not +?X: use the nm extraction, but use a real compile and link test instead. +xxx_runnm="$runnm" +runnm=false +set dlopen d_dlopen +eval $inlibc +runnm="$xxx_runnm" + diff --git a/mcon/U/d_dosuid.U b/mcon/U/d_dosuid.U new file mode 100644 index 0000000..7b15577 --- /dev/null +++ b/mcon/U/d_dosuid.U @@ -0,0 +1,168 @@ +?RCS: $Id: d_dosuid.U,v 3.0.1.2 1997/02/28 15:33:03 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.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 +?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 < +?RCS: +?RCS: $Log: d_drem.U,v $ +?RCS: Revision 3.0.1.1 1994/10/29 16:12:14 ram +?RCS: patch36: created by ADO +?RCS: +?MAKE:d_drem: Inlibc +?MAKE: -pick add $@ %< +?S:d_drem: +?S: This variable conditionally defines the HAS_DREM symbol, which +?S: indicates to the C program that the drem() routine is available. +?S:. +?C:HAS_DREM : +?C: This symbol, if defined, indicates that the drem routine is +?C: available. This routine is roughly the same as fmod, i.e. it +?C: computes the remainder r=x-n*y, where n=rint(x/y), whereas fmod +?C: uses n=trunc(x/y). +?C:. +?H:#$d_drem HAS_DREM /**/ +?H:. +?LINT:set d_drem +: see if drem exists +set drem d_drem +eval $inlibc + diff --git a/mcon/U/d_dup2.U b/mcon/U/d_dup2.U new file mode 100644 index 0000000..b63babb --- /dev/null +++ b/mcon/U/d_dup2.U @@ -0,0 +1,31 @@ +?RCS: $Id: d_dup2.U,v 3.0 1993/08/18 12:05:56 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: d_dup2.U,v $ +?RCS: Revision 3.0 1993/08/18 12:05:56 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?MAKE:d_dup2: Inlibc +?MAKE: -pick add $@ %< +?S:d_dup2: +?S: This variable conditionally defines HAS_DUP2 if dup2() is +?S: available to duplicate file descriptors. +?S:. +?C:HAS_DUP2 (DUP2): +?C: This symbol, if defined, indicates that the dup2 routine is +?C: available to duplicate file descriptors. +?C:. +?H:#$d_dup2 HAS_DUP2 /**/ +?H:. +?LINT:set d_dup2 +: see if dup2 exists +set dup2 d_dup2 +eval $inlibc + diff --git a/mcon/U/d_eofpipe.U b/mcon/U/d_eofpipe.U new file mode 100644 index 0000000..7f77c08 --- /dev/null +++ b/mcon/U/d_eofpipe.U @@ -0,0 +1,92 @@ +?RCS: $Id: d_eofpipe.U,v 3.0.1.1 1994/10/29 16:12:40 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: d_eofpipe.U,v $ +?RCS: Revision 3.0.1.1 1994/10/29 16:12:40 ram +?RCS: patch36: call ./bsd explicitely instead of relying on PATH +?RCS: +?RCS: Revision 3.0 1993/08/18 12:05:57 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?MAKE:d_eofpipe: cat +cc +ccflags +libs rm Oldconfig Guess echo n c +?MAKE: -pick add $@ %< +?S:d_eofpipe: +?S: This variable conditionally defines the EOFPIPE symbol, which +?S: indicates to the C program that select will correctly detect the EOF +?S: condition when pipe is closed from the other end. +?S:. +?C:EOFPIPE: +?C: This symbol, if defined, indicates that EOF condition will be detected +?C: by the reader of the pipe when it is closed by the writing process. +?C: That is, a select() call on that file descriptor will not block when +?C: only an EOF remains (typical behaviour for BSD systems). +?C:. +?H:#$d_eofpipe EOFPIPE /**/ +?H:. +: see if pipe correctly gives the EOF condition +echo " " +case "$d_eofpipe" in +'') + echo "Let's see if your pipes return EOF to select() upon closing..." >&4 + $cat >pipe.c <<'EOP' +main() +{ + int pd[2]; + int mask; + + pipe(pd); + if (0 == fork()) { + close(pd[0]); + close(pd[1]); + exit(0); + } + + close(pd[1]); + mask = 1 << pd[0]; + alarm(2); + select(32, &mask, (int *) 0, (int *) 0, (char *) 0); + if (0 == read(pd[0], &mask, 1)) + exit(0); + + exit(1); +} +EOP + if $cc $ccflags pipe.c -o pipe $libs >/dev/null 2>&1; then +?X: Use a script to avoid the possible 'alarm call' message + echo "./pipe || exit 1" > mpipe + chmod +x mpipe + ./mpipe >/dev/null 2>&1 + case $? in + 0) d_eofpipe="$define";; + *) d_eofpipe="$undef";; + esac + else + echo "(The test program did not compile correctly -- Guessing.)" + if ./bsd; then + d_eofpipe="$define" + else + d_eofpipe="$undef" + fi + fi + case "$d_eofpipe" in + "$define") echo "Yes, they do.";; + *) echo "No, they don't! (sigh)";; + esac + ;; +*) + $echo $n "Your pipes $c" + case "$d_eofpipe" in + "$define") echo "allow select() to see EOF upon closing.";; + *) echo "won't let select() see EOF on closing.";; + esac + ;; +esac +$rm -f *pipe* core + diff --git a/mcon/U/d_euc2jis.U b/mcon/U/d_euc2jis.U new file mode 100644 index 0000000..4e02da7 --- /dev/null +++ b/mcon/U/d_euc2jis.U @@ -0,0 +1,32 @@ +?RCS: $Id: d_euc2jis.U,v 3.0 1993/08/18 12:05:58 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: d_euc2jis.U,v $ +?RCS: Revision 3.0 1993/08/18 12:05:58 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?MAKE:d_euc2jis: Inlibc +?MAKE: -pick add $@ %< +?S:d_euc2jis: +?S: This variable conditionally defines the HAS_EUC2JIS symbol, which +?S: indicates to the C program that the euc2jis() routine is available +?S: to convert EUC to JIS. +?S:. +?C:HAS_EUC2JIS: +?C: This symbol, if defined, indicates that the euc2jis routine is +?C: available to convert EUC to JIS. +?C:. +?H:#$d_euc2jis HAS_EUC2JIS /**/ +?H:. +?LINT:set d_euc2jis +: see if euc2jis exists +set euc2jis d_euc2jis +eval $inlibc + diff --git a/mcon/U/d_fchmod.U b/mcon/U/d_fchmod.U new file mode 100644 index 0000000..4880384 --- /dev/null +++ b/mcon/U/d_fchmod.U @@ -0,0 +1,32 @@ +?RCS: $Id: d_fchmod.U,v 3.0 1993/08/18 12:05:59 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: d_fchmod.U,v $ +?RCS: Revision 3.0 1993/08/18 12:05:59 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?MAKE:d_fchmod: Inlibc +?MAKE: -pick add $@ %< +?S:d_fchmod: +?S: This variable conditionally defines the HAS_FCHMOD symbol, which +?S: indicates to the C program that the fchmod() routine is available +?S: to change mode of opened files. +?S:. +?C:HAS_FCHMOD (FCHMOD): +?C: This symbol, if defined, indicates that the fchmod routine is available +?C: to change mode of opened files. If unavailable, use chmod(). +?C:. +?H:#$d_fchmod HAS_FCHMOD /**/ +?H:. +?LINT:set d_fchmod +: see if fchmod exists +set fchmod d_fchmod +eval $inlibc + diff --git a/mcon/U/d_fchown.U b/mcon/U/d_fchown.U new file mode 100644 index 0000000..296bfd7 --- /dev/null +++ b/mcon/U/d_fchown.U @@ -0,0 +1,32 @@ +?RCS: $Id: d_fchown.U,v 3.0 1993/08/18 12:06:01 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: d_fchown.U,v $ +?RCS: Revision 3.0 1993/08/18 12:06:01 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?MAKE:d_fchown: Inlibc +?MAKE: -pick add $@ %< +?S:d_fchown: +?S: This variable conditionally defines the HAS_FCHOWN symbol, which +?S: indicates to the C program that the fchown() routine is available +?S: to change ownership of opened files. +?S:. +?C:HAS_FCHOWN (FCHOWN): +?C: This symbol, if defined, indicates that the fchown routine is available +?C: to change ownership of opened files. If unavailable, use chown(). +?C:. +?H:#$d_fchown HAS_FCHOWN /**/ +?H:. +?LINT:set d_fchown +: see if fchown exists +set fchown d_fchown +eval $inlibc + diff --git a/mcon/U/d_fcntl.U b/mcon/U/d_fcntl.U new file mode 100644 index 0000000..8e9b005 --- /dev/null +++ b/mcon/U/d_fcntl.U @@ -0,0 +1,31 @@ +?RCS: $Id: d_fcntl.U,v 3.0 1993/08/18 12:06:01 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: d_fcntl.U,v $ +?RCS: Revision 3.0 1993/08/18 12:06:01 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?MAKE:d_fcntl: Inlibc +?MAKE: -pick add $@ %< +?S:d_fcntl: +?S: This variable conditionally defines the HAS_FCNTL symbol, and indicates +?S: whether the fcntl() function exists +?S:. +?C:HAS_FCNTL: +?C: This symbol, if defined, indicates to the C program that +?C: the fcntl() function exists. +?C:. +?H:#$d_fcntl HAS_FCNTL /**/ +?H:. +?LINT:set d_fcntl +: see if this is an fcntl system +set fcntl d_fcntl +eval $inlibc + diff --git a/mcon/U/d_fd_set.U b/mcon/U/d_fd_set.U new file mode 100644 index 0000000..1b08f5d --- /dev/null +++ b/mcon/U/d_fd_set.U @@ -0,0 +1,138 @@ +?RCS: $Id: d_fd_set.U,v 3.0.1.3 1997/02/28 15:33:16 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: d_fd_set.U,v $ +?RCS: Revision 3.0.1.3 1997/02/28 15:33:16 ram +?RCS: patch61: added ?F: metalint hint +?RCS: +?RCS: Revision 3.0.1.2 1994/06/20 06:57:23 ram +?RCS: patch30: extended scope for fd_set checks (ADO) +?RCS: +?RCS: Revision 3.0.1.1 1994/01/24 14:06:27 ram +?RCS: patch16: comments for HAS_FD_* symbols were not consistent +?RCS: +?RCS: Revision 3.0 1993/08/18 12:06:02 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?MAKE:d_fd_set d_fd_macros d_fds_bits: cat +cc +ccflags rm Oldconfig \ + d_socket i_systime i_sysselct +?MAKE: -pick add $@ %< +?S:d_fd_set: +?S: This variable contains the eventual value of the HAS_FD_SET symbol, +?S: which indicates if your C compiler knows about the fd_set typedef. +?S:. +?S:d_fd_macros: +?S: This variable contains the eventual value of the HAS_FD_MACROS symbol, +?S: which indicates if your C compiler knows about the macros which +?S: manipulate an fd_set. +?S:. +?S:d_fds_bits: +?S: This variable contains the eventual value of the HAS_FDS_BITS symbol, +?S: which indicates if your fd_set typedef contains the fds_bits member. +?S: If you have an fd_set typedef, but the dweebs who installed it did +?S: a half-fast job and neglected to provide the macros to manipulate +?S: an fd_set, HAS_FDS_BITS will let us know how to fix the gaffe. +?S:. +?C:HAS_FD_SET: +?C: This symbol, when defined, indicates presence of the fd_set typedef +?C: in +?C:. +?C:HAS_FD_MACROS: +?C: This symbol, when defined, indicates presence of the macros used to +?C: manipulate an fd_set. +?C:. +?C:HAS_FDS_BITS: +?C: This symbol, when defined, indicates presence of the fds_bits member in +?C: fd_set. This knowledge is useful if fd_set is available but the macros +?C: aren't. +?C:. +?H:#$d_fd_set HAS_FD_SET /**/ +?H:#$d_fd_macros HAS_FD_MACROS /**/ +?H:#$d_fds_bits HAS_FDS_BITS /**/ +?H:. +?F:!fd_set +: check for fd_set items +$cat <, which is included (perhaps) +?X: by . We won't force people to include +?X: because it might introduce other +?X: incompatibilities. +$cat >fd_set.c < +#ifdef HAS_SOCKET +#include /* Might include */ +#endif +#ifdef I_SYS_TIME +#include +#endif +#ifdef I_SYS_SELECT +#include +#endif +main() { + fd_set fds; + +#ifdef TRYBITS + if(fds.fds_bits); +#endif + +#if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO) + exit(0); +#else + exit(1); +#endif +} +EOCP +if $cc $ccflags -DTRYBITS fd_set.c -o fd_set >fd_set.out 2>&1 ; then + d_fds_bits="$define" + d_fd_set="$define" + echo "Well, your system knows about the normal fd_set typedef..." >&4 + if ./fd_set; then + echo "and you have the normal fd_set macros (just as I'd expect)." >&4 + d_fd_macros="$define" + else + $cat >&4 <<'EOM' +but not the normal fd_set macros! Gaaack! I'll have to cover for you. +EOM + d_fd_macros="$undef" + fi +else + $cat <<'EOM' +Hmm, your compiler has some difficulty with fd_set. Checking further... +EOM + if $cc $ccflags fd_set.c -o fd_set >fd_set.out 2>&1 ; then + d_fds_bits="$undef" + d_fd_set="$define" + echo "Well, your system has some sort of fd_set available..." >&4 + if ./fd_set; then + echo "and you have the normal fd_set macros." >&4 + d_fd_macros="$define" + else + $cat <<'EOM' +but not the normal fd_set macros! Gross! More work for me... +EOM + d_fd_macros="$undef" + fi + else + echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4 + d_fd_set="$undef" + d_fds_bits="$undef" + d_fd_macros="$undef" + fi +fi +$rm -f fd_set* + + diff --git a/mcon/U/d_ffs.U b/mcon/U/d_ffs.U new file mode 100644 index 0000000..fc381eb --- /dev/null +++ b/mcon/U/d_ffs.U @@ -0,0 +1,33 @@ +?RCS: $Id: d_ffs.U,v 3.0 1993/08/18 12:06:03 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: d_ffs.U,v $ +?RCS: Revision 3.0 1993/08/18 12:06:03 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?MAKE:d_ffs: Inlibc +?MAKE: -pick add $@ %< +?S:d_ffs: +?S: This variable conditionally defines the HAS_FFS symbol, which +?S: indicates to the C program that the ffs() routine is available +?S: to find the first bit which is set in its integer argument. +?S:. +?C:HAS_FFS: +?C: This symbol, if defined, indicates that the ffs routine is available +?C: to find the first bit set in its argument. If it's not available, +?C: roll your own. +?C:. +?H:#$d_ffs HAS_FFS /**/ +?H:. +?LINT:set d_ffs +: see if ffs exists +set ffs d_ffs +eval $inlibc + diff --git a/mcon/U/d_fgetpos.U b/mcon/U/d_fgetpos.U new file mode 100644 index 0000000..3c8ebc9 --- /dev/null +++ b/mcon/U/d_fgetpos.U @@ -0,0 +1,31 @@ +?RCS: $Id: d_fgetpos.U,v 3.0.1.1 1994/06/20 06:57:33 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: d_fgetpos.U,v $ +?RCS: Revision 3.0.1.1 1994/06/20 06:57:33 ram +?RCS: patch30: created +?RCS: +?MAKE:d_fgetpos: Inlibc +?MAKE: -pick add $@ %< +?S:d_fgetpos: +?S: This variable conditionally defines HAS_FGETPOS if fgetpos() is +?S: available to get the file position indicator. +?S:. +?C:HAS_FGETPOS: +?C: This symbol, if defined, indicates that the fgetpos routine is +?C: available to get the file position indicator, similar to ftell(). +?C:. +?H:#$d_fgetpos HAS_FGETPOS /**/ +?H:. +?LINT:set d_fgetpos +: see if fgetpos exists +set fgetpos d_fgetpos +eval $inlibc + diff --git a/mcon/U/d_flexfnam.U b/mcon/U/d_flexfnam.U new file mode 100644 index 0000000..4e1ddbf --- /dev/null +++ b/mcon/U/d_flexfnam.U @@ -0,0 +1,77 @@ +?RCS: $Id: d_flexfnam.U,v 3.0 1993/08/18 12:06:04 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: d_flexfnam.U,v $ +?RCS: Revision 3.0 1993/08/18 12:06:04 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?MAKE:d_flexfnam: cat rm test Setvar +?MAKE: -pick add $@ %< +?S:d_flexfnam: +?S: This variable conditionally defines the FLEXFILENAMES symbol, which +?S: indicates that the system supports filenames longer than 14 characters. +?S:. +?C:FLEXFILENAMES: +?C: This symbol, if defined, indicates that the system supports filenames +?C: longer than 14 characters. +?C:. +?H:#$d_flexfnam FLEXFILENAMES /**/ +?H:. +?T:first second +?LINT:set d_flexfnam +: see if we can have long filenames +echo " " +?X: +?X: We have to test in both /tmp and . because of NFS (remote server may allow +?X: long filenames while the local filesystem cannot support them). If at least +?X: one of those file systems cannot support long filenames, then we assume the +?X: whole system can't. +?X: +rmlist="$rmlist /tmp/cf$$" +$test -d /tmp/cf$$ || mkdir /tmp/cf$$ +first=123456789abcdef +second=/tmp/cf$$/$first +$rm -f $first $second +if (echo hi >$first) 2>/dev/null; then + if $test -f 123456789abcde; then + echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4 + val="$undef" + else + if (echo hi >$second) 2>/dev/null; then + if $test -f /tmp/cf$$/123456789abcde; then + $cat <<'EOM' +That's peculiar... You can have filenames longer than 14 characters, but only +on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems +I shall consider your system cannot support long filenames at all. +EOM + val="$undef" + else + echo 'You can have filenames longer than 14 characters.' >&4 + val="$define" + fi + else + $cat <<'EOM' +How confusing! Some of your filesystems are sane enough to allow filenames +longer than 14 characters but some others like /tmp can't even think about them. +So, for now on, I shall assume your kernel does not allow them at all. +EOM + val="$undef" + fi + fi +else + $cat <<'EOM' +You can't have filenames longer than 14 chars. You can't even think about them! +EOM + val="$undef" +fi +set d_flexfnam +eval $setvar +$rm -rf /tmp/cf$$ 123456789abcde* + diff --git a/mcon/U/d_flock.U b/mcon/U/d_flock.U new file mode 100644 index 0000000..fd17308 --- /dev/null +++ b/mcon/U/d_flock.U @@ -0,0 +1,31 @@ +?RCS: $Id: d_flock.U,v 3.0 1993/08/18 12:06:05 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: d_flock.U,v $ +?RCS: Revision 3.0 1993/08/18 12:06:05 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?MAKE:d_flock: Inlibc +?MAKE: -pick add $@ %< +?S:d_flock: +?S: This variable conditionally defines HAS_FLOCK if flock() is +?S: available to do file locking. +?S:. +?C:HAS_FLOCK (FLOCK): +?C: This symbol, if defined, indicates that the flock routine is +?C: available to do file locking. +?C:. +?H:#$d_flock HAS_FLOCK /**/ +?H:. +?LINT:set d_flock +: see if flock exists +set flock d_flock +eval $inlibc + diff --git a/mcon/U/d_fmod.U b/mcon/U/d_fmod.U new file mode 100644 index 0000000..d3d053c --- /dev/null +++ b/mcon/U/d_fmod.U @@ -0,0 +1,34 @@ +?RCS: $Id: d_fmod.U,v 3.0.1.1 1994/10/29 16:12:46 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: Original Author: Andy Dougherty +?RCS: +?RCS: $Log: d_fmod.U,v $ +?RCS: Revision 3.0.1.1 1994/10/29 16:12:46 ram +?RCS: patch36: created by ADO +?RCS: +?MAKE:d_fmod: Inlibc +?MAKE: -pick add $@ %< +?S:d_fmod: +?S: This variable conditionally defines the HAS_FMOD symbol, which +?S: indicates to the C program that the fmod() routine is available. +?S: See also d_drem for the drem() routine which does roughly the same. +?S:. +?C:HAS_FMOD : +?C: This symbol, if defined, indicates that the fmod routine is +?C: available to compute the remainder r=x-n*y where n=trunc(x/y). +?C:. +?H:#$d_fmod HAS_FMOD /**/ +?H:. +?LINT:set d_fmod +: see if fmod exists +set fmod d_fmod +eval $inlibc + diff --git a/mcon/U/d_fork.U b/mcon/U/d_fork.U new file mode 100644 index 0000000..41c35b9 --- /dev/null +++ b/mcon/U/d_fork.U @@ -0,0 +1,33 @@ +?RCS: $Id: d_fork.U,v 3.0.1.1 1994/08/29 16:07:38 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.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 + diff --git a/mcon/U/d_fsetpos.U b/mcon/U/d_fsetpos.U new file mode 100644 index 0000000..6c31190 --- /dev/null +++ b/mcon/U/d_fsetpos.U @@ -0,0 +1,31 @@ +?RCS: $Id: d_fsetpos.U,v 3.0.1.1 1994/06/20 06:57:38 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.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 + diff --git a/mcon/U/d_ftime.U b/mcon/U/d_ftime.U new file mode 100644 index 0000000..6888499 --- /dev/null +++ b/mcon/U/d_ftime.U @@ -0,0 +1,78 @@ +?RCS: $Id: d_ftime.U,v 3.0 1993/08/18 12:06:06 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: d_ftime.U,v $ +?RCS: Revision 3.0 1993/08/18 12:06:06 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?MAKE:d_ftime d_gettimeod: Inlibc Setvar +?MAKE: -pick add $@ %< +?S:d_ftime: +?S: This variable conditionally defines the HAS_FTIME symbol, which indicates +?S: that the ftime() routine exists. The ftime() routine is basically +?S: a sub-second accuracy clock. +?S:. +?S:d_gettimeod: +?S: This variable conditionally defines the HAS_GETTIMEOFDAY symbol, which +?S: indicates that the gettimeofday() system call exists (to obtain a +?S: sub-second accuracy clock). You should probably include . +?S:. +?C:HAS_FTIME (FTIMER): +?C: This symbol, if defined, indicates that the ftime() routine exists. +?C: It is basically a sub-second accuracy clock, but is less accurate +?C: than gettimeofday(2) anyway. The type "Timeval" should be used to +?C: refer to "struct timeb". +?C:. +?C:HAS_GETTIMEOFDAY (GETTIMEOFDAY): +?C: This symbol, if defined, indicates that the gettimeofday() system +?C: call is available for a sub-second accuracy clock. Usually, the file +?C: needs to be included (see I_SYS_RESOURCE). +?C: The type "Timeval" should be used to refer to "struct timeval". +?C:. +?H:#$d_ftime HAS_FTIME /**/ +?H:#$d_gettimeod HAS_GETTIMEOFDAY /**/ +?H:?%<:@if HAS_FTIME +?H:?%<:#ifdef HAS_FTIME +?H:?%<:#define Timeval struct timeb /* Structure used by ftime() */ +?H:?%<:#endif +?H:?%<:@end +?H:?%<:@if HAS_GETTIMEOFDAY +?H:?%<:#ifdef HAS_GETTIMEOFDAY +?H:?%<:#define Timeval struct timeval /* Structure used by gettimeofday() */ +?H:?%<:#endif +?H:?%<:@end +?H:. +?X:FIXME +?X:?I:?d_ftime:i_systimeb +?X:?I:?d_gettimeod:i_sysresrc +?LINT:set d_gettimeod d_ftime +?LINT:known Timeval +: see if gettimeofday or ftime exists +?X: +?X: Give priority to gettimeofday(2) because timing is more accurate +?X: +set gettimeofday d_gettimeod +eval $inlibc +case "$d_gettimeod" in +"$undef") + set ftime d_ftime + eval $inlibc + ;; +*) + val="$undef"; set d_ftime; eval $setvar + ;; +esac +case "$d_gettimeod$d_ftime" in +"$undef$undef") + echo " " + echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4 + ;; +esac + diff --git a/mcon/U/d_ftrncate.U b/mcon/U/d_ftrncate.U new file mode 100644 index 0000000..b81f281 --- /dev/null +++ b/mcon/U/d_ftrncate.U @@ -0,0 +1,31 @@ +?RCS: $Id: d_ftrncate.U,v 3.0 1993/08/18 12:06:07 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: d_ftrncate.U,v $ +?RCS: Revision 3.0 1993/08/18 12:06:07 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?MAKE:d_ftrncate: Inlibc +?MAKE: -pick add $@ %< +?S:d_ftrncate (d_ftruncate): +?S: This variable conditionally defines the HAS_FTRUNCATE symbol, which +?S: indicates to the C program that the ftruncate() subroutine exists. +?S:. +?C:HAS_FTRUNCATE: +?C: This symbol, if defined, indicates that the ftruncate() subroutine +?C: exists. +?C:. +?H:#$d_ftrncate HAS_FTRUNCATE /**/ +?H:. +?LINT:set d_ftrncate +: see if ftruncate exists +set ftruncate d_ftrncate +eval $inlibc + diff --git a/mcon/U/d_gconvert.U b/mcon/U/d_gconvert.U new file mode 100644 index 0000000..b664cbc --- /dev/null +++ b/mcon/U/d_gconvert.U @@ -0,0 +1,147 @@ +?RCS: $Id: d_gconvert.U,v 3.0.1.3 1997/02/28 15:33:38 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: Original Author: Andy Dougherty +?RCS: +?RCS: $Log: d_gconvert.U,v $ +?RCS: Revision 3.0.1.3 1997/02/28 15:33:38 ram +?RCS: patch61: integrated new unit from perl5 +?RCS: +?RCS: Revision 3.0.1.2 1995/07/25 13:55:59 ram +?RCS: patch56: improved comments about the Gconvert macro (ADO) +?RCS: patch56: force compile-link test since it may exist but be unusable (ADO) +?RCS: +?RCS: Revision 3.0.1.1 1994/10/29 16:12:51 ram +?RCS: patch36: created by ADO +?RCS: +?MAKE:d_Gconvert: cat cc ccflags ldflags libs Inlibc rm _o +?MAKE: -pick add $@ %< +?S:d_Gconvert: +?S: This variable holds what Gconvert is defined as to convert +?S: floating point numbers into strings. It could be 'gconvert' +?S: or a more complex macro emulating gconvert with gcvt() or sprintf. +?S:. +?C:Gconvert: +?C: This preprocessor macro is defined to convert a floating point +?C: number to a string without a trailing decimal point. This +?C: emulates the behavior of sprintf("%g"), but is sometimes much more +?C: efficient. If gconvert() is not available, but gcvt() drops the +?C: trailing decimal point, then gcvt() is used. If all else fails, +?C: a macro using sprintf("%g") is used. Arguments for the Gconvert +?C: macro are: value, number of digits, whether trailing zeros should +?C: be retained, and the output buffer. +?C: Possible values are: +?C: d_Gconvert='gconvert((x),(n),(t),(b))' +?C: d_Gconvert='gcvt((x),(n),(b))' +?C: d_Gconvert='sprintf((b),"%.*g",(n),(x))' +?C: The last two assume trailing zeros should not be kept. +?C:. +?H:#define Gconvert(x,n,t,b) $d_Gconvert +?H:. +?T: xxx_list xxx_convert +?F:!try +?X: +: Check how to convert floats to strings. +echo " " +echo "Checking for an efficient way to convert floats to strings." +?X: We want to be sure to drop trailing decimal points (perl5 +?X: needs this). +$cat >try.c <<'EOP' +#ifdef TRY_gconvert +#define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b)) +char *myname = "gconvert"; +#endif +#ifdef TRY_gcvt +#define Gconvert(x,n,t,b) gcvt((x),(n),(b)) +char *myname = "gcvt"; +#endif +#ifdef TRY_sprintf +#define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x)) +char *myname = "sprintf"; +#endif + +#include + +int +checkit(expect, got) +char *expect; +char *got; +{ + if (strcmp(expect, got)) { + printf("%s oddity: Expected %s, got %s\n", + myname, expect, got); + exit(1); + } +} + +int +main() +{ + char buf[64]; + buf[63] = '\0'; + + /* This must be 1st test on (which?) platform */ + /* Alan Burlison */ + Gconvert(0.1, 8, 0, buf); + checkit("0.1", buf); + + Gconvert(1.0, 8, 0, buf); + checkit("1", buf); + + Gconvert(0.0, 8, 0, buf); + checkit("0", buf); + + Gconvert(-1.0, 8, 0, buf); + checkit("-1", buf); + + /* Some Linux gcvt's give 1.e+5 here. */ + Gconvert(100000.0, 8, 0, buf); + checkit("100000", buf); + + /* Some Linux gcvt's give -1.e+5 here. */ + Gconvert(-100000.0, 8, 0, buf); + checkit("-100000", buf); + + exit(0); +} +EOP +?X: List of order in which to search for functions. +?X: Usual order of efficiency is gconvert gcvt sprintf +?X: Respect a previous or hinted value. +case "$d_Gconvert" in +gconvert*) xxx_list='gconvert gcvt sprintf' ;; +gcvt*) xxx_list='gcvt gconvert sprintf' ;; +sprintf*) xxx_list='sprintf gconvert gcvt' ;; +*) xxx_list='gconvert gcvt sprintf' ;; +esac + +for xxx_convert in $xxx_list; do + echo "Trying $xxx_convert" + $rm -f try try$_o + if $cc $ccflags -DTRY_$xxx_convert $ldflags -o try \ + try.c $libs > /dev/null 2>&1 ; then + echo "$xxx_convert" found. >&4 + if ./try; then + echo "I'll use $xxx_convert to convert floats into a string." >&4 + break; + else + echo "...But $xxx_convert didn't work as I expected." + fi + else + echo "$xxx_convert NOT found." >&4 + fi +done + +case "$xxx_convert" in +gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;; +gcvt) d_Gconvert='gcvt((x),(n),(b))' ;; +*) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;; +esac + diff --git a/mcon/U/d_getgrps.U b/mcon/U/d_getgrps.U new file mode 100644 index 0000000..c05d531 --- /dev/null +++ b/mcon/U/d_getgrps.U @@ -0,0 +1,33 @@ +?RCS: $Id: d_getgrps.U,v 3.0 1993/08/18 12:06:08 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: d_getgrps.U,v $ +?RCS: Revision 3.0 1993/08/18 12:06:08 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?MAKE:d_getgrps: Inlibc +?MAKE: -pick add $@ %< +?S:d_getgrps: +?S: This variable conditionally defines the HAS_GETGROUPS symbol, which +?S: indicates to the C program that the getgroups() routine is available +?S: to get the list of process groups. +?S:. +?C:HAS_GETGROUPS (GETGROUPS): +?C: This symbol, if defined, indicates that the getgroups() routine is +?C: available to get the list of process groups. If unavailable, multiple +?C: groups are probably not supported. +?C:. +?H:#$d_getgrps HAS_GETGROUPS /**/ +?H:. +?LINT:set d_getgrps +: see if getgroups exists +set getgroups d_getgrps +eval $inlibc + diff --git a/mcon/U/d_gethbynm.U b/mcon/U/d_gethbynm.U new file mode 100644 index 0000000..f5ed463 --- /dev/null +++ b/mcon/U/d_gethbynm.U @@ -0,0 +1,32 @@ +?RCS: $Id: d_gethbynm.U,v 3.0 1993/08/18 12:06:08 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: d_gethbynm.U,v $ +?RCS: Revision 3.0 1993/08/18 12:06:08 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?MAKE:d_gethbynm: Inlibc +?MAKE: -pick add $@ %< +?S:d_gethbynm (d_gethhstby): +?S: This variable conditionally defines the HAS_GETHOSTBYNAME symbol, which +?S: indicates to the C program that the gethostbyname() routine is available +?S: to lookup host names in some data base or other. +?S:. +?C:HAS_GETHOSTBYNAME (GETHOSTBYNAME): +?C: This symbol, if defined, indicates that the gethostbyname() routine is +?C: available to lookup host names in some data base or other. +?C:. +?H:#$d_gethbynm HAS_GETHOSTBYNAME /**/ +?H:. +?LINT:set d_gethbynm +: see if gethostbyname exists +set gethostbyname d_gethbynm +eval $inlibc + diff --git a/mcon/U/d_gethent.U b/mcon/U/d_gethent.U new file mode 100644 index 0000000..4a39465 --- /dev/null +++ b/mcon/U/d_gethent.U @@ -0,0 +1,31 @@ +?RCS: $Id: d_gethent.U,v 3.0 1993/08/18 12:06:09 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: d_gethent.U,v $ +?RCS: Revision 3.0 1993/08/18 12:06:09 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?MAKE:d_gethent: Inlibc +?MAKE: -pick add $@ %< +?S:d_gethent: +?S: This variable conditionally defines HAS_GETHOSTENT if gethostent() is +?S: available to dup file descriptors. +?S:. +?C:HAS_GETHOSTENT (GETHOSTENT): +?C: This symbol, if defined, indicates that the gethostent routine is +?C: available to lookup host names in some data base or other. +?C:. +?H:#$d_gethent HAS_GETHOSTENT /**/ +?H:. +?LINT:set d_gethent +: see if gethostent exists +set gethostent d_gethent +eval $inlibc + diff --git a/mcon/U/d_gethid.U b/mcon/U/d_gethid.U new file mode 100644 index 0000000..c5131b6 --- /dev/null +++ b/mcon/U/d_gethid.U @@ -0,0 +1,31 @@ +?RCS: $Id: d_gethid.U,v 3.0 1993/08/18 12:06:10 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: d_gethid.U,v $ +?RCS: Revision 3.0 1993/08/18 12:06:10 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?MAKE:d_gethid: Inlibc +?MAKE: -pick add $@ %< +?S:d_gethid: +?S: This variable conditionally defines HAS_GETHOSTID if gethostid() is +?S: available to get the host id. +?S:. +?C:HAS_GETHOSTID (GETHOSTID): +?C: This symbol, if defined, indicates that the gethostid system call is +?C: available to get the host id. +?C:. +?H:#$d_gethid HAS_GETHOSTID /**/ +?H:. +?LINT:set d_gethid +: see if gethid exists +set gethostid d_gethid +eval $inlibc + diff --git a/mcon/U/d_gethname.U b/mcon/U/d_gethname.U new file mode 100644 index 0000000..67b59f0 --- /dev/null +++ b/mcon/U/d_gethname.U @@ -0,0 +1,287 @@ +?RCS: $Id: d_gethname.U,v 3.0.1.1 1994/10/29 16:13:00 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: d_gethname.U,v $ +?RCS: Revision 3.0.1.1 1994/10/29 16:13:00 ram +?RCS: patch36: call ./xenix explicitely instead of relying on PATH +?RCS: +?RCS: Revision 3.0 1993/08/18 12:06:11 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?MAKE:d_gethname d_uname d_phostname aphostname: phostname cat \ + myhostname package d_portable Loc libc echo n c +i_whoami +usrinc \ + Myread Guess Oldconfig Csym +?MAKE: -pick add $@ %< +?S:d_gethname: +?S: This variable conditionally defines the HAS_GETHOSTNAME symbol, which +?S: indicates to the C program that the gethostname() routine may be +?S: used to derive the host name. +?S:. +?S:d_uname: +?S: This variable conditionally defines the HAS_UNAME symbol, which +?S: indicates to the C program that the uname() routine may be +?S: used to derive the host name. +?S:. +?S:d_phostname: +?S: This variable conditionally defines the PHOSTNAME symbol, which +?S: contains the shell command which, when fed to popen(), may be +?S: used to derive the host name. +?S:. +?S:aphostname: +?S: Thie variable contains the command which can be used to compute the +?S: host name. The command is fully qualified by its absolute path, to make +?S: it safe when used by a process with super-user privileges. +?S:. +?C:HAS_GETHOSTNAME (GETHOSTNAME): +?C: This symbol, if defined, indicates that the C program may use the +?C: gethostname() routine to derive the host name. See also HAS_UNAME +?C: and PHOSTNAME. +?C:. +?C:HAS_UNAME (UNAME): +?C: This symbol, if defined, indicates that the C program may use the +?C: uname() routine to derive the host name. See also HAS_GETHOSTNAME +?C: and PHOSTNAME. +?C:. +?C:PHOSTNAME: +?C: This symbol, if defined, indicates that the C program may use the +?C: contents of PHOSTNAME as a command to feed to the popen() routine +?C: to derive the host name. See also HAS_GETHOSTNAME and HAS_UNAME. +?C: Note that the command uses a fully qualified path, so that it is safe +?C: even if used by a process with super-user privileges. +?C:. +?H:#$d_gethname HAS_GETHOSTNAME /**/ +?H:#$d_uname HAS_UNAME /**/ +?H:#$d_phostname PHOSTNAME "$aphostname" /* How to get the host name */ +?H:. +?T:file val call +?LINT:change i_whoami +: see how we will look up host name +echo " " +if false; then + : dummy stub to allow use of elif +@if HAS_GETHOSTNAME +elif set gethostname val -f d_gethname; eval $csym; $val; then + echo 'gethostname() found.' >&4 + d_gethname="$define" + call=gethostname +@end +@if HAS_UNAME +elif set uname val -f d_uname; eval $csym; $val; then + if ./xenix; then + $cat <<'EOM' +uname() was found, but you're running xenix, and older versions of xenix +have a broken uname(). If you don't really know whether your xenix is old +enough to have a broken system call, use the default answer. + +EOM + dflt=y + case "$d_uname" in + "$define") dflt=n;; + esac + rp='Is your uname() broken?' + . ./myread + case "$ans" in + n*) d_uname="$define"; call=uname;; + esac + else + echo 'uname() found.' >&4 + d_uname="$define" + call=uname + fi +@end +fi +case "$d_gethname" in +'') d_gethname="$undef";; +esac +case "$d_uname" in +'') d_uname="$undef";; +esac +@if PHOSTNAME || MYHOSTNAME +case "$d_uname$d_gethname" in +*define*) + dflt=n + cat <&4;; +@ end + esac;; +esac +@elsif PHOSTNAME +case "$d_uname$d_gethname" in +*define*) ;; +*) + case "$phostname" in + '') +@ if WHOAMI + case "$i_whoami" in + "$define") + $cat <&4;; + esac;; +@ else + echo "There will be no way for $package to get your hostname." >&4;; +@ end + *) + echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4 + ;; + esac;; +esac +@elsif MYHOSTNAME +case "$d_uname$d_gethname" in +*define*) ;; +*) +@ if WHOAMI + case "$i_whoami" in + "$define") + dflt=y + $cat <&4;; + esac;; +@ else + echo 'Hardwiring "'$myhostname'".' >&4;; +@ end +esac +@end +case "$d_phostname" in +'') d_phostname="$undef";; +esac + diff --git a/mcon/U/d_getlogin.U b/mcon/U/d_getlogin.U new file mode 100644 index 0000000..f93b762 --- /dev/null +++ b/mcon/U/d_getlogin.U @@ -0,0 +1,34 @@ +?RCS: $Id: d_getlogin.U,v 3.0.1.1 1994/08/29 16:07:41 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: Original Author: Andy Dougherty +?RCS: +?RCS: $Log: d_getlogin.U,v $ +?RCS: Revision 3.0.1.1 1994/08/29 16:07:41 ram +?RCS: patch32: created by ADO +?RCS: +?MAKE:d_getlogin: Inlibc +?MAKE: -pick add $@ %< +?S:d_getlogin: +?S: This variable conditionally defines the HAS_GETLOGIN symbol, which +?S: indicates to the C program that the getlogin() routine is available +?S: to get the login name. +?S:. +?C:HAS_GETLOGIN : +?C: This symbol, if defined, indicates that the getlogin routine is +?C: available to get the login name. +?C:. +?H:#$d_getlogin HAS_GETLOGIN /**/ +?H:. +?LINT:set d_getlogin +: see if getlogin exists +set getlogin d_getlogin +eval $inlibc + diff --git a/mcon/U/d_getopt.U b/mcon/U/d_getopt.U new file mode 100644 index 0000000..de625dc --- /dev/null +++ b/mcon/U/d_getopt.U @@ -0,0 +1,31 @@ +?RCS: $Id: d_getopt.U,v 3.0 1993/08/18 12:06:13 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: d_getopt.U,v $ +?RCS: Revision 3.0 1993/08/18 12:06:13 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?MAKE:d_getopt: Inlibc +?MAKE: -pick add $@ %< +?S:d_getopt: +?S: This variable conditionally defines the HAS_GETOPT symbol, which +?S: indicates that the getopt() routine exists. The getopt() routine +?S: parses command line options in a standard fashion. +?S:. +?C:HAS_GETOPT (GETOPT): +?C: This symbol, if defined, indicates that the getopt() routine exists. +?C:. +?H:#$d_getopt HAS_GETOPT /**/ +?H:. +?LINT:set d_getopt +: see if getopt exists +set getopt d_getopt +eval $inlibc + diff --git a/mcon/U/d_getpagsz.U b/mcon/U/d_getpagsz.U new file mode 100644 index 0000000..428e64e --- /dev/null +++ b/mcon/U/d_getpagsz.U @@ -0,0 +1,104 @@ +?RCS: $Id: d_getpagsz.U,v 3.0.1.1 1994/10/29 16:13:10 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: d_getpagsz.U,v $ +?RCS: Revision 3.0.1.1 1994/10/29 16:13:10 ram +?RCS: patch36: added ?F: line for metalint file checking +?RCS: +?RCS: Revision 3.0 1993/08/18 12:06:14 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?MAKE:d_getpagsz pagesize: Oldconfig Myread Inlibc cat contains +cc +ccflags \ + libs rm Findhdr +?MAKE: -pick add $@ %< +?S:d_getpagsz: +?S: This variable conditionally defines HAS_GETPAGESIZE if getpagesize() +?S: is available to get the system page size. +?S:. +?S:pagesize (pagsize): +?S: This variable holds the size in bytes of a system page. +?S:. +?C:HAS_GETPAGESIZE (GETPAGESIZE): +?C: This symbol, if defined, indicates that the getpagesize system call +?C: is available to get system page size, which is the granularity of +?C: many memory management calls. +?C:. +?X: Don't name it PAGESIZE, this is sometimes used by +?C:PAGESIZE_VALUE (PAGSIZE): +?C: This symbol holds the size in bytes of a system page (obtained via +?C: the getpagesize() system call at configuration time or asked to the +?C: user if the system call is not available). +?C:. +?H:#$d_getpagsz HAS_GETPAGESIZE /**/ +?H:#define PAGESIZE_VALUE $pagesize /* System page size, in bytes */ +?H:. +?F:!page +?T:guess +?LINT:set d_getpagsz +: see if getpagesize exists +set getpagesize d_getpagsz +eval $inlibc + +@if pagesize || PAGESIZE_VALUE +: determine the system page size +echo " " +guess=' (OK to guess)' +case "$pagesize" in +'') + $cat >page.c <&4 + dflt='4096' + case "$d_getpagsz" in + "$define") + if $cc $ccflags page.c -o page $libs >/dev/null 2>&1; then + dflt=`./page` + guess='' + else + echo "(I can't seem to compile the test program--guessing)" + fi + ;; + *) + if $cc $ccflags page.c -o page $libs -lPW >/dev/null 2>&1; then + dflt=`./page` + guess='' + echo "(For your eyes only: I used the getpagesize() from -lPW.)" + else + if $contains PAGESIZE `./findhdr sys/param.h` >/dev/null 2>&1; then + $cat >page.c < +main() +{ + printf("%d\n", PAGESIZE); +} +EOP + if $cc $ccflags page.c -o page $libs >/dev/null 2>&1; then + dflt=`./page` + guess='' + echo "(Using value of PAGESIZE found in .)" + fi + fi + fi + ;; + esac + ;; +*) dflt="$pagesize"; guess='';; +esac +rp="What is the system page size, in bytes$guess?" +. ./myread +pagesize=$ans +$rm -f page.c page + +@end diff --git a/mcon/U/d_getpgid.U b/mcon/U/d_getpgid.U new file mode 100644 index 0000000..5462570 --- /dev/null +++ b/mcon/U/d_getpgid.U @@ -0,0 +1,34 @@ +?RCS: $Id: d_getpgid.U,v 3.0.1.1 1997/02/28 15:33:44 ram Exp $ +?RCS: +?RCS: Copyright (c) 1996, Andy Dougherty +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: d_getpgid.U,v $ +?RCS: Revision 3.0.1.1 1997/02/28 15:33:44 ram +?RCS: patch61: created +?RCS: +?MAKE:d_getpgid: Inlibc +?MAKE: -pick add $@ %< +?S:d_getpgid: +?S: This variable conditionally defines the HAS_GETPGID symbol, which +?S: indicates to the C program that the getpgid(pid) function +?S: is available to get the process group id. +?S:. +?C:HAS_GETPGID: +?C: This symbol, if defined, indicates to the C program that +?C: the getpgid(pid) function is available to get the +?C: process group id. +?C:. +?H:#$d_getpgid HAS_GETPGID /**/ +?H:. +?LINT:set d_getpgid +: see if getpgid exists +set getpgid d_getpgid +eval $inlibc + diff --git a/mcon/U/d_getpgrp.U b/mcon/U/d_getpgrp.U new file mode 100644 index 0000000..c4d6d01 --- /dev/null +++ b/mcon/U/d_getpgrp.U @@ -0,0 +1,105 @@ +?RCS: $Id: d_getpgrp.U,v 3.0.1.1 1997/02/28 15:34:28 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: d_getpgrp.U,v $ +?RCS: Revision 3.0.1.1 1997/02/28 15:34:28 ram +?RCS: patch61: new USE_BSD_GETPGRP to detect the getpgrp() flavour +?RCS: +?RCS: Revision 3.0 1993/08/18 12:06:15 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?MAKE:d_getpgrp d_bsdgetpgrp: Guess Inlibc Setvar cat rm \ + +cc +ccflags +ldflags +libs i_unistd +?MAKE: -pick add $@ %< +?S:d_getpgrp: +?S: This variable conditionally defines HAS_GETPGRP if getpgrp() is +?S: available to get the current process group. +?S:. +?S:d_bsdgetpgrp: +?S: This variable conditionally defines USE_BSD_GETPGRP if +?S: getpgrp needs one arguments whereas USG one needs none. +?S:. +?C:HAS_GETPGRP (GETPGRP): +?C: This symbol, if defined, indicates that the getpgrp routine is +?C: available to get the current process group. +?C:. +?C:USE_BSD_GETPGRP: +?C: This symbol, if defined, indicates that getpgrp needs one +?C: arguments whereas USG one needs none. +?C:. +?H:#$d_getpgrp HAS_GETPGRP /**/ +?H:#$d_bsdgetpgrp USE_BSD_GETPGRP /**/ +?H:. +?T:xxx +?LINT:set d_getpgrp d_bsdgetpgrp +: see if getpgrp exists +set getpgrp d_getpgrp +eval $inlibc + +@if USE_BSD_GETPGRP || d_bsdgetpgrp +case "$d_getpgrp" in +"$define") + echo " " + echo "Checking to see which flavor of getpgrp is in use..." + $cat >set.c < +#ifdef I_UNISTD +# include +#endif +main() +{ + if (getuid() == 0) { + printf("(I see you are running Configure as super-user...)\n"); + setuid(1); + } +#ifdef TRY_BSD_PGRP + if (getpgrp(1) == 0) + exit(0); +#else + if (getpgrp() > 0) + exit(0); +#endif + exit(1); +} +EOP + if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then + echo "You have to use getpgrp(pid) instead of getpgrp()." >&4 + val="$define" + elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then + echo "You have to use getpgrp() instead of getpgrp(pid)." >&4 + val="$undef" + else + echo "I can't seem to compile and run the test program." + if ./usg; then + xxx="a USG one, i.e. you use getpgrp()." + else + # SVR4 systems can appear rather BSD-ish. + case "$i_unistd" in + $undef) + xxx="a BSD one, i.e. you use getpgrp(pid)." + val="$define" + ;; + $define) + xxx="probably a USG one, i.e. you use getpgrp()." + val="$undef" + ;; + esac + fi + echo "Assuming your getpgrp is $xxx" >&4 + fi + ;; +*) val="$undef";; +esac +set d_bsdgetpgrp +eval $setvar +$rm -f set set.c +@end + diff --git a/mcon/U/d_getpgrp2.U b/mcon/U/d_getpgrp2.U new file mode 100644 index 0000000..f10152a --- /dev/null +++ b/mcon/U/d_getpgrp2.U @@ -0,0 +1,32 @@ +?RCS: $Id: d_getpgrp2.U,v 3.0 1993/08/18 12:06:15 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: d_getpgrp2.U,v $ +?RCS: Revision 3.0 1993/08/18 12:06:15 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?MAKE:d_getpgrp2: Inlibc +?MAKE: -pick add $@ %< +?S:d_getpgrp2: +?S: This variable conditionally defines the HAS_GETPGRP2 symbol, which +?S: indicates to the C program that the getpgrp2() (as in DG/UX) routine +?S: is available to get the current process group. +?S:. +?C:HAS_GETPGRP2 (GETPGRP2): +?C: This symbol, if defined, indicates that the getpgrp2() (as in DG/UX) +?C: routine is available to get the current process group. +?C:. +?H:#$d_getpgrp2 HAS_GETPGRP2 /**/ +?H:. +?LINT:set d_getpgrp2 +: see if getpgrp2 exists +set getpgrp2 d_getpgrp2 +eval $inlibc + diff --git a/mcon/U/d_getppid.U b/mcon/U/d_getppid.U new file mode 100644 index 0000000..ca73aa5 --- /dev/null +++ b/mcon/U/d_getppid.U @@ -0,0 +1,34 @@ +?RCS: $Id: d_getppid.U,v 3.0.1.1 1994/08/29 16:07:45 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: Original Author: Andy Dougherty +?RCS: +?RCS: $Log: d_getppid.U,v $ +?RCS: Revision 3.0.1.1 1994/08/29 16:07:45 ram +?RCS: patch32: created by ADO +?RCS: +?MAKE:d_getppid: Inlibc +?MAKE: -pick add $@ %< +?S:d_getppid: +?S: This variable conditionally defines the HAS_GETPPID symbol, which +?S: indicates to the C program that the getppid() routine is available +?S: to get the parent process ID. +?S:. +?C:HAS_GETPPID : +?C: This symbol, if defined, indicates that the getppid routine is +?C: available to get the parent process ID. +?C:. +?H:#$d_getppid HAS_GETPPID /**/ +?H:. +?LINT:set d_getppid +: see if getppid exists +set getppid d_getppid +eval $inlibc + diff --git a/mcon/U/d_getprior.U b/mcon/U/d_getprior.U new file mode 100644 index 0000000..a8708ad --- /dev/null +++ b/mcon/U/d_getprior.U @@ -0,0 +1,31 @@ +?RCS: $Id: d_getprior.U,v 3.0 1993/08/18 12:06:16 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: d_getprior.U,v $ +?RCS: Revision 3.0 1993/08/18 12:06:16 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?MAKE:d_getprior: Inlibc +?MAKE: -pick add $@ %< +?S:d_getprior: +?S: This variable conditionally defines HAS_GETPRIORITY if getpriority() +?S: is available to get a process's priority. +?S:. +?C:HAS_GETPRIORITY (GETPRIORITY): +?C: This symbol, if defined, indicates that the getpriority routine is +?C: available to get a process's priority. +?C:. +?H:#$d_getprior HAS_GETPRIORITY /**/ +?H:. +: see if getpriority exists +?LINT:set d_getprior +set getpriority d_getprior +eval $inlibc + diff --git a/mcon/U/d_getpwent.U b/mcon/U/d_getpwent.U new file mode 100644 index 0000000..6cdf6bc --- /dev/null +++ b/mcon/U/d_getpwent.U @@ -0,0 +1,40 @@ +?RCS: $Id: d_getpwent.U,v 3.0 1993/08/18 12:06:17 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: d_getpwent.U,v $ +?RCS: Revision 3.0 1993/08/18 12:06:17 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?MAKE:d_getpwent: Csym Setvar +?MAKE: -pick add $@ %< +?S:d_getpwent: +?S: This variable conditionally defines the HAS_GETPWENT symbol, which +?S: indicates to the C program that it should use the getpwent() +?S: routine instead of the getpw() routine. +?S:. +?C:HAS_GETPWENT (GETPWENT): +?C: This symbol, if defined, indicates that the getpwent() routine +?C: should be used instead of the getpw() routine. +?C:. +?H:#$d_getpwent HAS_GETPWENT /**/ +?H:. +?LINT:set d_getpwent +: see if there is a getpwent +echo " " +if set getpwent val -f d_getpwent; eval $csym; $val; then + echo "getpwent() found." >&4 + val="$define" +else + echo "No getpwent() found -- will use getpw() instead." >&4 + val="$undef" +fi +set d_getpwent +eval $setvar + diff --git a/mcon/U/d_getwd.U b/mcon/U/d_getwd.U new file mode 100644 index 0000000..ab56449 --- /dev/null +++ b/mcon/U/d_getwd.U @@ -0,0 +1,41 @@ +?RCS: $Id: d_getwd.U,v 3.0 1993/08/18 12:06:18 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: d_getwd.U,v $ +?RCS: Revision 3.0 1993/08/18 12:06:18 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?MAKE:d_getwd: Csym Setvar +?MAKE: -pick add $@ %< +?S:d_getwd: +?S: This variable conditionally defines HAS_GETWD if getwd() is +?S: available to get working directory. If not, you should +?S: probably use getcwd(). +?S:. +?C:HAS_GETWD (GETWD): +?C: This symbol, if defined, indicates that the getwd routine is +?C: available to get working directory. If not, you should +?C: probably use getcwd(). +?C:. +?H:#$d_getwd HAS_GETWD /**/ +?H:. +?LINT:set d_getwd +: see if getwd exists +echo " " +if set getwd val -f d_getwd; eval $csym; $val; then + echo 'getwd() found.' >&4 + val="$define" +else + echo 'getwd() not found. Assuming getcwd() exists.' >&4 + val="$undef" +fi +set d_getwd +eval $setvar + diff --git a/mcon/U/d_gnulibc.U b/mcon/U/d_gnulibc.U new file mode 100644 index 0000000..7cf63ca --- /dev/null +++ b/mcon/U/d_gnulibc.U @@ -0,0 +1,53 @@ +?RCS: $Id: d_gnulibc.U,v 3.0.1.1 1997/02/28 15:34:33 ram Exp $ +?RCS: +?RCS: Copyright (c) 1996, Andy Dougherty +?RCS: Copyright (c) 1996, Sven Verdoolaege +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: d_gnulibc.U,v $ +?RCS: Revision 3.0.1.1 1997/02/28 15:34:33 ram +?RCS: patch61: created +?RCS: +?MAKE:d_gnulibc: Myread Oldconfig Setvar contains rm \ + +cc +ccflags +ldflags +libs +?MAKE: -pick add $@ %< +?S:d_gnulibc: +?S: Defined if we're dealing with the GNU C Library. +?S:. +?C:HAS_GNULIBC: +?C: This symbol, if defined, indicates to the C program that +?C: the GNU C library is being used. +?C:. +?H:#$d_gnulibc HAS_GNULIBC /**/ +?H. +?LINT: set d_gnulibc +?X: gnulibc can be executed by calling this entry point. +?X: Ulrich Drepper doesn't think any other libc does that, +?X: but we check if it says 'GNU C Library' to be sure. +echo " " +echo "Checking for GNU C Library..." >&4 +cat >gnulibc.c </dev/null 2>&1 && \ + ./gnulibc | $contains '^GNU C Library' >/dev/null 2>&1; then + val="$define" + echo "You are using the GNU C Library" +else + val="$undef" + echo "You are not using the GNU C Library" +fi +$rm -f gnulibc* +set d_gnulibc +eval $setvar + diff --git a/mcon/U/d_group.U b/mcon/U/d_group.U new file mode 100644 index 0000000..ebcb4fb --- /dev/null +++ b/mcon/U/d_group.U @@ -0,0 +1,23 @@ +?RCS: $Id: d_group.U,v 3.0.1.2 1997/02/28 15:34:52 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: Original Author: Andy Dougherty +?RCS: +?RCS: $Log: d_group.U,v $ +?RCS: Revision 3.0.1.2 1997/02/28 15:34:52 ram +?RCS: patch61: useless unit dropped. +?RCS: +?RCS: Revision 3.0.1.1 1994/08/29 16:07:48 ram +?RCS: patch32: created by ADO +?RCS: +?X: +?X: Useless unit dropped. +?X: +?LINT:empty diff --git a/mcon/U/d_havetlib.U b/mcon/U/d_havetlib.U new file mode 100644 index 0000000..4abfb71 --- /dev/null +++ b/mcon/U/d_havetlib.U @@ -0,0 +1,125 @@ +?RCS: $Id: d_havetlib.U,v 3.0.1.2 1997/02/28 15:36:31 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: d_havetlib.U,v $ +?RCS: Revision 3.0.1.2 1997/02/28 15:36:31 ram +?RCS: patch61: replaced .a with $_a all over the place +?RCS: patch61: likewise for .o replaced by $_o +?RCS: +?RCS: Revision 3.0.1.1 1994/05/06 14:44:06 ram +?RCS: patch23: added AIX support to accept shared lib stub as termlib (WED) +?RCS: +?RCS: Revision 3.0 1993/08/18 12:06:19 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?MAKE:d_havetlib termlib: cat contains Myread Loc Filexp Oldconfig libpth \ + test uname _a _o +?MAKE: -pick add $@ %< +?S:d_havetlib: +?S: This variable conditionally defines the HAS_TERMLIB symbol, which +?S: indicates to the C program that termlib-style routines are available. +?S:. +?S:termlib: +?S: This variable contains the argument to pass to the loader to get +?S: termlib-style routines. It is up to the Makefile.SH to make sure +?S: the value gets to the right command. Note that on many systems the +?S: termlib routines are emulated by the curses or terminfo library. +?S:. +?C:HAS_TERMLIB (HAVETERMLIB): +?C: This symbol, when defined, indicates that termlib-style routines +?C: are available. There is nothing to include. +?C:. +?H:#$d_havetlib HAS_TERMLIB /**/ +?H:. +?T:xxx +: where do we get termlib routines from +echo " " +xxx=`./loc libcurses$_a x $libpth` +case "$xxx" in +/*) + ar t $xxx >grimble + if $contains tputs$_o grimble >/dev/null 2>&1; then + termlib='-lcurses' + d_havetlib="$define" + echo "Terminfo library found." >&4 + elif $test "x`$uname 2>/dev/null`" = xAIX; then + # Ok, do the AIX shr.o fun thing + /usr/ccs/bin/nm -en $xxx 2>/dev/null >grimble + if $contains '^tputs .*|extern|' grimble >/dev/null 2>&1; then + termlib='-lcurses' + d_havetlib="$define" + echo "AIX Terminfo library found." >&4 + else + xxx=x + fi + else + xxx=x + fi + rm -f grimble + ;; +esac +case "$xxx" in +x) + xxx=`./loc libtermlib$_a x $libpth` + case "$xxx" in + /usr/lib*|/lib*) + termlib='-ltermlib' + d_havetlib="$define" + echo "Termlib library found." >&4 + ;; + /*) + termlib="$xxx" + d_havetlib="$define" + echo "Termlib library found." >&4 + ;; + *) + xxx=`./loc libtermcap$_a x $libpth` + case "$xxx" in + /usr/lib*|/lib*) + termlib='-ltermcap' + d_havetlib="$define" + echo "Termcap library found." >&4 + ;; + /*) + termlib="$xxx" + d_havetlib="$define" + echo "Termcap library found." >&4 + ;; + *) + case "$termlib" in + '') + dflt=y +rp="Your system appears to NOT have termlib-style routines. Is this true?" + . ./myread + case "$ans" in + n*|f*) d_havetlib="$define" + $cat <<'EOM' +Then where are the termlib-style routines kept? Specify either -llibname +or a full pathname (~name ok). + +EOM + dflt='' + rp='Specify termlib path:' + . ./myread + termlib=`./filexp $ans` + ;; + *) + d_havetlib="$undef" + termlib='' + echo "You will have to play around with term.c then." >&4 + ;; + esac + echo " ";; + *) echo "You said termlib was $termlib before." >&4;; + esac;; + esac;; + esac;; +esac + diff --git a/mcon/U/d_hidnet.U b/mcon/U/d_hidnet.U new file mode 100644 index 0000000..0388b6b --- /dev/null +++ b/mcon/U/d_hidnet.U @@ -0,0 +1,68 @@ +?RCS: $Id: d_hidnet.U,v 3.0 1993/08/18 12:06:20 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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 3.0. +?RCS: +?RCS: $Log: d_hidnet.U,v $ +?RCS: Revision 3.0 1993/08/18 12:06:20 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?MAKE:d_hidnet hiddennet: cat sed myhostname mydomain Myread Oldconfig +?MAKE: -pick add $@ %< +?S:d_hidnet: +?S: This variable conditionally defines the symbol HIDDEN_NET, which +?S: tells the C program that it should pretend it is on a different +?S: host for purposes of advertising a mailing address. +?S:. +?S:hiddennet: +?S: This variable contains the value eventually given to the symbol +?S: HIDDEN_NET, if d_hidnet defines it. If defined, it's the name +?S: of the host which serves as the mail server for a network that +?S: is invisible to the outside world. +?S:. +?C:HIDDEN_NET (HIDDENNET): +?C: This symbol, if defined, contains the host name that you want to +?C: advertise to the outside world. This name can be different from +?C: your actual host name, as long as the machine you specify knows +?C: how to forward mail to you. +?C:. +?H:#$d_hidnet HIDDEN_NET "$hiddennet" /**/ +?H:. +: now get the host name to advertise as our mailing address +case "$hiddennet" in +'') dflt=n;; +*) dflt=y;; +esac +$cat <