From: Sam Hartman Date: Thu, 5 Jul 2001 00:54:55 +0000 (+0000) Subject: Initial revision X-Git-Tag: debian/1.0.90.20010704.snapshot-1~7 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=98028e18648e8f909e8529c93b3711660b34e7bb;p=packages%2Fo%2Fopenafs.git Initial revision --- diff --git a/Makefile.in b/Makefile.in new file mode 100644 index 000000000..148d59aea --- /dev/null +++ b/Makefile.in @@ -0,0 +1,591 @@ +# Copyright 2000, International Business Machines Corporation and others. +# All Rights Reserved. +# +# This software has been released under the terms of the IBM Public +# License. For details, see the LICENSE file in the top-level source +# directory or online at http://www.openafs.org/dl/license10.html + +SHELL=/bin/sh +DESTDIR=dest/ +SRCDIR=${DESTDIR} +INSTALL=${SRCDIR}bin/install + +MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1 + +# Systype-generic items +SYS_NAME=@AFS_SYSNAME@ +MKAFS_OSTYPE=@MKAFS_OSTYPE@ + +# Systype-specific items +LINUX_KERNEL_PATH=@LINUX_KERNEL_PATH@ +LINUX_VERSION=@LINUX_VERSION@ + +# Other items +LIB_AFSDB=@LIB_AFSDB@ + +# Enable build+install of obsolete and insecure packages +# Set to anything other than YES, or comment out to disable the build +WITH_OBSOLETE=@WITH_OBSOLETE@ +WITH_INSECURE=@WITH_INSECURE@ + +# To compile AFS from scratch in the src tree run "make SYS_NAME=". +# This recursively calls "make install ..." and does not depend on the +# existence of any non-standard programs. +# To compile a package and all its predecessors using washtool run +# "make ". This requires that @sys works, and that washtool, +# rcsupdate and our version of ci and co exist. +# To compile for the kernel type "make blibafs". This assumes washtool, +# install, rxgen, compile_et and others already exist and runs it with +# "-argument kinstall". + +all: + set ${SYS_NAME}/dest; $(MKDIR_IF_NEEDED) + $(MAKE) install "COMPILE_PART1=cd src; cd" "COMPILE_PART2=; $(MAKE) install SYS_NAME=${SYS_NAME} DESTDIR=`pwd`/${SYS_NAME}/dest/ TOP_SRCDIR=@TOP_SRCDIR@ SRCDIR=`pwd`/${SYS_NAME}/dest/" "COMPILE_PART3=; $(MAKE) test SYS_NAME=${SYS_NAME} DESTDIR=`pwd`/${SYS_NAME}/dest/ TOP_SRCDIR=@TOP_SRCDIR@ SRCDIR=`pwd`/${SYS_NAME}/dest/" "COMPILE_CLEAN=; $(MAKE) clean SYS_NAME=${SYS_NAME} DESTDIR=`pwd`/${SYS_NAME}/dest/ TOP_SRCDIR=@TOP_SRCDIR@ SRCDIR=`pwd`/${SYS_NAME}/dest/" SYS_NAME=${SYS_NAME} + +project: cmd comerr + +config: + ${COMPILE_PART1} config ${COMPILE_PART2} + +pinstall: config + ${COMPILE_PART1} pinstall ${COMPILE_PART2} + +procmgmt: config pinstall + ${COMPILE_PART1} procmgmt ${COMPILE_PART2} + +util: pinstall procmgmt + ${COMPILE_PART1} util ${COMPILE_PART2} + +audit: pinstall rx rxkad fsint + ${COMPILE_PART1} audit ${COMPILE_PART2} + +comerr: util + ${COMPILE_PART1} comerr ${COMPILE_PART2} + +cmd: comerr + ${COMPILE_PART1} cmd ${COMPILE_PART2} + @case ${SYS_NAME} in \ + sgi_6* | sun4x_57 | sun4x_58 | hp_ux11* | sparc64_linux* | alpha_linux* ) \ + ${COMPILE_PART1} cmd ${COMPILE_PART2} install64 ;; \ + esac + +lwp: project util + ${COMPILE_PART1} lwp ${COMPILE_PART2} + +rxgen: pinstall + ${COMPILE_PART1} rxgen ${COMPILE_PART2} + +rxobj: + +kernrx: + ${COMPILE_PART1} rx ${COMPILE_PART2} + +rx: project lwp rxgen + ${COMPILE_PART1} rx ${COMPILE_PART2} + +rxstat: rx + ${COMPILE_PART1} rxstat ${COMPILE_PART2} + +rxincls: rxobj + ${COMPILE_PART1} rx ${COMPILE_PART2} + +rxtests: rxobj + ${COMPILE_PART1} rx ${COMPILE_PART3} + +fsint: project kfsint + +kfsint: rxgen rxincls lwp + ${COMPILE_PART1} fsint ${COMPILE_PART2} + +export2: project fsint + +export: fsint + @case ${SYS_NAME} in \ + rs_aix*) \ + ${COMPILE_PART1} export ${COMPILE_PART2} ;; \ + * ) echo skipping export for ${SYS_NAME} ;; \ + esac + +afs: export + ${COMPILE_PART1} afs ${COMPILE_PART2} + +des: config + ${COMPILE_PART1} des ${COMPILE_PART2} + +sys: project des rx rxstat fsint + ${COMPILE_PART1} sys ${COMPILE_PART2} + +rxkad: project des + ${COMPILE_PART1} rxkad ${COMPILE_PART2} + +kernauth: + ${COMPILE_PART1} auth ${COMPILE_PART2} + +auth: project comerr des lwp rx sys rxkad audit + ${COMPILE_PART1} auth ${COMPILE_PART2} + +ubik: project auth + ${COMPILE_PART1} ubik ${COMPILE_PART2} + +ubiktests: ubik sys + ${COMPILE_PART1} ubik ${COMPILE_PART3} + +ptserver: project ubik cmd comerr auth audit + ${COMPILE_PART1} ptserver ${COMPILE_PART2} + +kauth: project ubik cmd auth comerr ptserver audit libacl + ${COMPILE_PART1} kauth ${COMPILE_PART2} + +dauth: project ubik cmd auth comerr + ${COMPILE_PART1} dauth ${COMPILE_PART2} + +libacl: project ptserver + ${COMPILE_PART1} libacl ${COMPILE_PART2} + +kerndir: + ${COMPILE_PART1} dir ${COMPILE_PART2} + +dir: project libacl + ${COMPILE_PART1} dir ${COMPILE_PART2} + +# Removed from sgi_* case below: +# ${COMPILE_PART1} sgiefs ${COMPILE_PART2};; +sgiefs: + case ${SYS_NAME} in \ + sgi_*) \ + echo "SGI efs not supported" ;; \ + *) \ + echo No efs stuff for ${SYS_NAME};; \ + esac + +vol: project dir afs sgiefs + ${COMPILE_PART1} vol ${COMPILE_PART2} + +vlserver: project vol audit + ${COMPILE_PART1} vlserver ${COMPILE_PART2} + +viced: project vlserver audit + ${COMPILE_PART1} viced ${COMPILE_PART2} + +tviced: project viced vlserver libafsrpc libafsauthent + case ${SYS_NAME} in \ + alpha_dux*|sgi_*|sun4x_*|rs_aix*|*linux*|hp_ux110) \ + ${COMPILE_PART1} tviced ${COMPILE_PART2} ;; \ + *) \ + echo Not building MT viced for ${SYS_NAME} ;; \ + esac + +volser: project tviced usd kauth audit + ${COMPILE_PART1} volser ${COMPILE_PART2} + +venus: project volser ptserver + ${COMPILE_PART1} venus ${COMPILE_PART2} + ${COMPILE_PART1} venus/test ${COMPILE_PART2} + +afsd: project sys kauth + ${COMPILE_PART1} afsd ${COMPILE_PART2} + +null: project + ${COMPILE_PART1} null ${COMPILE_PART2} + +gtx: project null auth # kauth rxkad ? + case ${SYS_NAME} in \ + rs_aix* | sun4x_5? | sgi_6? | *linux* | ppc_darwin* | *fbsd*) \ + rm -f ${DESTDIR}lib/afs/libtermlib.a; \ + ln -s libnull.a ${DESTDIR}lib/afs/libtermlib.a; \ + ${COMPILE_PART1} gtx ${COMPILE_PART2};; \ + *) \ + rm -f ${DESTDIR}lib/afs/libtermlib.a; \ + ln -s /usr/lib/libtermlib.a ${DESTDIR}lib/afs/libtermlib.a; \ + ${COMPILE_PART1} gtx ${COMPILE_PART2};; \ + esac + +fsprobe: project util fsint + ${COMPILE_PART1} fsprobe ${COMPILE_PART2} + +scout: project gtx fsprobe + ${COMPILE_PART1} scout ${COMPILE_PART2} + +uss: des kauth project rx vlserver vol + ${COMPILE_PART1} uss ${COMPILE_PART2} + +bozo: project ntp audit + ${COMPILE_PART1} bozo ${COMPILE_PART2} + + +# Removed from respective case statements below: +# ${COMPILE_PART1} vfsckaix42 ${COMPILE_PART2} ;; +# ${COMPILE_PART1} vfscksol25 ${COMPILE_PART2} ;; +# ${COMPILE_PART1} vfscksol26 ${COMPILE_PART2} ;; +# ${COMPILE_PART1} vfscksol27 ${COMPILE_PART2} ;; +vfsck: vol + set -x; \ + case ${SYS_NAME} in \ + sgi_* | *linux* | rs_aix42 | ppc_darwin* | hp_ux* | *fbsd* ) \ + echo skip vfsck for ${SYS_NAME} ;; \ + * ) \ + ${COMPILE_PART1} vfsck ${COMPILE_PART2} ;; \ + esac + +login: project kauth rxkad + set -x; \ + case ${SYS_NAME} in \ + sgi_* ) \ + ${COMPILE_PART1} sgistuff ${COMPILE_PART2} ;; \ + rs_aix42 ) \ + ${COMPILE_PART1} tsm41 ${COMPILE_PART2} ;; \ + alpha_dux* ) \ + ${COMPILE_PART1} sia ${COMPILE_PART2} ;; \ + sun4x_55 ) \ + ${COMPILE_PART1} login ${COMPILE_PART2} ;; \ + sun4x_* | hp_ux11* | *linux* | *fbsd* ) \ + ${COMPILE_PART1} pam ${COMPILE_PART2} ;; \ + ppc_darwin* ) \ + echo Skipping login for ${SYS_NAME} ;; \ + * ) \ + ${COMPILE_PART1} login ${COMPILE_PART2} ;; \ + esac + +KERNELDIR= \ + afs \ + dir \ + rx \ + fsint \ + auth \ + rxkad \ + util \ + libacl \ + vlserver \ + sgiefs \ + rxstat + + +UKERNELDIR= \ + afs \ + dir \ + rx \ + fsint \ + util \ + auth \ + rxkad \ + vlserver \ + kauth \ + des \ + afsweb \ + rxstat + + +libafs: libafs_setup ${KERNELDIR} + ${COMPILE_PART1} libafs ${COMPILE_PART2} + +libuafs: libuafs_setup ${UKERNELDIR} + set -x; \ + case ${SYS_NAME} in \ + hp_ux102* ) \ + echo Skipping libuafs for ${SYS_NAME} ;; \ + * ) \ + ${COMPILE_PART1} libuafs ${COMPILE_PART2} ;; \ + esac + +afsweb: kauth dauth + ${COMPILE_PART1} afsweb ${COMPILE_PART2} + +update: project auth + ${COMPILE_PART1} update ${COMPILE_PART2} + +log: project auth + ${COMPILE_PART1} log ${COMPILE_PART2} + +bu_utils: project + ${COMPILE_PART1} bu_utils ${COMPILE_PART2} + +usd: project + ${COMPILE_PART1} usd ${COMPILE_PART2} + +bubasics: project comerr + ${COMPILE_PART1} bubasics ${COMPILE_PART2} + +butm: project bubasics usd + ${COMPILE_PART1} butm ${COMPILE_PART2} + +butc: project bubasics butm budb bucoord cmd + ${COMPILE_PART1} butc ${COMPILE_PART2} + +tbutc: project bubasics butm budb bucoord cmd butc + case ${SYS_NAME} in \ + alpha_dux*|sgi_*|sun4x_*|rs_aix4*|*linux*|hp_ux110) \ + ${COMPILE_PART1} tbutc ${COMPILE_PART2} ;; \ + *) \ + echo Not building MT butc for ${SYS_NAME} ;; \ + esac + +budb: project bubasics + ${COMPILE_PART1} budb ${COMPILE_PART2} + +bucoord: project bubasics budb volser + ${COMPILE_PART1} bucoord ${COMPILE_PART2} + +xstat: project + ${COMPILE_PART1} xstat ${COMPILE_PART2} + +afsmonitor: project gtx xstat + ${COMPILE_PART1} afsmonitor ${COMPILE_PART2} + +tests: rxtests ubiktests + +# pthread based user space RX library +libafsrpc: rx rxkad des + case ${SYS_NAME} in \ + alpha_dux*|sgi_*|sun4x_*|rs_aix*|*linux*|hp_ux110) \ + ${COMPILE_PART1} libafsrpc ${COMPILE_PART2} ;; \ + *) \ + echo Not building MT libafsrpc for ${SYS_NAME} ;; \ + esac + +libafsauthent: ubik auth kauth libafsrpc + case ${SYS_NAME} in \ + alpha_dux*|sgi_*|sun4x_*|rs_aix*|*linux*|hp_ux110) \ + ${COMPILE_PART1} libafsauthent ${COMPILE_PART2} ;; \ + *) \ + echo Not building MT libafsrpc for ${SYS_NAME} ;; \ + esac + +libadmin_real: + ${COMPILE_PART1} libadmin ${COMPILE_PART2} + ${COMPILE_PART1} libadmin/adminutil ${COMPILE_PART2} + ${COMPILE_PART1} libadmin/vos ${COMPILE_PART2} + ${COMPILE_PART1} libadmin/client ${COMPILE_PART2} + ${COMPILE_PART1} libadmin/kas ${COMPILE_PART2} + ${COMPILE_PART1} libadmin/pts ${COMPILE_PART2} + ${COMPILE_PART1} libadmin/bos ${COMPILE_PART2} + ${COMPILE_PART1} libadmin/cfg ${COMPILE_PART2} + ${COMPILE_PART1} libadmin/test ${COMPILE_PART2} + ${COMPILE_PART1} libadmin/samples ${COMPILE_PART2} + +libadmin: libafsauthent bozo + case ${SYS_NAME} in \ + alpha_dux*|sgi_*|sun4x_*|rs_aix*|*linux*|hp_ux110) \ + $(MAKE) libadmin_real SYS_NAME=$(SYS_NAME) \ + COMPILE_PART1="$(COMPILE_PART1)" \ + COMPILE_PART2="$(COMPILE_PART2)" \ + TOP_SRCDIR=@TOP_SRCDIR@ \ + SRCDIR=$(SRCDIR) DESTDIR=$(DESTDIR) \ + DBG_DEFS=$(DBG_DEFS) ;; \ + *) \ + echo Not building MT libadmin for ${SYS_NAME} ;; \ + esac + +finale: project cmd comerr afsd allrcmds butc tbutc libafs libuafs audit kauth log package \ + ptserver scout bu_utils ubik uss bozo vfsck volser \ + venus update xstat afsmonitor dauth tests libafsrpc \ + libafsauthent libadmin + ${COMPILE_PART1} finale ${COMPILE_PART2} + +# Use washtool to ensure MakefileProto is current and obj/libafs exists. + +libafs_setup: config export + src/config/config src/libafs/MakefileProto.${MKAFS_OSTYPE} src/libafs/Makefile ${SYS_NAME} + +libuafs_setup: config export + src/config/config src/libuafs/MakefileProto.${MKAFS_OSTYPE} src/libuafs/Makefile ${SYS_NAME} + +TARGET=finale +install: + $(MAKE) $(TARGET) "SYS_NAME=${SYS_NAME}" \ + "COMPILE_PART1=${COMPILE_PART1}" \ + "COMPILE_PART2=${COMPILE_PART2}" \ + DESTDIR=`pwd`/${SYS_NAME}/dest/ \ + TOP_SRCDIR=@TOP_SRCDIR@ \ + SRCDIR=`pwd`/${SYS_NAME}/dest/ \ + "DBG_DEFS=${DBG_DEFS}" + +kupdate: updatekdir libafs_setup libuafs_setup + +blibafs: + $(MAKE) libafs "WASHTOOL=${WASHTOOL}" "WASHTOOLFLAGS=-argument kinstall" SYS_NAME=${SYS_NAME} "CPUARCH=${CPUARCH}" "MPSP=${MPSP}" "DBG_DEFS=${DBG_DEFS}" + +blibuafs: + $(MAKE) libuafs "WASHTOOL=${WASHTOOL}" "WASHTOOLFLAGS=-argument ukinstall" SYS_NAME=${SYS_NAME} "CPUARCH=${CPUARCH}" "MPSP=${MPSP}" "DBG_DEFS=${DBG_DEFS}" + +bwebafs: sys + $(MAKE) libuafs "WASHTOOL=${WASHTOOL}" "WASHTOOLFLAGS=-argument webinstall" SYS_NAME=${SYS_NAME} "CPUARCH=${CPUARCH}" "MPSP=${MPSP}" "DBG_DEFS=${DBG_DEFS}" + +clean: + $(MAKE) clean2 "COMPILE_PART1=cd src; cd" "COMPILE_CLEAN=; $(MAKE) clean SYS_NAME=${SYS_NAME} DESTDIR=`pwd`/${SYS_NAME}/dest/ TOP_SRCDIR=@TOP_SRCDIR@ SRCDIR=`pwd`/${SYS_NAME}/dest/" SYS_NAME=${SYS_NAME} + +clean2: + ${COMPILE_PART1} config ${COMPILE_CLEAN} + ${COMPILE_PART1} pinstall ${COMPILE_CLEAN} + ${COMPILE_PART1} procmgmt ${COMPILE_CLEAN} + ${COMPILE_PART1} util ${COMPILE_CLEAN} + ${COMPILE_PART1} audit ${COMPILE_CLEAN} + ${COMPILE_PART1} comerr ${COMPILE_CLEAN} + ${COMPILE_PART1} cmd ${COMPILE_CLEAN} + ${COMPILE_PART1} lwp ${COMPILE_CLEAN} + ${COMPILE_PART1} rxgen ${COMPILE_CLEAN} + ${COMPILE_PART1} rx ${COMPILE_CLEAN} + ${COMPILE_PART1} rxstat ${COMPILE_CLEAN} + ${COMPILE_PART1} fsint ${COMPILE_CLEAN} + ${COMPILE_PART1} export ${COMPILE_CLEAN} + ${COMPILE_PART1} afs ${COMPILE_CLEAN} + ${COMPILE_PART1} des ${COMPILE_CLEAN} + ${COMPILE_PART1} sys ${COMPILE_CLEAN} + ${COMPILE_PART1} rxkad ${COMPILE_CLEAN} + ${COMPILE_PART1} auth ${COMPILE_CLEAN} + ${COMPILE_PART1} ubik ${COMPILE_CLEAN} + ${COMPILE_PART1} ptserver ${COMPILE_CLEAN} + ${COMPILE_PART1} kauth ${COMPILE_CLEAN} + ${COMPILE_PART1} dauth ${COMPILE_CLEAN} + ${COMPILE_PART1} libacl ${COMPILE_CLEAN} + ${COMPILE_PART1} dir ${COMPILE_CLEAN} + ${COMPILE_PART1} vol ${COMPILE_CLEAN} + ${COMPILE_PART1} vlserver ${COMPILE_CLEAN} + ${COMPILE_PART1} viced ${COMPILE_CLEAN} + ${COMPILE_PART1} viced ${COMPILE_CLEAN} + ${COMPILE_PART1} tviced ${COMPILE_CLEAN} + ${COMPILE_PART1} volser ${COMPILE_CLEAN} + ${COMPILE_PART1} venus ${COMPILE_CLEAN} + ${COMPILE_PART1} venus/test ${COMPILE_CLEAN} + ${COMPILE_PART1} afsd ${COMPILE_CLEAN} + ${COMPILE_PART1} null ${COMPILE_CLEAN} + ${COMPILE_PART1} gtx ${COMPILE_CLEAN} + ${COMPILE_PART1} fsprobe ${COMPILE_CLEAN} + ${COMPILE_PART1} scout ${COMPILE_CLEAN} + ${COMPILE_PART1} uss ${COMPILE_CLEAN} + ${COMPILE_PART1} bozo ${COMPILE_CLEAN} + ${COMPILE_PART1} vfsck ${COMPILE_CLEAN} + ${COMPILE_PART1} sgistuff ${COMPILE_CLEAN} + ${COMPILE_PART1} tsm41 ${COMPILE_CLEAN} + ${COMPILE_PART1} sia ${COMPILE_CLEAN} + ${COMPILE_PART1} login ${COMPILE_CLEAN} + ${COMPILE_PART1} pam ${COMPILE_CLEAN} + ${COMPILE_PART1} afsweb ${COMPILE_CLEAN} + ${COMPILE_PART1} update ${COMPILE_CLEAN} + ${COMPILE_PART1} log ${COMPILE_CLEAN} + ${COMPILE_PART1} bu_utils ${COMPILE_CLEAN} + ${COMPILE_PART1} usd ${COMPILE_CLEAN} + ${COMPILE_PART1} bubasics ${COMPILE_CLEAN} + ${COMPILE_PART1} butm ${COMPILE_CLEAN} + ${COMPILE_PART1} butc ${COMPILE_CLEAN} + ${COMPILE_PART1} tbutc ${COMPILE_CLEAN} + ${COMPILE_PART1} budb ${COMPILE_CLEAN} + ${COMPILE_PART1} bucoord ${COMPILE_CLEAN} + ${COMPILE_PART1} xstat ${COMPILE_CLEAN} + ${COMPILE_PART1} afsmonitor ${COMPILE_CLEAN} + ${COMPILE_PART1} libafsrpc ${COMPILE_CLEAN} + ${COMPILE_PART1} libafsauthent ${COMPILE_CLEAN} + ${COMPILE_PART1} libadmin ${COMPILE_CLEAN} + ${COMPILE_PART1} libadmin/adminutil ${COMPILE_CLEAN} + ${COMPILE_PART1} libadmin/client ${COMPILE_CLEAN} + ${COMPILE_PART1} libadmin/vos ${COMPILE_CLEAN} + ${COMPILE_PART1} libadmin/kas ${COMPILE_CLEAN} + ${COMPILE_PART1} libadmin/pts ${COMPILE_CLEAN} + ${COMPILE_PART1} libadmin/bos ${COMPILE_CLEAN} + ${COMPILE_PART1} libadmin/cfg ${COMPILE_CLEAN} + ${COMPILE_PART1} libadmin/test ${COMPILE_CLEAN} + ${COMPILE_PART1} libadmin/samples ${COMPILE_CLEAN} + ${COMPILE_PART1} finale ${COMPILE_CLEAN} + ${COMPILE_PART1} mpp ${COMPILE_CLEAN} + ${COMPILE_PART1} package ${COMPILE_CLEAN} + ${COMPILE_PART1} ntp ${COMPILE_CLEAN} + ${COMPILE_PART1} ftpd43+ ${COMPILE_CLEAN} + ${COMPILE_PART1} inetd ${COMPILE_CLEAN} + ${COMPILE_PART1} rsh ${COMPILE_CLEAN} + ${COMPILE_PART1} rlogind ${COMPILE_CLEAN} + ${COMPILE_PART1} rcp ${COMPILE_CLEAN} + ${COMPILE_PART1} libafs ${COMPILE_CLEAN} + ${COMPILE_PART1} libuafs ${COMPILE_CLEAN} + +links: + echo "Remove the obj directory" + - /bin/rm -rf @sys/obj/* ; + - /bin/rm -rf @sys/dest/* ; + - /bin/mkdir @sys/obj ; + echo "Create the obj directories" + here=`pwd` ; \ + cd src; \ + for file in `find [!NW]* -type d -print` ; do \ + /bin/mkdir $${here}/obj/$${file} ; \ + done; + echo "Create the obj file links" + here=`pwd` ; \ + cd src; \ + for file in `find [!NW]* -type f -print` ; do \ + /bin/ln -s `pwd`/$${file} $${here}/obj/$${file} ; \ + done; + +# +# Below targets are all deprecated, insecure, or obsolte, +# see README.OBSOLETE and README.INSECURE for more info +# + +mpp: project + @case ${WITH_OBSOLETE} in \ + YES) ${COMPILE_PART1} mpp ${COMPILE_PART2} ;; \ + *) echo skipping deprecated target: mpp ;; \ + esac + +package: project mpp + @case ${WITH_OBSOLETE} in \ + YES) ${COMPILE_PART1} package ${COMPILE_PART2} ;; \ + *) echo skipping deprecated target: package ;; \ + esac + +package.files: package + @case ${WITH_OBSOLETE} in \ + YES) ${DESTDIR}/bin/makepkgfiles afs.dev ;; \ + *) echo skipping deprecated target: package.files ;; \ + esac + +ntp: project volser + @case ${WITH_OBSOLETE} in \ + YES) case ${SYS_NAME} in \ + sun4x_58 | *linux* | *fbsd* | ppc_darwin* ) echo skipping ntp for ${SYS_NAME} ;; \ + * ) ${COMPILE_PART1} ntp ${COMPILE_PART2} ;; \ + esac ;; \ + *) echo skipping deprecated target: ntp ;; \ + esac + +ftpd43+: project kauth rxkad + @case ${WITH_INSECURE} in \ + YES) case ${SYS_NAME} in \ + rs_aix* | sun4x_55 | *linux*) \ + ${COMPILE_PART1} ftpd43+ ${COMPILE_PART2} ;; \ + *) echo skip ftpd43+ for ${SYS_NAME} ;; \ + esac ;; \ + *) echo skipping deprecated target: ftpd43+ ;; \ + esac + +inetd: project kauth rxkad + @case ${WITH_INSECURE} in \ + YES) ${COMPILE_PART1} inetd ${COMPILE_PART2} ;; \ + *) echo skipping deprecated target: inetd ;; \ + esac + +rsh: project inetd + @case ${WITH_INSECURE} in \ + YES) ${COMPILE_PART1} rsh ${COMPILE_PART2} ;; \ + *) echo skipping deprecated target: rsh ;; \ + esac + +rlogind: project rsh ftpd43+ login + @case ${WITH_INSECURE} in \ + YES) case ${SYS_NAME} in \ + rs_aix*) ${COMPILE_PART1} rlogind ${COMPILE_PART2} ;; \ + *) echo skipping rlogind for ${SYS_NAME} ;; \ + esac ;; \ + *) echo skipping deprecated target: rlogind ;; \ + esac + +rcp: project rsh inetd + @case ${WITH_INSECURE} in \ + YES) case ${SYS_NAME} in \ + sgi_* ) echo skip rcp for ${SYS_NAME} ;; \ + *) ${COMPILE_PART1} rcp ${COMPILE_PART2} ;; \ + esac ;; \ + *) echo skipping deprecated target: rcp ;; \ + esac + +allrcmds: project rcp rlogind + + diff --git a/acconfig.h b/acconfig.h new file mode 100644 index 000000000..35d3f34ee --- /dev/null +++ b/acconfig.h @@ -0,0 +1,23 @@ +@BOTTOM@ + +#define RCSID(msg) \ +static /**/const char *const rcsid[] = { (char *)rcsid, "\100(#)" msg } + +#undef HAVE_CONNECT +#undef HAVE_GETHOSTBYNAME +#undef HAVE_RES_SEARCH +#undef HAVE_SOCKET + +#if ENDIANESS_IN_SYS_PARAM_H +# ifndef KERNEL +# include +# include +# if BYTE_ORDER == BIG_ENDIAN +# define WORDS_BIGENDIAN 1 +# endif +# endif +#endif + +#undef AFS_AFSDB_ENV +#undef AFS_NAMEI_ENV +#undef BOS_RESTRICTED_MODE diff --git a/aclocal.m4 b/aclocal.m4 new file mode 100644 index 000000000..0cbe95823 --- /dev/null +++ b/aclocal.m4 @@ -0,0 +1,200 @@ +dnl aclocal.m4 generated automatically by aclocal 1.4 + +dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A +dnl PARTICULAR PURPOSE. + +# Do all the work for Automake. This macro actually does too much -- +# some checks are only needed if your package does certain things. +# But this isn't really a big deal. + +# serial 1 + +dnl Usage: +dnl AM_INIT_AUTOMAKE(package,version, [no-define]) + +AC_DEFUN(AM_INIT_AUTOMAKE, +[AC_REQUIRE([AC_PROG_INSTALL]) +PACKAGE=[$1] +AC_SUBST(PACKAGE) +VERSION=[$2] +AC_SUBST(VERSION) +dnl test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi +ifelse([$3],, +AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) +AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) +AC_REQUIRE([AM_SANITY_CHECK]) +AC_REQUIRE([AC_ARG_PROGRAM]) +dnl FIXME This is truly gross. +missing_dir=`cd $ac_aux_dir && pwd` +AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) +AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) +AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) +AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) +AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) +AC_REQUIRE([AC_PROG_MAKE_SET])]) + +# +# Check to make sure that the build environment is sane. +# + +AC_DEFUN(AM_SANITY_CHECK, +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "[$]*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "[$]*" != "X $srcdir/configure conftestfile" \ + && test "[$]*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "[$]2" = conftestfile + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +rm -f conftest* +AC_MSG_RESULT(yes)]) + +dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) +dnl The program must properly implement --version. +AC_DEFUN(AM_MISSING_PROG, +[AC_MSG_CHECKING(for working $2) +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if ($2 --version) < /dev/null > /dev/null 2>&1; then + $1=$2 + AC_MSG_RESULT(found) +else + $1="$3/missing $2" + AC_MSG_RESULT(missing) +fi +AC_SUBST($1)]) + + +dnl AM_PROG_LEX +dnl Look for flex, lex or missing, then run AC_PROG_LEX and AC_DECL_YYTEXT +AC_DEFUN(AM_PROG_LEX, +[missing_dir=ifelse([$1],,`cd $ac_aux_dir && pwd`,$1) +AC_CHECK_PROGS(LEX, flex lex, "$missing_dir/missing flex") +AC_PROG_LEX +AC_DECL_YYTEXT]) + +dnl +dnl $Id: aclocal.m4,v 1.1 2001/07/05 00:54:56 hartmans Exp $ +dnl + +dnl check if this computer is little or big-endian +dnl if we can figure it out at compile-time then don't define the cpp symbol +dnl otherwise test for it and define it. also allow options for overriding +dnl it when cross-compiling + +AC_DEFUN(OPENAFS_CHECK_BIGENDIAN, [ +AC_ARG_ENABLE(bigendian, +[ --enable-bigendian the target is big endian], +openafs_cv_c_bigendian=yes) +AC_ARG_ENABLE(littleendian, +[ --enable-littleendian the target is little endian], +openafs_cv_c_bigendian=no) +AC_CACHE_CHECK(whether byte order is known at compile time, +openafs_cv_c_bigendian_compile, +[AC_TRY_COMPILE([ +#include +#include ],[ +#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN + bogus endian macros +#endif], openafs_cv_c_bigendian_compile=yes, openafs_cv_c_bigendian_compile=no)]) +AC_CACHE_CHECK(whether byte ordering is bigendian, openafs_cv_c_bigendian,[ + if test "$openafs_cv_c_bigendian_compile" = "yes"; then + AC_TRY_COMPILE([ +#include +#include ],[ +#if BYTE_ORDER != BIG_ENDIAN + not big endian +#endif], openafs_cv_c_bigendian=yes, openafs_cv_c_bigendian=no) + else + AC_TRY_RUN([main () { + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long l; + char c[sizeof (long)]; + } u; + u.l = 1; + exit (u.c[sizeof (long) - 1] == 1); + }], openafs_cv_c_bigendian=no, openafs_cv_c_bigendian=yes, + AC_MSG_ERROR([specify either --enable-bigendian or --enable-littleendian])) + fi +]) +if test "$openafs_cv_c_bigendian" = "yes"; then + AC_DEFINE(WORDS_BIGENDIAN, 1, [define if target is big endian])dnl +fi +if test "$openafs_cv_c_bigendian_compile" = "yes"; then + AC_DEFINE(ENDIANESS_IN_SYS_PARAM_H, 1, [define if sys/param.h defines the endiness])dnl +fi +]) + +AC_DEFUN(LINUX_FS_STRUCT_INODE_HAS_I_BYTES, [ +AC_MSG_CHECKING(for i_bytes in struct inode) +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS" +AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_bytes, +[ +AC_TRY_COMPILE( +[#include ], +[struct inode _inode; +printf("%d\n", _inode.i_bytes);], +ac_cv_linux_fs_struct_inode_has_i_bytes=yes, +ac_cv_linux_fs_struct_inode_has_i_bytes=no)]) +AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_bytes) +CPPFLAGS="$save_CPPFLAGS"]) + + +AC_DEFUN(LINUX_INODE_SETATTR_RETURN_TYPE,[ +AC_MSG_CHECKING(for inode_setattr return type) +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS" +AC_CACHE_VAL(ac_cv_linux_func_inode_setattr_returns_int, +[ +AC_TRY_COMPILE( +[#include ], +[struct inode _inode; +struct iattr _iattr; +int i; +i = inode_setattr(&_inode, &_iattr);], +ac_cv_linux_func_inode_setattr_returns_int=yes, +ac_cv_linux_func_inode_setattr_returns_int=no)]) +AC_MSG_RESULT($ac_cv_linux_func_inode_setattr_returns_int) +CPPFLAGS="$save_CPPFLAGS"]) + diff --git a/config.guess b/config.guess new file mode 100644 index 000000000..265ea69c4 --- /dev/null +++ b/config.guess @@ -0,0 +1,1291 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 +# Free Software Foundation, Inc. + +version='2000-09-05' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Written by Per Bothner . +# Please send patches to . +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# The plan is that this can be called by configure scripts if you +# don't specify an explicit system type (host/target name). +# +# Only a few systems have been added to this list; please add others +# (but try to keep the structure clean). +# + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of this system. + +Operation modes: + -h, --help print this help, then exit + -V, --version print version number, then exit" + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case "$1" in + --version | --vers* | -V ) + echo "$version" ; exit 0 ;; + --help | --h* | -h ) + echo "$usage"; exit 0 ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + exec >&2 + echo "$me: invalid option $1" + echo "$help" + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +# Use $HOST_CC if defined. $CC may point to a cross-compiler +if test x"$CC_FOR_BUILD" = x; then + if test x"$HOST_CC" != x; then + CC_FOR_BUILD="$HOST_CC" + else + if test x"$CC" != x; then + CC_FOR_BUILD="$CC" + else + CC_FOR_BUILD=cc + fi + fi +fi + + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 8/24/94.) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +dummy=dummy-$$ +trap 'rm -f $dummy.c $dummy.o $dummy; exit 1' 1 2 15 + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # Netbsd (nbsd) targets should (where applicable) match one or + # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # Determine the machine/vendor (is the vendor relevant). + case "${UNAME_MACHINE}" in + amiga) machine=m68k-unknown ;; + arm32) machine=arm-unknown ;; + atari*) machine=m68k-atari ;; + sun3*) machine=m68k-sun ;; + mac68k) machine=m68k-apple ;; + macppc) machine=powerpc-apple ;; + hp3[0-9][05]) machine=m68k-hp ;; + ibmrt|romp-ibm) machine=romp-ibm ;; + *) machine=${UNAME_MACHINE}-unknown ;; + esac + # The Operating System including object format. + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep __ELF__ >/dev/null + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + # The OS release + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit 0 ;; + alpha:OSF1:*:*) + if test $UNAME_RELEASE = "V4.0"; then + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + fi + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + cat <$dummy.s + .data +\$Lformat: + .byte 37,100,45,37,120,10,0 # "%d-%x\n" + + .text + .globl main + .align 4 + .ent main +main: + .frame \$30,16,\$26,0 + ldgp \$29,0(\$27) + .prologue 1 + .long 0x47e03d80 # implver \$0 + lda \$2,-1 + .long 0x47e20c21 # amask \$2,\$1 + lda \$16,\$Lformat + mov \$0,\$17 + not \$1,\$18 + jsr \$26,printf + ldgp \$29,0(\$26) + mov 0,\$16 + jsr \$26,exit + .end main +EOF + $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null + if test "$?" = 0 ; then + case `./$dummy` in + 0-0) + UNAME_MACHINE="alpha" + ;; + 1-0) + UNAME_MACHINE="alphaev5" + ;; + 1-1) + UNAME_MACHINE="alphaev56" + ;; + 1-101) + UNAME_MACHINE="alphapca56" + ;; + 2-303) + UNAME_MACHINE="alphaev6" + ;; + 2-307) + UNAME_MACHINE="alphaev67" + ;; + esac + fi + rm -f $dummy.s $dummy + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + exit 0 ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit 0 ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit 0 ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit 0;; + amiga:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit 0 ;; + arc64:OpenBSD:*:*) + echo mips64el-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + arc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + hkmips:OpenBSD:*:*) + echo mips-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + pmax:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sgi:OpenBSD:*:*) + echo mips-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + wgrisc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit 0 ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit 0;; + SR2?01:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit 0;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit 0 ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit 0 ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + i86pc:SunOS:5.*:*) + echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit 0 ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit 0 ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit 0 ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit 0 ;; + atari*:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit 0 ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit 0 ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit 0 ;; + sun3*:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mac68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme88k:OpenBSD:*:*) + echo m88k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit 0 ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit 0 ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit 0 ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit 0 ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit 0 ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD $dummy.c -o $dummy \ + && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ + && rm $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + echo mips-mips-riscos${UNAME_RELEASE} + exit 0 ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit 0 ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit 0 ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit 0 ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit 0 ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit 0 ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit 0 ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit 0 ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit 0 ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit 0 ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit 0 ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i?86:AIX:*:*) + echo i386-ibm-aix + exit 0 ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + echo rs6000-ibm-aix3.2.5 + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit 0 ;; + *:AIX:*:4) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'` + if /usr/sbin/lsattr -EHl ${IBM_CPU_ID} | grep POWER >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=4.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit 0 ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit 0 ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit 0 ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit 0 ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit 0 ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit 0 ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit 0 ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit 0 ;; + 9000/[34678]??:HP-UX:*:*) + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy` + rm -f $dummy.c $dummy + esac + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit 0 ;; + 3050*:HI-UX:*:*) + sed 's/^ //' << EOF >$dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + echo unknown-hitachi-hiuxwe2 + exit 0 ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit 0 ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit 0 ;; + *9??*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit 0 ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit 0 ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit 0 ;; + i?86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit 0 ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit 0 ;; + hppa*:OpenBSD:*:*) + echo hppa-unknown-openbsd + exit 0 ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit 0 ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit 0 ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit 0 ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit 0 ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit 0 ;; + CRAY*X-MP:*:*:*) + echo xmp-cray-unicos + exit 0 ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} + exit 0 ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ + exit 0 ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*T3E:*:*:*) + echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY-2:*:*:*) + echo cray2-cray-unicos + exit 0 ;; + F300:UNIX_System_V:*:*) + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit 0 ;; + F301:UNIX_System_V:*:*) + echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'` + exit 0 ;; + hp300:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + i?86:BSD/386:*:* | i?86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit 0 ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit 0 ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit 0 ;; + *:FreeBSD:*:*) + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit 0 ;; + *:OpenBSD:*:*) + echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + exit 0 ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit 0 ;; + i*:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit 0 ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit 0 ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i386-pc-interix + exit 0 ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit 0 ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit 0 ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + *:GNU:*:*) + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit 0 ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit 0 ;; + *:Linux:*:*) + + # The BFD linker knows what the default object file format is, so + # first see if it will tell us. cd to the root directory to prevent + # problems with other programs or directories called `ld' in the path. + ld_help_string=`cd /; ld --help 2>&1` + ld_supported_emulations=`echo $ld_help_string \ + | sed -ne '/supported emulations:/!d + s/[ ][ ]*/ /g + s/.*supported emulations: *// + s/ .*// + p'` + case "$ld_supported_emulations" in + *ia64) + echo "${UNAME_MACHINE}-unknown-linux" + exit 0 + ;; + i?86linux) + echo "${UNAME_MACHINE}-pc-linux-gnuaout" + exit 0 + ;; + elf_i?86) + TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" + ;; + i?86coff) + echo "${UNAME_MACHINE}-pc-linux-gnucoff" + exit 0 + ;; + sparclinux) + echo "${UNAME_MACHINE}-unknown-linux-gnuaout" + exit 0 + ;; + armlinux) + echo "${UNAME_MACHINE}-unknown-linux-gnuaout" + exit 0 + ;; + elf32arm*) + echo "${UNAME_MACHINE}-unknown-linux-gnuoldld" + exit 0 + ;; + armelf_linux*) + echo "${UNAME_MACHINE}-unknown-linux-gnu" + exit 0 + ;; + m68klinux) + echo "${UNAME_MACHINE}-unknown-linux-gnuaout" + exit 0 + ;; + elf32ppc | elf32ppclinux) + # Determine Lib Version + cat >$dummy.c < +#if defined(__GLIBC__) +extern char __libc_version[]; +extern char __libc_release[]; +#endif +main(argc, argv) + int argc; + char *argv[]; +{ +#if defined(__GLIBC__) + printf("%s %s\n", __libc_version, __libc_release); +#else + printf("unkown\n"); +#endif + return 0; +} +EOF + LIBC="" + $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null + if test "$?" = 0 ; then + ./$dummy | grep 1\.99 > /dev/null + if test "$?" = 0 ; then + LIBC="libc1" + fi + fi + rm -f $dummy.c $dummy + echo powerpc-unknown-linux-gnu${LIBC} + exit 0 + ;; + shelf_linux) + echo "${UNAME_MACHINE}-unknown-linux-gnu" + exit 0 + ;; + esac + + if test "${UNAME_MACHINE}" = "alpha" ; then + cat <$dummy.s + .data + \$Lformat: + .byte 37,100,45,37,120,10,0 # "%d-%x\n" + + .text + .globl main + .align 4 + .ent main + main: + .frame \$30,16,\$26,0 + ldgp \$29,0(\$27) + .prologue 1 + .long 0x47e03d80 # implver \$0 + lda \$2,-1 + .long 0x47e20c21 # amask \$2,\$1 + lda \$16,\$Lformat + mov \$0,\$17 + not \$1,\$18 + jsr \$26,printf + ldgp \$29,0(\$26) + mov 0,\$16 + jsr \$26,exit + .end main +EOF + LIBC="" + $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null + if test "$?" = 0 ; then + case `./$dummy` in + 0-0) + UNAME_MACHINE="alpha" + ;; + 1-0) + UNAME_MACHINE="alphaev5" + ;; + 1-1) + UNAME_MACHINE="alphaev56" + ;; + 1-101) + UNAME_MACHINE="alphapca56" + ;; + 2-303) + UNAME_MACHINE="alphaev6" + ;; + 2-307) + UNAME_MACHINE="alphaev67" + ;; + esac + + objdump --private-headers $dummy | \ + grep ld.so.1 > /dev/null + if test "$?" = 0 ; then + LIBC="libc1" + fi + fi + rm -f $dummy.s $dummy + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0 + elif test "${UNAME_MACHINE}" = "mips" ; then + cat >$dummy.c < /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif +#ifdef __MIPSEB__ + printf ("%s-unknown-linux-gnu\n", argv[1]); +#endif +#ifdef __MIPSEL__ + printf ("%sel-unknown-linux-gnu\n", argv[1]); +#endif + return 0; +} +EOF + $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + elif test "${UNAME_MACHINE}" = "s390"; then + echo s390-ibm-linux && exit 0 + elif test "${UNAME_MACHINE}" = "x86_64"; then + echo x86_64-unknown-linux-gnu && exit 0 + else + # Either a pre-BFD a.out linker (linux-gnuoldld) + # or one that does not give us useful --help. + # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout. + # If ld does not provide *any* "supported emulations:" + # that means it is gnuoldld. + echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:" + test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0 + + case "${UNAME_MACHINE}" in + i?86) + VENDOR=pc; + ;; + *) + VENDOR=unknown; + ;; + esac + # Determine whether the default compiler is a.out or elf + cat >$dummy.c < +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif +#ifdef __ELF__ +# ifdef __GLIBC__ +# if __GLIBC__ >= 2 + printf ("%s-${VENDOR}-linux-gnu\n", argv[1]); +# else + printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); +# endif +# else + printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); +# endif +#else + printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]); +#endif + return 0; +} +EOF + $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 + fi ;; +# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions +# are messed up and put the nodename in both sysname and nodename. + i?86:DYNIX/ptx:4*:*) + echo i386-sequent-sysv4 + exit 0 ;; + i?86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit 0 ;; + i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit 0 ;; + i?86:*:5:7*) + # Fixed at (any) Pentium or better + UNAME_MACHINE=i586 + if [ ${UNAME_SYSTEM} = "UnixWare" ] ; then + echo ${UNAME_MACHINE}-sco-sysv${UNAME_RELEASE}uw${UNAME_VERSION} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE} + fi + exit 0 ;; + i?86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` + (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit 0 ;; + i?86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit 0 ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i386. + echo i386-pc-msdosdjgpp + exit 0 ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit 0 ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit 0 ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit 0 ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit 0 ;; + M68*:*:R3V[567]*:*) + test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; + 3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && echo i486-ncr-sysv4.3${OS_REL} && exit 0 + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && echo i486-ncr-sysv4 && exit 0 ;; + m68*:LynxOS:2.*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit 0 ;; + i?86:LynxOS:2.*:* | i?86:LynxOS:3.[01]*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit 0 ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit 0 ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit 0 ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit 0 ;; + PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit 0 ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit 0 ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit 0 ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit 0 ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit 0 ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit 0 ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit 0 ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit 0 ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit 0 ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit 0 ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit 0 ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit 0 ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit 0 ;; + *:Darwin:*:*) + echo `uname -p`-apple-darwin${UNAME_RELEASE} + exit 0 ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + if test "${UNAME_MACHINE}" = "x86pc"; then + UNAME_MACHINE=pc + fi + echo `uname -p`-${UNAME_MACHINE}-nto-qnx + exit 0 ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit 0 ;; + NSR-[KW]:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit 0 ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit 0 ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit 0 ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit 0 ;; + *:OS/2:*:*) + echo ${UNAME_MACHINE}-pc-os2_emx +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +cat >$dummy.c < +# include +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +#if !defined (ultrix) + printf ("vax-dec-bsd\n"); exit (0); +#else + printf ("vax-dec-ultrix\n"); exit (0); +#endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm $dummy.c $dummy && exit 0 +rm -f $dummy.c $dummy + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit 0 ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit 0 ;; + c34*) + echo c34-convex-bsd + exit 0 ;; + c38*) + echo c38-convex-bsd + exit 0 ;; + c4*) + echo c4-convex-bsd + exit 0 ;; + esac +fi + +cat >&2 < in order to provide the needed +information to handle your system. + +config.guess version = $version + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "version='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/config.sub b/config.sub new file mode 100644 index 000000000..42fc991d0 --- /dev/null +++ b/config.sub @@ -0,0 +1,1328 @@ +#! /bin/sh +# Configuration validation subroutine script, version 1.1. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 +# Free Software Foundation, Inc. + +version='2000-09-11' + +# This file is (in principle) common to ALL GNU software. +# The presence of a machine in this file suggests that SOME GNU software +# can handle that machine. It does not imply ALL GNU software can. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Please send patches to . +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -V, --version print version number, then exit" + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case "$1" in + --version | --vers* | -V ) + echo "$version" ; exit 0 ;; + --help | --h* | -h ) + echo "$usage"; exit 0 ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + exec >&2 + echo "$me: invalid option $1" + echo "$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit 0;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis) + os= + basic_machine=$1 + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \ + | arme[lb] | armv[2345] | armv[345][lb] | pyramid | mn10200 | mn10300 | tron | a29k \ + | 580 | i960 | h8300 \ + | x86 | ppcbe | mipsbe | mipsle | shbe | shle | armbe | armle \ + | hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \ + | hppa64 \ + | alpha | alphaev[4-8] | alphaev56 | alphapca5[67] \ + | alphaev6[78] \ + | we32k | ns16k | clipper | i370 | sh | sh[34] \ + | powerpc | powerpcle \ + | 1750a | dsp16xx | pdp11 | mips16 | mips64 | mipsel | mips64el \ + | mips64orion | mips64orionel | mipstx39 | mipstx39el \ + | mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \ + | mips64vr5000 | miprs64vr5000el | mcore \ + | sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x \ + | thumb | d10v | d30v | fr30 | avr) + basic_machine=$basic_machine-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12) + # Motorola 68HC11/12. + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | h8500 | w65 | pj | pjl) + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i[234567]86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + # FIXME: clean up the formatting here. + vax-* | tahoe-* | i[234567]86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \ + | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \ + | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \ + | power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \ + | xmp-* | ymp-* \ + | x86-* | ppcbe-* | mipsbe-* | mipsle-* | shbe-* | shle-* | armbe-* | armle-* \ + | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* \ + | hppa2.0n-* | hppa64-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphapca5[67]-* \ + | alphaev6[78]-* \ + | we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \ + | clipper-* | orion-* \ + | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \ + | sparc64-* | sparcv9-* | sparc86x-* | mips16-* | mips64-* | mipsel-* \ + | mips64el-* | mips64orion-* | mips64orionel-* \ + | mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \ + | mipstx39-* | mipstx39el-* | mcore-* \ + | f301-* | armv*-* | s390-* | sv1-* | t3e-* \ + | m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \ + | thumb-* | v850-* | d30v-* | tic30-* | c30-* | fr30-* \ + | bs2000-* | tic54x-* | c54x-* | x86_64-*) + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | ymp) + basic_machine=ymp-cray + os=-unicos + ;; + cray2) + basic_machine=cray2-cray + os=-unicos + ;; + [ctj]90-cray) + basic_machine=c90-cray + os=-unicos + ;; + crds | unos) + basic_machine=m68k-crds + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; +# I'm not sure what "Sysv32" means. Should this be sysv3.2? + i[34567]86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i[34567]86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i[34567]86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i[34567]86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + i386-go32 | go32) + basic_machine=i386-unknown + os=-go32 + ;; + i386-mingw32 | mingw32) + basic_machine=i386-unknown + os=-mingw32 + ;; + i[34567]86-pw32 | pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mipsel*-linux*) + basic_machine=mipsel-unknown + os=-linux-gnu + ;; + mips*-linux*) + basic_machine=mips-unknown + os=-linux-gnu + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + mmix*) + basic_machine=mmix-knuth + os=-mmixware + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + msdos) + basic_machine=i386-unknown + os=-msdos + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + np1) + basic_machine=np1-gould + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pentium | p5 | k5 | k6 | nexen) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon) + basic_machine=i686-pc + ;; + pentiumii | pentium2) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexen-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=rs6000-ibm + ;; + ppc) basic_machine=powerpc-unknown + ;; + ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sparclite-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=t3e-cray + os=-unicos + ;; + tic54x | c54x*) + basic_machine=tic54x-unknown + os=-coff + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xmp) + basic_machine=xmp-cray + os=-unicos + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + mips) + if [ x$os = x-linux-gnu ]; then + basic_machine=mips-unknown + else + basic_machine=mips-mips + fi + ;; + romp) + basic_machine=romp-ibm + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh3 | sh4) + base_machine=sh-unknown + ;; + sparc | sparcv9) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + c4x*) + basic_machine=c4x-none + os=-coff + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ + | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i[34567]86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto*) + os=-nto-qnx + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -*MiNT) + os=-mint + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 + ;; + m68*-cisco) + os=-aout + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-ibm) + os=-aix + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f301-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -vxsim* | -vxworks*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -*MiNT) + vendor=atari + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit 0 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "version='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/configure b/configure new file mode 100755 index 000000000..6f2892c37 --- /dev/null +++ b/configure @@ -0,0 +1,3793 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: +ac_help="$ac_help + --with-afs-sysname=sys use sys for the afs sysname +" +ac_help="$ac_help + --enable-obsolete enable obsolete portions of AFS (mpp, ntp and package)" +ac_help="$ac_help + --enable-insecure enable insecure portions of AFS (ftpd, inetd, rcp, rlogind and rsh)" +ac_help="$ac_help + --disable-afsdb disable AFSDB RR support" +ac_help="$ac_help + --enable-bos-restricted-mode enable bosserver restricted mode which disables certain bosserver functionality" +ac_help="$ac_help + --enable-namei-fileserver force compilation of namei fileserver in preference to inode fileserver" +ac_help="$ac_help + --with-linux-kernel-headers=path use the kernel headers found at path(optional, defaults to /usr/src/linux) +" +ac_help="$ac_help + --enable-bigendian the target is big endian" +ac_help="$ac_help + --enable-littleendian the target is little endian" + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=src/config/stds.h + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +ac_exeext= +ac_objext=o +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + +ac_aux_dir= +for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:576: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 +echo "configure:629: checking whether build environment is sane" >&5 +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "$*" != "X $srcdir/configure conftestfile" \ + && test "$*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { echo "configure: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" 1>&2; exit 1; } + fi + + test "$2" = conftestfile + ) +then + # Ok. + : +else + { echo "configure: error: newly created file is older than distributed files! +Check your system clock" 1>&2; exit 1; } +fi +rm -f conftest* +echo "$ac_t""yes" 1>&6 +if test "$program_transform_name" = s,x,x,; then + program_transform_name= +else + # Double any \ or $. echo might interpret backslashes. + cat <<\EOF_SED > conftestsed +s,\\,\\\\,g; s,\$,$$,g +EOF_SED + program_transform_name="`echo $program_transform_name|sed -f conftestsed`" + rm -f conftestsed +fi +test "$program_prefix" != NONE && + program_transform_name="s,^,${program_prefix},; $program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" + +# sed with no file args requires a program. +test "$program_transform_name" = "" && program_transform_name="s,x,x," + +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +echo "configure:686: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + + +PACKAGE=openafs + +VERSION=devel + +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } +fi +cat >> confdefs.h <> confdefs.h <&6 +echo "configure:732: checking for working aclocal" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (aclocal --version) < /dev/null > /dev/null 2>&1; then + ACLOCAL=aclocal + echo "$ac_t""found" 1>&6 +else + ACLOCAL="$missing_dir/missing aclocal" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 +echo "configure:745: checking for working autoconf" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoconf --version) < /dev/null > /dev/null 2>&1; then + AUTOCONF=autoconf + echo "$ac_t""found" 1>&6 +else + AUTOCONF="$missing_dir/missing autoconf" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working automake""... $ac_c" 1>&6 +echo "configure:758: checking for working automake" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (automake --version) < /dev/null > /dev/null 2>&1; then + AUTOMAKE=automake + echo "$ac_t""found" 1>&6 +else + AUTOMAKE="$missing_dir/missing automake" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 +echo "configure:771: checking for working autoheader" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoheader --version) < /dev/null > /dev/null 2>&1; then + AUTOHEADER=autoheader + echo "$ac_t""found" 1>&6 +else + AUTOHEADER="$missing_dir/missing autoheader" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 +echo "configure:784: checking for working makeinfo" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (makeinfo --version) < /dev/null > /dev/null 2>&1; then + MAKEINFO=makeinfo + echo "$ac_t""found" 1>&6 +else + MAKEINFO="$missing_dir/missing makeinfo" + echo "$ac_t""missing" 1>&6 +fi + + + +# Make sure we can run config.sub. +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : +else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } +fi + +echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:804: checking host system type" >&5 + +host_alias=$host +case "$host_alias" in +NONE) + case $nonopt in + NONE) + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; +esac + +host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$host" 1>&6 + + + +#BOZO_SAVE_CORES BOS_RESTRICTED_MODE BOS_NEW_CONFIG pam sia BITMAP_LATER FAST_RESTART +# Check whether --with-afs-sysname or --without-afs-sysname was given. +if test "${with_afs_sysname+set}" = set; then + withval="$with_afs_sysname" + : +fi + +# Check whether --enable-obsolete or --disable-obsolete was given. +if test "${enable_obsolete+set}" = set; then + enableval="$enable_obsolete" + : +else + enable_obsolete="no" +fi + +# Check whether --enable-insecure or --disable-insecure was given. +if test "${enable_insecure+set}" = set; then + enableval="$enable_insecure" + : +else + enable_insecure="no" +fi + +# Check whether --enable-afsdb or --disable-afsdb was given. +if test "${enable_afsdb+set}" = set; then + enableval="$enable_afsdb" + : +else + enable_afsdb="yes" +fi + +# Check whether --enable-bos-restricted-mode or --disable-bos-restricted-mode was given. +if test "${enable_bos_restricted_mode+set}" = set; then + enableval="$enable_bos_restricted_mode" + : +else + enable_bos_restricted_mode="no" +fi + +# Check whether --enable-namei-fileserver or --disable-namei-fileserver was given. +if test "${enable_namei_fileserver+set}" = set; then + enableval="$enable_namei_fileserver" + : +else + enable_namei_fileserver="no" +fi + +# Check whether --with-linux-kernel-headers or --without-linux-kernel-headers was given. +if test "${with_linux_kernel_headers+set}" = set; then + withval="$with_linux_kernel_headers" + : +fi + + +# Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:883: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:913: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_prog_rejected=no + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + break + fi + done + IFS="$ac_save_ifs" +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# -gt 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" "$@" + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + if test -z "$CC"; then + case "`uname -s`" in + *win32* | *WIN32*) + # Extract the first word of "cl", so it can be a program name with args. +set dummy cl; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:964: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="cl" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + ;; + esac + fi + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +fi + +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 +echo "configure:996: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +cat > conftest.$ac_ext << EOF + +#line 1007 "configure" +#include "confdefs.h" + +main(){return(0);} +EOF +if { (eval echo configure:1012: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + ac_cv_prog_cc_works=yes + # If we can't run a trivial program, we are probably using a cross compiler. + if (./conftest; exit) 2>/dev/null; then + ac_cv_prog_cc_cross=no + else + ac_cv_prog_cc_cross=yes + fi +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_prog_cc_works=no +fi +rm -fr conftest* +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 +if test $ac_cv_prog_cc_works = no; then + { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } +fi +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 +echo "configure:1038: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 +cross_compiling=$ac_cv_prog_cc_cross + +echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +echo "configure:1043: checking whether we are using GNU C" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + +if test $ac_cv_prog_gcc = yes; then + GCC=yes +else + GCC= +fi + +ac_test_CFLAGS="${CFLAGS+set}" +ac_save_CFLAGS="$CFLAGS" +CFLAGS= +echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:1071: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes +else + ac_cv_prog_cc_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 +if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi + + +echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 +echo "configure:1104: checking how to run the C preprocessor" >&5 +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then +if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + # This must be in double quotes, not single quotes, because CPP may get + # substituted into the Makefile and "${CC-cc}" will confuse make. + CPP="${CC-cc} -E" + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. + cat > conftest.$ac_ext < +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1125: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP="${CC-cc} -E -traditional-cpp" + cat > conftest.$ac_ext < +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1142: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP="${CC-cc} -nologo -E" + cat > conftest.$ac_ext < +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1159: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP=/lib/cpp +fi +rm -f conftest* +fi +rm -f conftest* +fi +rm -f conftest* + ac_cv_prog_CPP="$CPP" +fi + CPP="$ac_cv_prog_CPP" +else + ac_cv_prog_CPP="$CPP" +fi +echo "$ac_t""$CPP" 1>&6 + +echo $ac_n "checking for AIX""... $ac_c" 1>&6 +echo "configure:1184: checking for AIX" >&5 +cat > conftest.$ac_ext <&5 | + egrep "yes" >/dev/null 2>&1; then + rm -rf conftest* + echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF +#define _ALL_SOURCE 1 +EOF + +else + rm -rf conftest* + echo "$ac_t""no" 1>&6 +fi +rm -f conftest* + + +echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 +echo "configure:1208: checking for POSIXized ISC" >&5 +if test -d /etc/conf/kconfig.d && + grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 +then + echo "$ac_t""yes" 1>&6 + ISC=yes # If later tests want to check for ISC. + cat >> confdefs.h <<\EOF +#define _POSIX_SOURCE 1 +EOF + + if test "$GCC" = yes; then + CC="$CC -posix" + else + CC="$CC -Xp" + fi +else + echo "$ac_t""no" 1>&6 + ISC= +fi + +ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6 +echo "configure:1230: checking for minix/config.h" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1240: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + MINIX=yes +else + echo "$ac_t""no" 1>&6 +MINIX= +fi + +if test "$MINIX" = yes; then + cat >> confdefs.h <<\EOF +#define _POSIX_SOURCE 1 +EOF + + cat >> confdefs.h <<\EOF +#define _POSIX_1_SOURCE 2 +EOF + + cat >> confdefs.h <<\EOF +#define _MINIX 1 +EOF + +fi + + +echo $ac_n "checking for inline""... $ac_c" 1>&6 +echo "configure:1279: checking for inline" >&5 +if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_c_inline=$ac_kw; break +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -f conftest* +done + +fi + +echo "$ac_t""$ac_cv_c_inline" 1>&6 +case "$ac_cv_c_inline" in + inline | yes) ;; + no) cat >> confdefs.h <<\EOF +#define inline +EOF + ;; + *) cat >> confdefs.h <&6 +echo "configure:1319: checking for working const" >&5 +if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <j = 5; +} +{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; +} + +; return 0; } +EOF +if { (eval echo configure:1373: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_c_const=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_c_const=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_c_const" 1>&6 +if test $ac_cv_c_const = no; then + cat >> confdefs.h <<\EOF +#define const +EOF + +fi + +echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 +echo "configure:1394: checking for ANSI C header files" >&5 +if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include +#include +#include +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1407: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + ac_cv_header_stdc=yes +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_header_stdc=no +fi +rm -f conftest* + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. +cat > conftest.$ac_ext < +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "memchr" >/dev/null 2>&1; then + : +else + rm -rf conftest* + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. +cat > conftest.$ac_ext < +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "free" >/dev/null 2>&1; then + : +else + rm -rf conftest* + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. +if test "$cross_compiling" = yes; then + : +else + cat > conftest.$ac_ext < +#define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int main () { int i; for (i = 0; i < 256; i++) +if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); +exit (0); } + +EOF +if { (eval echo configure:1474: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + : +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_header_stdc=no +fi +rm -fr conftest* +fi + +fi +fi + +echo "$ac_t""$ac_cv_header_stdc" 1>&6 +if test $ac_cv_header_stdc = yes; then + cat >> confdefs.h <<\EOF +#define STDC_HEADERS 1 +EOF + +fi + +echo $ac_n "checking for pid_t""... $ac_c" 1>&6 +echo "configure:1498: checking for pid_t" >&5 +if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#if STDC_HEADERS +#include +#include +#endif +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_type_pid_t=yes +else + rm -rf conftest* + ac_cv_type_pid_t=no +fi +rm -f conftest* + +fi +echo "$ac_t""$ac_cv_type_pid_t" 1>&6 +if test $ac_cv_type_pid_t = no; then + cat >> confdefs.h <<\EOF +#define pid_t int +EOF + +fi + +echo $ac_n "checking for size_t""... $ac_c" 1>&6 +echo "configure:1531: checking for size_t" >&5 +if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#if STDC_HEADERS +#include +#include +#endif +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_type_size_t=yes +else + rm -rf conftest* + ac_cv_type_size_t=no +fi +rm -f conftest* + +fi +echo "$ac_t""$ac_cv_type_size_t" 1>&6 +if test $ac_cv_type_size_t = no; then + cat >> confdefs.h <<\EOF +#define size_t unsigned +EOF + +fi + +echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 +echo "configure:1564: checking return type of signal handlers" >&5 +if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include +#ifdef signal +#undef signal +#endif +#ifdef __cplusplus +extern "C" void (*signal (int, void (*)(int)))(int); +#else +void (*signal ()) (); +#endif + +int main() { +int i; +; return 0; } +EOF +if { (eval echo configure:1586: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_type_signal=void +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_type_signal=int +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_type_signal" 1>&6 +cat >> confdefs.h <&6 +echo "configure:1617: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 +echo "configure:1670: checking whether ln -s works" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + rm -f conftestdata +if ln -s X conftestdata 2>/dev/null +then + rm -f conftestdata + ac_cv_prog_LN_S="ln -s" +else + ac_cv_prog_LN_S=ln +fi +fi +LN_S="$ac_cv_prog_LN_S" +if test "$ac_cv_prog_LN_S" = "ln -s"; then + echo "$ac_t""yes" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +# Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1693: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +for ac_prog in 'bison -y' byacc +do +# Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1725: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$YACC"; then + ac_cv_prog_YACC="$YACC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_YACC="$ac_prog" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +YACC="$ac_cv_prog_YACC" +if test -n "$YACC"; then + echo "$ac_t""$YACC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +test -n "$YACC" && break +done +test -n "$YACC" || YACC="yacc" + +missing_dir=`cd $ac_aux_dir && pwd` +for ac_prog in flex lex +do +# Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1761: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$LEX"; then + ac_cv_prog_LEX="$LEX" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_LEX="$ac_prog" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +LEX="$ac_cv_prog_LEX" +if test -n "$LEX"; then + echo "$ac_t""$LEX" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +test -n "$LEX" && break +done +test -n "$LEX" || LEX=""$missing_dir/missing flex"" + +# Extract the first word of "flex", so it can be a program name with args. +set dummy flex; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1794: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$LEX"; then + ac_cv_prog_LEX="$LEX" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_LEX="flex" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_LEX" && ac_cv_prog_LEX="lex" +fi +fi +LEX="$ac_cv_prog_LEX" +if test -n "$LEX"; then + echo "$ac_t""$LEX" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test -z "$LEXLIB" +then + case "$LEX" in + flex*) ac_lib=fl ;; + *) ac_lib=l ;; + esac + echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6 +echo "configure:1828: checking for yywrap in -l$ac_lib" >&5 +ac_lib_var=`echo $ac_lib'_'yywrap | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-l$ac_lib $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + LEXLIB="-l$ac_lib" +else + echo "$ac_t""no" 1>&6 +fi + +fi + +echo $ac_n "checking lex output file root""... $ac_c" 1>&6 +echo "configure:1870: checking lex output file root" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_lex_root'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + # The minimal lex program is just a single line: %%. But some broken lexes +# (Solaris, I think it was) want two %% lines, so accommodate them. +echo '%% +%%' | $LEX +if test -f lex.yy.c; then + ac_cv_prog_lex_root=lex.yy +elif test -f lexyy.c; then + ac_cv_prog_lex_root=lexyy +else + { echo "configure: error: cannot find output from $LEX; giving up" 1>&2; exit 1; } +fi +fi + +echo "$ac_t""$ac_cv_prog_lex_root" 1>&6 +LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root + +echo $ac_n "checking whether yytext is a pointer""... $ac_c" 1>&6 +echo "configure:1891: checking whether yytext is a pointer" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_lex_yytext_pointer'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + # POSIX says lex can declare yytext either as a pointer or an array; the +# default is implementation-dependent. Figure out which it is, since +# not all implementations provide the %pointer and %array declarations. +ac_cv_prog_lex_yytext_pointer=no +echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c +ac_save_LIBS="$LIBS" +LIBS="$LIBS $LEXLIB" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ac_cv_prog_lex_yytext_pointer=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -f conftest* +LIBS="$ac_save_LIBS" +rm -f "${LEX_OUTPUT_ROOT}.c" + +fi + +echo "$ac_t""$ac_cv_prog_lex_yytext_pointer" 1>&6 +if test $ac_cv_prog_lex_yytext_pointer = yes; then + cat >> confdefs.h <<\EOF +#define YYTEXT_POINTER 1 +EOF + +fi + + + +# Check whether --enable-bigendian or --disable-bigendian was given. +if test "${enable_bigendian+set}" = set; then + enableval="$enable_bigendian" + openafs_cv_c_bigendian=yes +fi + +# Check whether --enable-littleendian or --disable-littleendian was given. +if test "${enable_littleendian+set}" = set; then + enableval="$enable_littleendian" + openafs_cv_c_bigendian=no +fi + +echo $ac_n "checking whether byte order is known at compile time""... $ac_c" 1>&6 +echo "configure:1946: checking whether byte order is known at compile time" >&5 +if eval "test \"`echo '$''{'openafs_cv_c_bigendian_compile'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include +int main() { + +#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN + bogus endian macros +#endif +; return 0; } +EOF +if { (eval echo configure:1963: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + openafs_cv_c_bigendian_compile=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + openafs_cv_c_bigendian_compile=no +fi +rm -f conftest* +fi + +echo "$ac_t""$openafs_cv_c_bigendian_compile" 1>&6 +echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 +echo "configure:1977: checking whether byte ordering is bigendian" >&5 +if eval "test \"`echo '$''{'openafs_cv_c_bigendian'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + if test "$openafs_cv_c_bigendian_compile" = "yes"; then + cat > conftest.$ac_ext < +#include +int main() { + +#if BYTE_ORDER != BIG_ENDIAN + not big endian +#endif +; return 0; } +EOF +if { (eval echo configure:1996: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + openafs_cv_c_bigendian=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + openafs_cv_c_bigendian=no +fi +rm -f conftest* + else + if test "$cross_compiling" = yes; then + { echo "configure: error: specify either --enable-bigendian or --enable-littleendian" 1>&2; exit 1; } +else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + openafs_cv_c_bigendian=no +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + openafs_cv_c_bigendian=yes +fi +rm -fr conftest* +fi + + fi + +fi + +echo "$ac_t""$openafs_cv_c_bigendian" 1>&6 +if test "$openafs_cv_c_bigendian" = "yes"; then + cat >> confdefs.h <<\EOF +#define WORDS_BIGENDIAN 1 +EOF +fi +if test "$openafs_cv_c_bigendian_compile" = "yes"; then + cat >> confdefs.h <<\EOF +#define ENDIANESS_IN_SYS_PARAM_H 1 +EOF +fi + + +echo $ac_n "checking your OS""... $ac_c" 1>&6 +echo "configure:2054: checking your OS" >&5 +system=$host +case $system in + *-linux*) + MKAFS_OSTYPE=LINUX + if test "x$with_linux_kernel_headers" != "x"; then + LINUX_KERNEL_PATH="$with_linux_kernel_headers" + else + LINUX_KERNEL_PATH="/usr/src/linux" + fi + if test -f "$with_linux_kernel_headers/include/linux/version.h"; then + linux_kvers=`fgrep UTS_RELEASE $with_linux_kernel_headers/include/linux/version.h |awk 'BEGIN { FS="\"" } { print $2 }'` + if test "x$linux_kvers" = "x"; then + { echo "configure: error: Linux headers lack version definition" 1>&2; exit 1; } + exit 1 + else + LINUX_VERSION="$linux_kvers" + fi + else + { echo "configure: error: No linux headers found at $with_linux_kernel_headers" 1>&2; exit 1; } + exit 1 + fi + echo "$ac_t""linux" 1>&6 + +echo $ac_n "checking for i_bytes in struct inode""... $ac_c" 1>&6 +echo "configure:2079: checking for i_bytes in struct inode" >&5 +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS" +if eval "test \"`echo '$''{'ac_cv_linux_fs_struct_inode_has_i_bytes'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +int main() { +struct inode _inode; +printf("%d\n", _inode.i_bytes); +; return 0; } +EOF +if { (eval echo configure:2095: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_linux_fs_struct_inode_has_i_bytes=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_linux_fs_struct_inode_has_i_bytes=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_linux_fs_struct_inode_has_i_bytes" 1>&6 +CPPFLAGS="$save_CPPFLAGS" + +echo $ac_n "checking for inode_setattr return type""... $ac_c" 1>&6 +echo "configure:2111: checking for inode_setattr return type" >&5 +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS" +if eval "test \"`echo '$''{'ac_cv_linux_func_inode_setattr_returns_int'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +int main() { +struct inode _inode; +struct iattr _iattr; +int i; +i = inode_setattr(&_inode, &_iattr); +; return 0; } +EOF +if { (eval echo configure:2129: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_linux_func_inode_setattr_returns_int=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_linux_func_inode_setattr_returns_int=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_linux_func_inode_setattr_returns_int" 1>&6 +CPPFLAGS="$save_CPPFLAGS" + ;; + *-solaris*) + MKAFS_OSTYPE=SOLARIS + echo "$ac_t""sun4" 1>&6 + ;; + *-hpux*) + MKAFS_OSTYPE=HPUX + echo "$ac_t""hp_ux" 1>&6 + ;; + *-irix*) + MKAFS_OSTYPE=IRIX + echo "$ac_t""sgi" 1>&6 + ;; + *-aix*) + MKAFS_OSTYPE=AIX + echo "$ac_t""rs_aix" 1>&6 + ;; + *-osf*) + MKAFS_OSTYPE=DUX + echo "$ac_t""alpha_dux" 1>&6 + ;; + *-darwin*) + MKAFS_OSTYPE=DARWIN + echo "$ac_t""ppc_darwin" 1>&6 + ;; + *) + echo "$ac_t""$system" 1>&6 + ;; +esac + +if test "x${MKAFS_OSTYPE}" = "xIRIX"; then + echo Skipping library tests because they confuse Irix. +else + for ac_func in socket +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:2179: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:2207: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + + + if test "$ac_cv_func_socket" = no; then + for lib in socket inet; do + if test "$HAVE_SOCKET" != 1; then + echo $ac_n "checking for socket in -l$lib""... $ac_c" 1>&6 +echo "configure:2236: checking for socket in -l$lib" >&5 +ac_lib_var=`echo $lib'_'socket | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-l$lib $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + LIBS="$LIBS -l$lib";HAVE_SOCKET=1;cat >> confdefs.h <<\EOF +#define HAVE_SOCKET 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi + + fi + done + fi + + for ac_func in connect +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:2285: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:2313: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + + + if test "$ac_cv_func_connect" = no; then + for lib in nsl; do + if test "$HAVE_CONNECT" != 1; then + echo $ac_n "checking for connect in -l$lib""... $ac_c" 1>&6 +echo "configure:2342: checking for connect in -l$lib" >&5 +ac_lib_var=`echo $lib'_'connect | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-l$lib $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + LIBS="$LIBS -l$lib";HAVE_CONNECT=1;cat >> confdefs.h <<\EOF +#define HAVE_CONNECT 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi + + fi + done + fi + + for ac_func in gethostbyname +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:2391: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:2419: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + + if test "$ac_cv_func_gethostbyname" = no; then + for lib in dns nsl resolv; do + if test "$HAVE_GETHOSTBYNAME" != 1; then + echo $ac_n "checking for gethostbyname in -l$lib""... $ac_c" 1>&6 +echo "configure:2447: checking for gethostbyname in -l$lib" >&5 +ac_lib_var=`echo $lib'_'gethostbyname | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-l$lib $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + LIBS="$LIBS -l$lib";HAVE_GETHOSTBYNAME=1;cat >> confdefs.h <<\EOF +#define HAVE_GETHOSTBYNAME 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi + + fi + done + fi + + for ac_func in res_search +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:2496: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:2524: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + + if test "$ac_cv_func_res_search" = no; then + for lib in dns nsl resolv; do + if test "$HAVE_RES_SEARCH" != 1; then + echo $ac_n "checking for res_search in -l$lib""... $ac_c" 1>&6 +echo "configure:2552: checking for res_search in -l$lib" >&5 +ac_lib_var=`echo $lib'_'res_search | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-l$lib $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + LIBS="$LIBS -l$lib";HAVE_RES_SEARCH=1;cat >> confdefs.h <<\EOF +#define HAVE_RES_SEARCH 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi + + fi + done + if test "$HAVE_RES_SEARCH" = 1; then + LIB_res_search="-l$lib" + fi + fi +fi + +PTHREAD_LIBS=error +echo $ac_n "checking for pthread_attr_init in -lpthread""... $ac_c" 1>&6 +echo "configure:2604: checking for pthread_attr_init in -lpthread" >&5 +ac_lib_var=`echo pthread'_'pthread_attr_init | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lpthread $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + PTHREAD_LIBS="-lpthread" +else + echo "$ac_t""no" 1>&6 +fi + +if test "x$PTHREAD_LIBS" = xerror; then + echo $ac_n "checking for pthread_attr_init in -lpthreads""... $ac_c" 1>&6 +echo "configure:2645: checking for pthread_attr_init in -lpthreads" >&5 +ac_lib_var=`echo pthreads'_'pthread_attr_init | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lpthreads $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + PTHREAD_LIBS="-lpthreads" +else + echo "$ac_t""no" 1>&6 +fi + +fi +if test "x$PTHREAD_LIBS" = xerror; then + echo $ac_n "checking for pthread_attr_init in -lc_r""... $ac_c" 1>&6 +echo "configure:2687: checking for pthread_attr_init in -lc_r" >&5 +ac_lib_var=`echo c_r'_'pthread_attr_init | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lc_r $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + PTHREAD_LIBS="-lc_r" +else + echo "$ac_t""no" 1>&6 +fi + +fi +if test "x$PTHREAD_LIBS" = xerror; then + echo $ac_n "checking for pthread_attr_init""... $ac_c" 1>&6 +echo "configure:2729: checking for pthread_attr_init" >&5 +if eval "test \"`echo '$''{'ac_cv_func_pthread_attr_init'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char pthread_attr_init(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_pthread_attr_init) || defined (__stub___pthread_attr_init) +choke me +#else +pthread_attr_init(); +#endif + +; return 0; } +EOF +if { (eval echo configure:2757: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_pthread_attr_init=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_pthread_attr_init=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'pthread_attr_init`\" = yes"; then + echo "$ac_t""yes" 1>&6 + PTHREAD_LIBS="" +else + echo "$ac_t""no" 1>&6 +fi + +fi +if test "x$PTHREAD_LIBS" = xerror; then + { echo "configure: error: *** Unable to locate working posix thread library ***" 1>&2; exit 1; } +fi + + +WITH_OBSOLETE=NO +if test "$enable_obsolete" = "yes"; then + WITH_OBSOLETE=YES +fi + +WITH_INSECURE=NO +if test "$enable_insecure" = "yes"; then + WITH_INSECURE=YES +fi + +# Should autocompute a default +if test "x$with_afs_sysname" != "x"; then + AFS_SYSNAME="$with_afs_sysname" +else + { echo "configure: error: An AFS sysname is required" 1>&2; exit 1; } + exit 1 +fi + +if test "$enable_bos_restricted_mode" = "yes"; then + cat >> confdefs.h <<\EOF +#define BOS_RESTRICTED_MODE 1 +EOF + +fi + +if test "$enable_namei_fileserver" = "yes"; then + cat >> confdefs.h <<\EOF +#define AFS_NAMEI_ENV 1 +EOF + +fi + +if test "$enable_afsdb" = "yes"; then + LIB_AFSDB="$LIB_res_search" + cat >> confdefs.h <<\EOF +#define AFS_AFSDB_ENV 1 +EOF + +fi + +SRCDIR_PARENT=`pwd` +TOP_SRCDIR="${SRCDIR_PARENT}/src" + +echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 +echo "configure:2826: checking for ANSI C header files" >&5 +if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include +#include +#include +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:2839: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + ac_cv_header_stdc=yes +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_header_stdc=no +fi +rm -f conftest* + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. +cat > conftest.$ac_ext < +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "memchr" >/dev/null 2>&1; then + : +else + rm -rf conftest* + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. +cat > conftest.$ac_ext < +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "free" >/dev/null 2>&1; then + : +else + rm -rf conftest* + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. +if test "$cross_compiling" = yes; then + : +else + cat > conftest.$ac_ext < +#define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int main () { int i; for (i = 0; i < 256; i++) +if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); +exit (0); } + +EOF +if { (eval echo configure:2906: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + : +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_header_stdc=no +fi +rm -fr conftest* +fi + +fi +fi + +echo "$ac_t""$ac_cv_header_stdc" 1>&6 +if test $ac_cv_header_stdc = yes; then + cat >> confdefs.h <<\EOF +#define STDC_HEADERS 1 +EOF + +fi + +echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 +echo "configure:2930: checking for sys/wait.h that is POSIX.1 compatible" >&5 +if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include +#ifndef WEXITSTATUS +#define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) +#endif +#ifndef WIFEXITED +#define WIFEXITED(stat_val) (((stat_val) & 255) == 0) +#endif +int main() { +int s; +wait (&s); +s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; +; return 0; } +EOF +if { (eval echo configure:2951: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_header_sys_wait_h=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_header_sys_wait_h=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6 +if test $ac_cv_header_sys_wait_h = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_SYS_WAIT_H 1 +EOF + +fi + +ac_header_dirent=no +for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 +echo "configure:2976: checking for $ac_hdr that defines DIR" >&5 +if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include <$ac_hdr> +int main() { +DIR *dirp = 0; +; return 0; } +EOF +if { (eval echo configure:2989: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + eval "ac_cv_header_dirent_$ac_safe=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_dirent_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done +# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. +if test $ac_header_dirent = dirent.h; then +echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 +echo "configure:3014: checking for opendir in -ldir" >&5 +ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-ldir $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + LIBS="$LIBS -ldir" +else + echo "$ac_t""no" 1>&6 +fi + +else +echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 +echo "configure:3055: checking for opendir in -lx" >&5 +ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lx $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + LIBS="$LIBS -lx" +else + echo "$ac_t""no" 1>&6 +fi + +fi + +for ac_hdr in stdlib.h string.h unistd.h fcntl.h sys/time.h sys/file.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:3100: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:3110: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + +for ac_hdr in netinet/in.h netdb.h sys/fcntl.h sys/mnttab.h sys/mntent.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:3140: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:3150: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + +for ac_hdr in mntent.h sys/vfs.h sys/param.h sys/fs_types.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:3180: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:3190: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + +for ac_hdr in sys/mount.h strings.h termios.h signal.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:3220: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:3230: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + +for ac_hdr in windows.h malloc.h winsock2.h direct.h io.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:3260: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:3270: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + +for ac_hdr in security/pam_modules.h siad.h usersec.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:3300: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:3310: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + + +for ac_func in utimes random srandom getdtablesize snprintf re_comp re_exec +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:3340: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:3368: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + + + + + + + + + + + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +DEFS=-DHAVE_CONFIG_H + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS </dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +trap 'rm -fr `echo "\ +Makefile \ +src/config/Makefile.${AFS_SYSNAME} \ +src/libafs/MakefileProto.${MKAFS_OSTYPE} \ + src/config/afsconfig.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g +s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@PACKAGE@%$PACKAGE%g +s%@VERSION@%$VERSION%g +s%@ACLOCAL@%$ACLOCAL%g +s%@AUTOCONF@%$AUTOCONF%g +s%@AUTOMAKE@%$AUTOMAKE%g +s%@AUTOHEADER@%$AUTOHEADER%g +s%@MAKEINFO@%$MAKEINFO%g +s%@SET_MAKE@%$SET_MAKE%g +s%@host@%$host%g +s%@host_alias@%$host_alias%g +s%@host_cpu@%$host_cpu%g +s%@host_vendor@%$host_vendor%g +s%@host_os@%$host_os%g +s%@CC@%$CC%g +s%@CPP@%$CPP%g +s%@LN_S@%$LN_S%g +s%@RANLIB@%$RANLIB%g +s%@YACC@%$YACC%g +s%@LEX@%$LEX%g +s%@LEXLIB@%$LEXLIB%g +s%@LEX_OUTPUT_ROOT@%$LEX_OUTPUT_ROOT%g +s%@PTHREAD_LIBS@%$PTHREAD_LIBS%g +s%@AFS_SYSNAME@%$AFS_SYSNAME%g +s%@LIB_AFSDB@%$LIB_AFSDB%g +s%@LINUX_KERNEL_PATH@%$LINUX_KERNEL_PATH%g +s%@LINUX_VERSION@%$LINUX_VERSION%g +s%@MKAFS_OSTYPE@%$MKAFS_OSTYPE%g +s%@TOP_SRCDIR@%$TOP_SRCDIR%g +s%@WITH_OBSOLETE@%$WITH_OBSOLETE%g +s%@WITH_INSECURE@%$WITH_INSECURE%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where +# NAME is the cpp macro being defined and VALUE is the value it is being given. +# +# ac_d sets the value in "#define NAME VALUE" lines. +ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)' +ac_dB='\([ ][ ]*\)[^ ]*%\1#\2' +ac_dC='\3' +ac_dD='%g' +# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". +ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_uB='\([ ]\)%\1#\2define\3' +ac_uC=' ' +ac_uD='\4%g' +# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". +ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_eB='$%\1#\2define\3' +ac_eC=' ' +ac_eD='%g' + +if test "${CONFIG_HEADERS+set}" != set; then +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +fi +for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + echo creating $ac_file + + rm -f conftest.frag conftest.in conftest.out + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + cat $ac_file_inputs > conftest.in + +EOF + +# Transform confdefs.h into a sed script conftest.vals that substitutes +# the proper values into config.h.in to produce config.h. And first: +# Protect against being on the right side of a sed subst in config.status. +# Protect against being in an unquoted here document in config.status. +rm -f conftest.vals +cat > conftest.hdr <<\EOF +s/[\\&%]/\\&/g +s%[\\$`]%\\&%g +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp +s%ac_d%ac_u%gp +s%ac_u%ac_e%gp +EOF +sed -n -f conftest.hdr confdefs.h > conftest.vals +rm -f conftest.hdr + +# This sed command replaces #undef with comments. This is necessary, for +# example, in the case of _POSIX_SOURCE, which is predefined and required +# on some systems where configure will not decide to define it. +cat >> conftest.vals <<\EOF +s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% +EOF + +# Break up conftest.vals because some shells have a limit on +# the size of here documents, and old seds have small limits too. + +rm -f conftest.tail +while : +do + ac_lines=`grep -c . conftest.vals` + # grep -c gives empty output for an empty file on some AIX systems. + if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi + # Write a limited-size here document to conftest.frag. + echo ' cat > conftest.frag <> $CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS + echo 'CEOF + sed -f conftest.frag conftest.in > conftest.out + rm -f conftest.in + mv conftest.out conftest.in +' >> $CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail + rm -f conftest.vals + mv conftest.tail conftest.vals +done +rm -f conftest.vals + +cat >> $CONFIG_STATUS <<\EOF + rm -f conftest.frag conftest.h + echo "/* $ac_file. Generated automatically by configure. */" > conftest.h + cat conftest.in >> conftest.h + rm -f conftest.in + if cmp -s $ac_file conftest.h 2>/dev/null; then + echo "$ac_file is unchanged" + rm -f conftest.h + else + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + fi + rm -f $ac_file + mv conftest.h $ac_file + fi +fi; done + +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + diff --git a/configure.in b/configure.in new file mode 100644 index 000000000..83d433480 --- /dev/null +++ b/configure.in @@ -0,0 +1,230 @@ +AC_INIT(src/config/stds.h) +AM_INIT_AUTOMAKE(openafs,devel) +AC_CANONICAL_HOST +AC_CONFIG_HEADER(src/config/afsconfig.h) + +#BOZO_SAVE_CORES BOS_RESTRICTED_MODE BOS_NEW_CONFIG pam sia BITMAP_LATER FAST_RESTART +AC_ARG_WITH(afs-sysname, +[ --with-afs-sysname=sys use sys for the afs sysname] +) +AC_ARG_ENABLE( obsolete, +[ --enable-obsolete enable obsolete portions of AFS (mpp, ntp and package)],, enable_obsolete="no") +AC_ARG_ENABLE( insecure, +[ --enable-insecure enable insecure portions of AFS (ftpd, inetd, rcp, rlogind and rsh)],, enable_insecure="no") +AC_ARG_ENABLE( afsdb, +[ --disable-afsdb disable AFSDB RR support],, enable_afsdb="yes") +AC_ARG_ENABLE( bos-restricted-mode, +[ --enable-bos-restricted-mode enable bosserver restricted mode which disables certain bosserver functionality],, enable_bos_restricted_mode="no") +AC_ARG_ENABLE( namei-fileserver, +[ --enable-namei-fileserver force compilation of namei fileserver in preference to inode fileserver],, enable_namei_fileserver="no") +AC_ARG_WITH(linux-kernel-headers, +[ --with-linux-kernel-headers=path use the kernel headers found at path(optional, defaults to /usr/src/linux)] +) + +AC_PROG_CC + +dnl weird ass systems +AC_AIX +AC_ISC_POSIX +AC_MINIX + +dnl Various compiler setup. +AC_C_INLINE +AC_C_CONST +AC_TYPE_PID_T +AC_TYPE_SIZE_T +AC_TYPE_SIGNAL + +dnl Checks for programs. +AC_PROG_INSTALL +AC_PROG_LN_S +AC_PROG_RANLIB +AC_PROG_YACC +AM_PROG_LEX + +OPENAFS_CHECK_BIGENDIAN + +AC_MSG_CHECKING(your OS) +system=$host +case $system in + *-linux*) + MKAFS_OSTYPE=LINUX + if test "x$with_linux_kernel_headers" != "x"; then + LINUX_KERNEL_PATH="$with_linux_kernel_headers" + else + LINUX_KERNEL_PATH="/usr/src/linux" + fi + if test -f "$LINUX_KERNEL_PATH/include/linux/version.h"; then + linux_kvers=`fgrep UTS_RELEASE $LINUX_KERNEL_PATH/include/linux/version.h |awk 'BEGIN { FS="\"" } { print $2 }'` + if test "x$linux_kvers" = "x"; then + AC_MSG_ERROR(Linux headers lack version definition) + exit 1 + else + LINUX_VERSION="$linux_kvers" + fi + else + AC_MSG_ERROR(No linux headers found at $with_linux_kernel_headers) + exit 1 + fi + AC_MSG_RESULT(linux) + LINUX_FS_STRUCT_INODE_HAS_I_BYTES + LINUX_INODE_SETATTR_RETURN_TYPE + ;; + *-solaris*) + MKAFS_OSTYPE=SOLARIS + AC_MSG_RESULT(sun4) + ;; + *-hpux*) + MKAFS_OSTYPE=HPUX + AC_MSG_RESULT(hp_ux) + ;; + *-irix*) + MKAFS_OSTYPE=IRIX + AC_MSG_RESULT(sgi) + ;; + *-aix*) + MKAFS_OSTYPE=AIX + AC_MSG_RESULT(rs_aix) + ;; + *-osf*) + MKAFS_OSTYPE=DUX + AC_MSG_RESULT(alpha_dux) + ;; + *-darwin*) + MKAFS_OSTYPE=DARWIN + AC_MSG_RESULT(ppc_darwin) + ;; + *-freebsd*) + MKAFS_OSTYPE=FBSD + AC_MSG_RESULT(i386_fbsd) + ;; + *) + AC_MSG_RESULT($system) + ;; +esac + +if test "x${MKAFS_OSTYPE}" = "xIRIX"; then + echo Skipping library tests because they confuse Irix. +else + AC_CHECK_FUNCS(socket) + + if test "$ac_cv_func_socket" = no; then + for lib in socket inet; do + if test "$HAVE_SOCKET" != 1; then + AC_CHECK_LIB(${lib}, socket,LIBS="$LIBS -l$lib";HAVE_SOCKET=1;AC_DEFINE(HAVE_SOCKET)) + fi + done + fi + + AC_CHECK_FUNCS(connect) + + if test "$ac_cv_func_connect" = no; then + for lib in nsl; do + if test "$HAVE_CONNECT" != 1; then + AC_CHECK_LIB(${lib}, connect,LIBS="$LIBS -l$lib";HAVE_CONNECT=1;AC_DEFINE(HAVE_CONNECT)) + fi + done + fi + + AC_CHECK_FUNCS(gethostbyname) + if test "$ac_cv_func_gethostbyname" = no; then + for lib in dns nsl resolv; do + if test "$HAVE_GETHOSTBYNAME" != 1; then + AC_CHECK_LIB(${lib}, gethostbyname, LIBS="$LIBS -l$lib";HAVE_GETHOSTBYNAME=1;AC_DEFINE(HAVE_GETHOSTBYNAME)) + fi + done + fi + + AC_CHECK_FUNCS(res_search) + if test "$ac_cv_func_res_search" = no; then + for lib in dns nsl resolv; do + if test "$HAVE_RES_SEARCH" != 1; then + AC_CHECK_LIB(${lib}, res_search, LIBS="$LIBS -l$lib";HAVE_RES_SEARCH=1;AC_DEFINE(HAVE_RES_SEARCH)) + fi + done + if test "$HAVE_RES_SEARCH" = 1; then + LIB_res_search="-l$lib" + fi + fi +fi + +PTHREAD_LIBS=error +AC_CHECK_LIB(pthread, pthread_attr_init, + PTHREAD_LIBS="-lpthread") +if test "x$PTHREAD_LIBS" = xerror; then + AC_CHECK_LIB(pthreads, pthread_attr_init, + PTHREAD_LIBS="-lpthreads") +fi +if test "x$PTHREAD_LIBS" = xerror; then + AC_CHECK_LIB(c_r, pthread_attr_init, + PTHREAD_LIBS="-lc_r") +fi +if test "x$PTHREAD_LIBS" = xerror; then + AC_CHECK_FUNC(pthread_attr_init, PTHREAD_LIBS="") +fi +if test "x$PTHREAD_LIBS" = xerror; then + AC_MSG_ERROR(*** Unable to locate working posix thread library ***) +fi +AC_SUBST(PTHREAD_LIBS) + +WITH_OBSOLETE=NO +if test "$enable_obsolete" = "yes"; then + WITH_OBSOLETE=YES +fi + +WITH_INSECURE=NO +if test "$enable_insecure" = "yes"; then + WITH_INSECURE=YES +fi + +# Should autocompute a default +if test "x$with_afs_sysname" != "x"; then + AFS_SYSNAME="$with_afs_sysname" +else + AC_MSG_ERROR(An AFS sysname is required) + exit 1 +fi + +if test "$enable_bos_restricted_mode" = "yes"; then + AC_DEFINE(BOS_RESTRICTED_MODE) +fi + +if test "$enable_namei_fileserver" = "yes"; then + AC_DEFINE(AFS_NAMEI_ENV) +fi + +if test "$enable_afsdb" = "yes"; then + LIB_AFSDB="$LIB_res_search" + AC_DEFINE(AFS_AFSDB_ENV) +fi + +SRCDIR_PARENT=`pwd` +TOP_SRCDIR="${SRCDIR_PARENT}/src" + +dnl checks for header files. +AC_HEADER_STDC +AC_HEADER_SYS_WAIT +AC_HEADER_DIRENT +AC_CHECK_HEADERS(stdlib.h string.h unistd.h fcntl.h sys/time.h sys/file.h) +AC_CHECK_HEADERS(netinet/in.h netdb.h sys/fcntl.h sys/mnttab.h sys/mntent.h) +AC_CHECK_HEADERS(mntent.h sys/vfs.h sys/param.h sys/fs_types.h) +AC_CHECK_HEADERS(sys/mount.h strings.h termios.h signal.h) +AC_CHECK_HEADERS(windows.h malloc.h winsock2.h direct.h io.h) +AC_CHECK_HEADERS(security/pam_modules.h siad.h usersec.h) + +AC_CHECK_FUNCS(utimes random srandom getdtablesize snprintf re_comp re_exec) + +AC_SUBST(AFS_SYSNAME) +AC_SUBST(LIB_AFSDB) +AC_SUBST(LINUX_KERNEL_PATH) +AC_SUBST(LINUX_VERSION) +AC_SUBST(MKAFS_OSTYPE) +AC_SUBST(TOP_SRCDIR) +AC_SUBST(WITH_OBSOLETE) +AC_SUBST(WITH_INSECURE) + +AC_OUTPUT( \ +Makefile \ +src/config/Makefile.${AFS_SYSNAME} \ +src/libafs/MakefileProto.${MKAFS_OSTYPE} \ +) diff --git a/install-sh b/install-sh new file mode 100755 index 000000000..89fc9b098 --- /dev/null +++ b/install-sh @@ -0,0 +1,238 @@ +#! /bin/sh +# +# install - install a program, script, or datafile +# This comes from X11R5. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# `make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. +# + + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit="${DOITPROG-}" + + +# put in absolute paths if you don't have them in your path; or use env. vars. + +mvprog="${MVPROG-mv}" +cpprog="${CPPROG-cp}" +chmodprog="${CHMODPROG-chmod}" +chownprog="${CHOWNPROG-chown}" +chgrpprog="${CHGRPPROG-chgrp}" +stripprog="${STRIPPROG-strip}" +rmprog="${RMPROG-rm}" +mkdirprog="${MKDIRPROG-mkdir}" + +tranformbasename="" +transform_arg="" +instcmd="$mvprog" +chmodcmd="$chmodprog 0755" +chowncmd="" +chgrpcmd="" +stripcmd="" +rmcmd="$rmprog -f" +mvcmd="$mvprog" +src="" +dst="" +dir_arg="" + +while [ x"$1" != x ]; do + case $1 in + -c) instcmd="$cpprog" + shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -m) chmodcmd="$chmodprog $2" + shift + shift + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + -s) stripcmd="$stripprog" + shift + continue;; + + -t=*) transformarg=`echo $1 | sed 's/-t=//'` + shift + continue;; + + -b=*) transformbasename=`echo $1 | sed 's/-b=//'` + shift + continue;; + + *) if [ x"$src" = x ] + then + src=$1 + else + # this colon is to work around a 386BSD /bin/sh bug + : + dst=$1 + fi + shift + continue;; + esac +done + +if [ x"$src" = x ] +then + echo "install: no input file specified" + exit 1 +else + true +fi + +if [ x"$dir_arg" != x ]; then + dst=$src + src="" + + if [ -d $dst ]; then + instcmd=: + else + instcmd=mkdir + fi +else + +# Waiting for this to be detected by the "$instcmd $src $dsttmp" command +# might cause directories to be created, which would be especially bad +# if $src (and thus $dsttmp) contains '*'. + + if [ -f $src -o -d $src ] + then + true + else + echo "install: $src does not exist" + exit 1 + fi + + if [ x"$dst" = x ] + then + echo "install: no destination specified" + exit 1 + else + true + fi + +# If destination is a directory, append the input filename; if your system +# does not like double slashes in filenames, you may need to add some logic + + if [ -d $dst ] + then + dst="$dst"/`basename $src` + else + true + fi +fi + +## this sed command emulates the dirname command +dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` + +# Make sure that the destination directory exists. +# this part is taken from Noah Friedman's mkinstalldirs script + +# Skip lots of stat calls in the usual case. +if [ ! -d "$dstdir" ]; then +defaultIFS=' +' +IFS="${IFS-${defaultIFS}}" + +oIFS="${IFS}" +# Some sh's can't handle IFS=/ for some reason. +IFS='%' +set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` +IFS="${oIFS}" + +pathcomp='' + +while [ $# -ne 0 ] ; do + pathcomp="${pathcomp}${1}" + shift + + if [ ! -d "${pathcomp}" ] ; + then + $mkdirprog "${pathcomp}" + else + true + fi + + pathcomp="${pathcomp}/" +done +fi + +if [ x"$dir_arg" != x ] +then + $doit $instcmd $dst && + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi +else + +# If we're going to rename the final executable, determine the name now. + + if [ x"$transformarg" = x ] + then + dstfile=`basename $dst` + else + dstfile=`basename $dst $transformbasename | + sed $transformarg`$transformbasename + fi + +# don't allow the sed command to completely eliminate the filename + + if [ x"$dstfile" = x ] + then + dstfile=`basename $dst` + else + true + fi + +# Make a temp file name in the proper directory. + + dsttmp=$dstdir/#inst.$$# + +# Move or copy the file name to the temp name + + $doit $instcmd $src $dsttmp && + + trap "rm -f ${dsttmp}" 0 && + +# and set any options; do chmod last to preserve setuid bits + +# If any of these fail, we abort the whole thing. If we want to +# ignore errors from any of these, just make sure not to ignore +# errors from the above "$doit $instcmd $src $dsttmp" command. + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && + +# Now rename the file to the real destination. + + $doit $rmcmd -f $dstdir/$dstfile && + $doit $mvcmd $dsttmp $dstdir/$dstfile + +fi && + + +exit 0 diff --git a/missing b/missing new file mode 100755 index 000000000..1570c7951 --- /dev/null +++ b/missing @@ -0,0 +1,265 @@ +#! /bin/sh +# Common stub for a few missing GNU programs while installing. +# Copyright (C) 1996, 1997, 1999, 2000 Free Software Foundation, Inc. +# Originally by Fran,cois Pinard , 1996. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +if test $# -eq 0; then + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 +fi + +run=: + +case "$1" in +--run) + # Try to run requested program, and just exit if it succeeds. + run= + shift + "$@" && exit 0 + ;; +esac + +# If it does not exist, or fails to run (possibly an outdated version), +# try to emulate it. +case "$1" in + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an +error status if there is no known handling for PROGRAM. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + --run try to run the given command, and emulate it if it fails + +Supported PROGRAM values: + aclocal touch file \`aclocal.m4' + autoconf touch file \`configure' + autoheader touch file \`config.h.in' + automake touch all \`Makefile.in' files + bison create \`y.tab.[ch]', if possible, from existing .[ch] + flex create \`lex.yy.c', if possible, from existing .c + help2man touch the output file + lex create \`lex.yy.c', if possible, from existing .c + makeinfo touch the output file + tar try tar, gnutar, gtar, then tar without non-portable flags + yacc create \`y.tab.[ch]', if possible, from existing .[ch]" + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing 0.3 - GNU automake" + ;; + + -*) + echo 1>&2 "$0: Unknown \`$1' option" + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 + ;; + + aclocal) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`acinclude.m4' or \`configure.in'. You might want + to install the \`Automake' and \`Perl' packages. Grab them from + any GNU archive site." + touch aclocal.m4 + ;; + + autoconf) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`configure.in'. You might want to install the + \`Autoconf' and \`GNU m4' packages. Grab them from any GNU + archive site." + touch configure + ;; + + autoheader) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`acconfig.h' or \`configure.in'. You might want + to install the \`Autoconf' and \`GNU m4' packages. Grab them + from any GNU archive site." + files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' configure.in` + test -z "$files" && files="config.h" + touch_files= + for f in $files; do + case "$f" in + *:*) touch_files="$touch_files "`echo "$f" | + sed -e 's/^[^:]*://' -e 's/:.*//'`;; + *) touch_files="$touch_files $f.in";; + esac + done + touch $touch_files + ;; + + automake) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'. + You might want to install the \`Automake' and \`Perl' packages. + Grab them from any GNU archive site." + find . -type f -name Makefile.am -print | + sed 's/\.am$/.in/' | + while read f; do touch "$f"; done + ;; + + bison|yacc) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified a \`.y' file. You may need the \`Bison' package + in order for those modifications to take effect. You can get + \`Bison' from any GNU archive site." + rm -f y.tab.c y.tab.h + if [ $# -ne 1 ]; then + eval LASTARG="\${$#}" + case "$LASTARG" in + *.y) + SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" y.tab.c + fi + SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" y.tab.h + fi + ;; + esac + fi + if [ ! -f y.tab.h ]; then + echo >y.tab.h + fi + if [ ! -f y.tab.c ]; then + echo 'main() { return 0; }' >y.tab.c + fi + ;; + + lex|flex) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified a \`.l' file. You may need the \`Flex' package + in order for those modifications to take effect. You can get + \`Flex' from any GNU archive site." + rm -f lex.yy.c + if [ $# -ne 1 ]; then + eval LASTARG="\${$#}" + case "$LASTARG" in + *.l) + SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" lex.yy.c + fi + ;; + esac + fi + if [ ! -f lex.yy.c ]; then + echo 'main() { return 0; }' >lex.yy.c + fi + ;; + + help2man) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified a dependency of a manual page. You may need the + \`Help2man' package in order for those modifications to take + effect. You can get \`Help2man' from any GNU archive site." + + file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` + if test -z "$file"; then + file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` + fi + if [ -f "$file" ]; then + touch $file + else + test -z "$file" || exec >$file + echo ".ab help2man is required to generate this page" + exit 1 + fi + ;; + + makeinfo) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified a \`.texi' or \`.texinfo' file, or any other file + indirectly affecting the aspect of the manual. The spurious + call might also be the consequence of using a buggy \`make' (AIX, + DU, IRIX). You might want to install the \`Texinfo' package or + the \`GNU make' package. Grab either from any GNU archive site." + file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` + if test -z "$file"; then + file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` + file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` + fi + touch $file + ;; + + tar) + shift + if test -n "$run"; then + echo 1>&2 "ERROR: \`tar' requires --run" + exit 1 + fi + + # We have already tried tar in the generic part. + # Look for gnutar/gtar before invocation to avoid ugly error + # messages. + if (gnutar --version > /dev/null 2>&1); then + gnutar ${1+"$@"} && exit 0 + fi + if (gtar --version > /dev/null 2>&1); then + gtar ${1+"$@"} && exit 0 + fi + firstarg="$1" + if shift; then + case "$firstarg" in + *o*) + firstarg=`echo "$firstarg" | sed s/o//` + tar "$firstarg" ${1+"$@"} && exit 0 + ;; + esac + case "$firstarg" in + *h*) + firstarg=`echo "$firstarg" | sed s/h//` + tar "$firstarg" ${1+"$@"} && exit 0 + ;; + esac + fi + + echo 1>&2 "\ +WARNING: I can't seem to be able to run \`tar' with the given arguments. + You may want to install GNU tar or Free paxutils, or check the + command line arguments." + exit 1 + ;; + + *) + echo 1>&2 "\ +WARNING: \`$1' is needed, and you do not seem to have it handy on your + system. You might have modified some files without having the + proper tools for further handling them. Check the \`README' file, + it often tells you about the needed prerequirements for installing + this package. You may also peek at any GNU archive site, in case + some other package would contain this missing \`$1' program." + exit 1 + ;; +esac + +exit 0 diff --git a/mkinstalldirs b/mkinstalldirs new file mode 100755 index 000000000..0d3cf411f --- /dev/null +++ b/mkinstalldirs @@ -0,0 +1,40 @@ +#! /bin/sh +# mkinstalldirs --- make directory hierarchy +# Author: Noah Friedman +# Created: 1993-05-16 +# Public domain + +# $Id: mkinstalldirs,v 1.1 2001/07/05 00:54:56 hartmans Exp $ + +errstatus=0 + +for file +do + set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` + shift + + pathcomp= + for d + do + pathcomp="$pathcomp$d" + case "$pathcomp" in + -* ) pathcomp=./$pathcomp ;; + esac + + if test ! -d "$pathcomp"; then + echo "mkdir $pathcomp" 1>&2 + + mkdir "$pathcomp" || lasterr=$? + + if test ! -d "$pathcomp"; then + errstatus=$lasterr + fi + fi + + pathcomp="$pathcomp/" + done +done + +exit $errstatus + +# mkinstalldirs ends here diff --git a/regen.sh b/regen.sh new file mode 100755 index 000000000..9875b78d7 --- /dev/null +++ b/regen.sh @@ -0,0 +1,9 @@ +echo "Updating configuration..." +echo "Running aclocal" +aclocal -I src/cf +echo "Running autoconf" +autoconf +echo "Running autoheader" +autoheader +#echo "Running automake" +#automake diff --git a/src/INSTALL b/src/INSTALL new file mode 100644 index 000000000..50dbe439d --- /dev/null +++ b/src/INSTALL @@ -0,0 +1,183 @@ +Basic Installation +================== + + These are generic installation instructions. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, a file +`config.cache' that saves the results of its tests to speed up +reconfiguring, and a file `config.log' containing compiler output +(useful mainly for debugging `configure'). + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If at some point `config.cache' +contains results you don't want to keep, you may remove or edit it. + + The file `configure.in' is used to create `configure' by a program +called `autoconf'. You only need `configure.in' if you want to change +it or regenerate `configure' using a newer version of `autoconf'. + +The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. If you're + using `csh' on an old version of System V, you might need to type + `sh ./configure' instead to prevent `csh' from trying to execute + `configure' itself. + + Running `configure' takes awhile. While running, it prints some + messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package. + + 4. Type `make install' to install the programs and any data files and + documentation. + + 5. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. You can give `configure' +initial values for variables by setting them in the environment. Using +a Bourne-compatible shell, you can do that on the command line like +this: + CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure + +Or on systems that have the `env' program, you can do it like this: + env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure + +Compiling For Multiple Architectures +==================================== + + You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you must use a version of `make' that +supports the `VPATH' variable, such as GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. + + If you have to use a `make' that does not supports the `VPATH' +variable, you have to compile the package for one architecture at a time +in the source code directory. After you have installed the package for +one architecture, use `make distclean' before reconfiguring for another +architecture. + +Installation Names +================== + + By default, `make install' will install the package's files in +`/usr/local/bin', `/usr/local/man', etc. You can specify an +installation prefix other than `/usr/local' by giving `configure' the +option `--prefix=PATH'. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +give `configure' the option `--exec-prefix=PATH', the package will use +PATH as the prefix for installing programs and libraries. +Documentation and other data files will still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=PATH' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + +Optional Features +================= + + Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + +Specifying the System Type +========================== + + There may be some features `configure' can not figure out +automatically, but needs to determine by the type of host the package +will run on. Usually `configure' can figure that out, but if it prints +a message saying it can not guess the host type, give it the +`--host=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name with three fields: + CPU-COMPANY-SYSTEM + +See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the host type. + + If you are building compiler tools for cross-compiling, you can also +use the `--target=TYPE' option to select the type of system they will +produce code for and the `--build=TYPE' option to select the type of +system on which you are compiling the package. + +Sharing Defaults +================ + + If you want to set default values for `configure' scripts to share, +you can create a site shell script called `config.site' that gives +default values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Operation Controls +================== + + `configure' recognizes the following options to control how it +operates. + +`--cache-file=FILE' + Use and save the results of the tests in FILE instead of + `./config.cache'. Set FILE to `/dev/null' to disable caching, for + debugging `configure'. + +`--help' + Print a summary of the options to `configure', and exit. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`--version' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`configure' also accepts some other, not widely useful, options. + diff --git a/src/Makefile.am.common b/src/Makefile.am.common new file mode 100644 index 000000000..ba152f6c7 --- /dev/null +++ b/src/Makefile.am.common @@ -0,0 +1,55 @@ +# $Id: Makefile.am.common,v 1.1 2001/07/05 00:54:58 hartmans Exp $ + +INCLUDES+=-I$(top_builddir)/include + +SYSNAME=@SYSNAME@ + +CP = cp + +LEXLIB = @LEXLIB@ + +COMPILE_ET = $(top_builddir)/comerr/compile_et + +.et.h: + $(COMPILE_ET) $< +.et.c: + $(COMPILE_ET) $< + +buildinclude = $(top_builddir)/include + +all-local: install-build-headers + +install-build-headers:: $(include_HEADERS) $(build_HEADERZ) $(rxbuild_HEADERZ= $(afsbuild_HEADERZ) + @foo='$(include_HEADERS) $(build_HEADERZ)'; \ + for f in $$foo; do \ + f=`basename $$f`; \ + if test -f "$(srcdir)/$$f"; then file="$(srcdir)/$$f"; \ + else file="$$f"; fi; \ + if cmp -s $$file $(buildinclude)/$$f 2> /dev/null ; then \ + : ; else \ + echo " $(CP) $$file $(buildinclude)/$$f"; \ + $(CP) $$file $(buildinclude)/$$f; \ + fi ; \ + done + @foo='$(afsbuild_HEADERZ)'; \ + for f in $$foo; do \ + f=`basename $$f`; \ + if test -f "$(srcdir)/$$f"; then file="$(srcdir)/$$f"; \ + else file="$$f"; fi; \ + if cmp -s $$file $(buildinclude)/afs/$$f 2> /dev/null ; then \ + : ; else \ + echo " $(CP) $$file $(buildinclude)/afs/$$f"; \ + $(CP) $$file $(buildinclude)/afs/$$f; \ + fi ; \ + done + @foo='$(rxinclude_HEADERZ)'; \ + for f in $$foo; do \ + f=`basename $$f`; \ + if test -f "$(srcdir)/$$f"; then file="$(srcdir)/$$f"; \ + else file="$$f"; fi; \ + if cmp -s $$file $(buildinclude)/rx/$$f 2> /dev/null ; then \ + : ; else \ + echo " $(CP) $$file $(buildinclude)/rx/$$f"; \ + $(CP) $$file $(buildinclude)/rx/$$f; \ + fi ; \ + done diff --git a/src/Makefile.djgpp b/src/Makefile.djgpp new file mode 100644 index 000000000..362b1b2c1 --- /dev/null +++ b/src/Makefile.djgpp @@ -0,0 +1,85 @@ +# Top-level Makefile for Win95/DJGPP AFS client +# Assumes you are doing cross-compiling from Linux +# Set LINUX_SYS to the proper sysname for your Linux system + +OBJ = $(SYS_NAME)/obj +DEST = $(SYS_NAME)/dest +#LINUX_SYS = i386_linux22 + +all: afsd + +afsd: config pinstall libs + make -C $(OBJ)/WINNT/afsd -f Makefile.djgpp depends + make -C $(OBJ)/WINNT/afsd -f Makefile.djgpp install + +utils: pinstall rxgen comerr +includes: afsdinc osiinc authinc +libs: fsint cmd lwp osi rx rxkad vldb rxstat acl + +clean: + -rm -f $(SYS_NAME)/dest/include/* + -rm -f $(SYS_NAME)/dest/include/afs/* + -rm -f $(SYS_NAME)/dest/lib/* + -rm -f $(SYS_NAME)/dest/lib/afs/* + -rm -f $(SYS_NAME)/dest/bin/* + +config: + -make -C $(OBJ)/config install + +# pinstall, rxgen, comerr, and util are built to run on Linux +pinstall: config + -mkdir $(OBJ)/pinstall/afs + -cp $(OBJ)/config/param.$(LINUX_SYS).h $(OBJ)/pinstall/afs/param.h + make -C $(OBJ)/pinstall SYS_NAME=$(LINUX_SYS) install +rxgen: config + -mkdir $(OBJ)/rxgen/afs + -cp $(OBJ)/config/param.$(LINUX_SYS).h $(OBJ)/rxgen/afs/param.h + make -C $(OBJ)/rxgen SYS_NAME=$(LINUX_SYS) install +comerr: config util + -mkdir $(OBJ)/comerr/afs + -cp $(OBJ)/config/param.$(LINUX_SYS).h $(OBJ)/comerr/afs/param.h + make -C $(OBJ)/comerr SYS_NAME=$(LINUX_SYS) install +util: config procmgmt + -mkdir $(OBJ)/util/afs + -cp $(OBJ)/util/param.$(LINUX_SYS).h $(OBJ)/util/afs/param.h + make -C $(OBJ)/util SYS_NAME=$(LINUX_SYS) install + +procmgmt: + make -C $(OBJ)/procmgmt includes +lwp: util afsdinc osiinc lwpinc + make -C $(OBJ)/lwp install +lwpinc: + make -C $(OBJ)/lwp includes +rx: rxgen lwp + make -C $(OBJ)/rx install-djgpp +des: desprogs + make -C $(OBJ)/des install +desprogs: + make -C $(OBJ)/des SYS_NAME=$(LINUX_SYS) gprogs +ubik: rx lwp + make -C $(OBJ)/ubik install +fsint: rx rxgen + make -C $(OBJ)/fsint install +rxkad: rx des + make -C $(OBJ)/rxkad install +audit: fsint + make -C $(OBJ)/audit install +authinc: comerr + make -C $(OBJ)/auth includes +vldb: rxgen rx authinc audit ubik rxkad + make -C $(OBJ)/vlserver libinstall +rxstat: rxgen rx + make -C $(OBJ)/rxstat install +cmd: comerr + make -C $(OBJ)/cmd install +afsdinc: + make -C $(OBJ)/WINNT/afsd -f Makefile.djgpp includes +osiinc: + make -C $(OBJ)/WINNT/client_osi -f Makefile.djgpp includes +osi: config + make -C $(OBJ)/WINNT/client_osi -f Makefile.djgpp depends + make -C $(OBJ)/WINNT/client_osi -f Makefile.djgpp install +acl: config ptlib + make -C $(OBJ)/libacl install +ptlib: config rxgen comerr + make -C $(OBJ)/ptserver libinstall diff --git a/src/NTMake9x b/src/NTMake9x new file mode 100644 index 000000000..8b84b8986 --- /dev/null +++ b/src/NTMake9x @@ -0,0 +1,320 @@ +# Copyright 2000, International Business Machines Corporation and others. +# All Rights Reserved. +# +# This software has been released under the terms of the IBM Public +# License. For details, see the LICENSE file in the top-level source +# directory or online at http://www.openafs.org/dl/license10.html + +# Top level nmake NTMakefile driver for building AFS. +# +# This file simply imposes a reasonable total ordering on the set of +# directories to build; this ordering is of course more strict than the +# partial ordering established by the actual directory dependencies. +# +# When porting a new directory, simply add the directory into the +# dependence chain at the earliest point possible, updating its successor +# appropriately; if the new directory is the last in the chain, then +# update the 'finale' dependency to be the new directory. + + +CD = cd +NTMAKE = nmake /nologo /f ntmakefile install9x +NTMAKELANG = nmake /nologo /f ntmakefile en_install +NTMAKE_HEADERS = nmake /nologo /f ntmakefile install_headers +NTMAKE_LIBUTILS = nmake /nologo /f ntmakefile install_libutils +MKDIR = mkdir +#OBJ = src + +# Standard install directory. +!IFDEF AFSDEV_DESTDIR +DESTDIR = $(AFSDEV_DESTDIR) +!ELSE +DESTDIR = $(AFSROOT)\DEST +!ENDIF + + +start: +! IF (!EXIST(src)) +! ERROR Execute nmake from directory above src, e.g., afs\3.5. +! ENDIF +! IF (!EXIST($(DESTDIR))) + $(MKDIR) $(DESTDIR) +! ENDIF + +config: + echo ***** $@ + $(CD) $(OBJ)\$@ + $(NTMAKE) + $(CD) ..\.. + +procmgmt_headers: config + echo ***** $@ + $(CD) $(OBJ)\procmgmt + $(NTMAKE_HEADERS) + $(CD) ..\.. + +afsreg_headers: config + echo ***** $@ + $(CD) $(OBJ)\WINNT\afsreg + $(NTMAKE_HEADERS) + $(CD) ..\..\.. + +util: procmgmt_headers afsreg_headers + echo ***** $@ + $(CD) $(OBJ)\$@ + $(NTMAKE) + $(CD) ..\.. + +comerr: util + echo ***** $@ + $(CD) $(OBJ)\$@ + $(NTMAKE) + $(CD) ..\.. + +cmd: comerr + echo ***** $@ + $(CD) $(OBJ)\$@ + $(NTMAKE) + $(CD) ..\.. + +afsreg: cmd + echo ***** $@ + $(CD) $(OBJ)\WINNT\$@ + $(NTMAKE) + $(CD) ..\..\.. + +eventlog: afsreg + echo ***** $@ + $(CD) $(OBJ)\WINNT\$@ + $(NTMAKE) + $(CD) ..\..\.. + +lwp: eventlog + echo ***** $@ + $(CD) $(OBJ)\$@ + $(NTMAKE) + $(CD) ..\.. + +rxgen: lwp + echo ***** $@ + $(CD) $(OBJ)\$@ + $(NTMAKE) + $(CD) ..\.. + +des: rxgen + echo ***** $@ +! IF (EXIST($(OBJ)\des\NTMakefile)) + $(CD) $(OBJ)\des + $(NTMAKE) + $(CD) ..\.. +! ELSE + $(CD) $(OBJ)\des_stub + $(NTMAKE) + $(CD) ..\.. +! ENDIF + +rx: des + echo ***** $@ + $(CD) $(OBJ)\$@ + $(NTMAKE) + $(CD) ..\.. + +rxstat: rx + echo ***** $@ + $(CD) $(OBJ)\$@ + $(NTMAKE) + $(CD) ..\.. + +rxkad: rxstat + echo ***** $@ + $(CD) $(OBJ)\$@ + $(NTMAKE) + $(CD) ..\.. + +pthread: rxkad + echo ***** $@ + $(CD) $(OBJ)\WINNT\$@ + $(NTMAKE) + $(CD) ..\..\.. + +procmgmt: pthread + echo ***** $@ + $(CD) $(OBJ)\$@ + $(NTMAKE) + $(CD) ..\.. + +fsint: procmgmt + echo ***** $@ + $(CD) $(OBJ)\$@ + $(NTMAKE) + $(CD) ..\.. + +audit: fsint + echo ***** $@ + $(CD) $(OBJ)\$@ + $(NTMAKE) + $(CD) ..\.. + +osi_headers: audit + echo ***** $@ + $(CD) $(OBJ)\WINNT\client_osi + $(NTMAKE_HEADERS) + $(CD) ..\..\.. + +libacl_headers: osi_headers + echo ***** $@ + $(CD) $(OBJ)\libacl + $(NTMAKE_HEADERS) + $(CD) ..\.. + +cm_headers: libacl_headers + echo ***** $@ + $(CD) $(OBJ)\WINNT\afsd + $(NTMAKE_HEADERS) + $(CD) ..\..\.. + +sys: cm_headers + echo ***** $@ + $(CD) $(OBJ)\$@ + $(NTMAKE) + $(CD) ..\.. + +auth: sys + echo ***** $@ + $(CD) $(OBJ)\$@ + $(NTMAKE) + $(CD) ..\.. + +ubik: auth + echo ***** $@ + $(CD) $(OBJ)\$@ + $(NTMAKE) + $(CD) ..\.. + +ptserver: ubik + echo ***** $@ + $(CD) $(OBJ)\$@ + $(NTMAKE_LIBUTILS) + $(CD) ..\.. + +libacl: ptserver + echo ***** $@ + $(CD) $(OBJ)\$@ + $(NTMAKE) + $(CD) ..\.. + +kauth: libacl + echo ***** $@ + $(CD) $(OBJ)\$@ + $(NTMAKE) + $(CD) ..\.. + +vlserver: kauth + echo ***** $@ + $(CD) $(OBJ)\$@ + $(NTMAKE_LIBUTILS) + $(CD) ..\.. + +usd: vlserver + echo ***** $@ + $(CD) $(OBJ)\$@ + $(NTMAKE) + $(CD) ..\.. + +libafsrpc: usd + echo ***** $@ + $(CD) $(OBJ)\$@ + $(NTMAKE) + $(CD) ..\.. + +libafsauthent: libafsrpc + echo ***** $@ + $(CD) $(OBJ)\$@ + $(NTMAKE) + $(CD) ..\.. + +libadmin: libafsauthent + echo ***** $@ + $(CD) $(OBJ)\$@ + $(NTMAKE) + $(CD) ..\.. + +client_talocale: libadmin + echo ***** $@ + $(CD) $(OBJ)\WINNT\talocale + $(NTMAKE) + $(CD) ..\..\.. + +client_osi: client_talocale + echo ***** $@ + $(CD) $(OBJ)\WINNT\$@ + $(NTMAKE) + $(CD) ..\..\.. + +afsd: client_osi + echo ***** $@ + $(CD) $(OBJ)\WINNT\$@ + $(NTMAKE_LIBUTILS) + $(CD) ..\..\.. + +client_cpa: afsd + echo ***** $@ + $(CD) $(OBJ)\WINNT\$@ + $(NTMAKE) + $(CD) ..\..\.. + +client_config: client_cpa + echo ***** $@ + $(CD) $(OBJ)\WINNT\$@ + $(NTMAKE) + $(CD) ..\..\.. + +client_exp: client_config + echo ***** $@ + $(CD) $(OBJ)\WINNT\$@ + $(NTMAKE) + $(CD) ..\..\.. + + +#Leave last echo in - it helps the build reconize the last $(CD) +win9xpanel : + echo ***** $@ + $(CD) $(OBJ)\WINNT\$@ + $(NTMAKE) + $(CD) ..\..\.. + echo ***** End of Build + +install: start client_exp win9xpanel + +install9x: install + +# InstallShield dependencies + +#Leave last echo in - it helps the build reconize the last $(CD) +Win9x:: + $(CD) $(OBJ)\WINNT\install\$@ + nmake /nologo /f NTMakefile install9x + $(CD) ..\..\..\.. + echo **** End of Install Scripts + +media: Win9x + +# Clean target for obj tree +# Fake the version copy so clean will go through the complete cycle with undefines +clean: start + if not exist .\src\config\NTMakefile.version copy .\src\config\NTMakefile.version-NOCML .\src\config\NTMakefile.version + nmake /nologo /f ntmake9x "NTMAKE = nmake /nologo /f ntmakefile clean" "NTMAKE_HEADERS = nmake /nologo /f ntmakefile clean" "NTMAKE_LIBUTILS = nmake /nologo /f ntmakefile clean" install + $(CD) $(OBJ)\WINNT\install\Win9x + nmake /nologo /f NTMakefile clean + $(CD) ..\..\..\.. + .\src\rmbat $(DESTDIR)\include\*.* $(DESTDIR)\include\afs\*.* $(DESTDIR)\include\WINNT\*.* $(DESTDIR)\include\rx\*.* + .\src\rmbat $(DESTDIR)\LIB\*.LIB $(DESTDIR)\LIB\*.DLL $(DESTDIR)\LIB\AFS\*.LIB + .\src\RMBAT $(DESTDIR)\root.client\usr\vice\etc\*.* + $(CD) $(OBJ)\config + nmake /nologo /f ntmakefile clean_version + $(CD) ..\.. + echo **** End of Clean + +# Language-only build target +lang: + nmake /nologo /f ntmakefile "NTMAKE = nmake /nologo /f ntmakefile lang" "NTMAKE_HEADERS = nmake /nologo /f ntmakefile lang" install diff --git a/src/README-WIN9X b/src/README-WIN9X new file mode 100644 index 000000000..a19ba59f9 --- /dev/null +++ b/src/README-WIN9X @@ -0,0 +1,165 @@ +Copyright 2000, International Business Machines Corporation and others. +All Rights Reserved. + +This software has been released under the terms of the IBM Public +License. For details, see the LICENSE file in the top-level source +directory or online at http://www.openafs.org/dl/license10.html + +Building Open AFS on Win 95 +--------------------------- + +The Windows 95 Open AFS client consists of two main components: the client +program afsd.exe, which is compiled with the DJGPP compiler and runs in a +DOS virtual machine; and the utility programs, which are built on Windows +NT or 9x using the Microsoft Visual C++ compiler V6.0. + +afsd.exe +-------- + +afsd.exe is built using the DJGPP cross-compiler, executed from Linux. +It should also be possible to build it using the native DOS DJGPP compiler, +but we did not try this. You will need to install the following packages +from DJGPP and the Coda project. + +ftp://ftp.coda.cs.cmu.edu/pub/tools/djgpp-2.01_0.93_glibc-1.i386.rpm +ftp://ftp.coda.cs.cmu.edu/pub/tools/djgpp-win95ext-2.01_0.93_glibc-1.i386.rpm +ftp://ftp.coda.cs.cmu.edu/pub/tools/gdb-djgpp-4.16-2.i386.rpm + +You will also need the MMAP.VXD and SOCK.VXD from the Coda project. Source +is available here: +ftp://ftp.coda.cs.cmu.edu/pub/coda/src/win95-coda-5.2.0.zip + +Follow the Coda instructions to build these VXD's, which you can read here: +http://www.coda.cs.cmu.edu/doc/html/coda-howto-6.html#ss6.4 + +Once you have the necessary tools installed, set the following environment +variables: +SYS_NAME: set to i386_djgpp +LINUX_SYS: set to the sysname of the Linux version you are using, e.g., + i386_linux22 + +The makefile expects to build into a platform directory with symlinks +into the source directory. The Perl script "mkdest.pl" in this dir. will +set this up for you. To use it, create a directory under the top-level +dir. (the directory above src) called "i386_djgpp". Then cd to that +directory and type "../src/mkdest.pl " + +Then execute "make -f Makefile.djgpp" from the top-level directory. +(You can create a symlink to src/Makefile.djgpp from this dir.) +The afsd.exe will be built into i386_djgpp/dest/bin. + +Build notes: + + The Makefile.djgpp actually builds Linux versions of the utilities + rxgen, install, compile_et, and util.a. It uses the Linux version + of param.h which it copies to the afs subdirectory of the above + components. You will need to set SYS_NAME to your Linux system name + manually if you want to build these utilities separately. + +Utilities and GUI programs +-------------------------- + +The rest of the support programs are built as Win32 executables from a +Windows 9x or NT system. You will need to set the following environment +variables: + +set SYS_NAME=i386_win95 +set AFSDEV_BUILDTYPE=CHECKED (or FREE if you want to skip debugging info.) +set AFSDEV_INCLUDE= +set AFSDEV_LIB= +set AFSDEV_BIN=. +set AFSROOT= + e.g. AFSROOT\SRC is source directory of the build tree +SET _WIN32_IE=0x400 +set OBJ=src or obj, see below +set MSSDK=, see below + +If you are building on a Unix directory exported to Windows through Samba +or AFS, you can create a platform directory named "i386_win95" using the +"mkdest.pl" script as described above (run from a Unix system). This will +only work on a file system that supports symbolic links. If you are using +a platform directory, set the OBJ environment var. to "obj" and create +a symlink "obj" in the top-level dir. that points to "i386_win95/obj". +Otherwise, set OBJ to "src" to build the objects with the sources. + +The environment variable AFSROOT points to the parent of the AFS src +directory. Executables will be built by default in AFSROOT\dest. + +Copy the file src\NTMake9x to the parent of the src directory. You only +need to do this once. If you are building on a local drive, copy +AFSROOT\src\symlink.bat to AFSROOT\. + +Follow the NT build instructions in file "README-NT" to perform the build. +You will be using "NTMake9x" as the top-level makefile, instead of +"NTMakefile". Most of the instructions in "README-NT" apply to the Win9x +build as well. + +Build Notes: + +1) If you are building the Windows 9x AFS Client Control Panel + (win9xpanel), it requires shlwapi.h. This file can be found in the + header files associated with the Windows SDK (95/98 NT or W2000). + +2) You can build the Windows 9x client from a Windows NT or W2000 system. + This requires you to edit AFSROOT\config\NTMakefile.i386_win95. + Change line: DEL = $(AFSROOT)\src\rmbat + to: DEL = -del /q /f + +3) If you build the W2000 client, then switch to building the Windows 95 + client (or vice versa), you should clean the previous build by either: + nmake -f ntmakefile clean +or nmake -f ntmake9x clean + +4) When building the "comerr" component, the makefile now uses the + existing error_table_nt.c file (and touches it so it will be up to date + by default.) If you make changes to the lex or yacc source files and want + to rebuild error_table_nt.c, you can simply delete it and rerun make, + which will cause the file to be built using lex and yacc. Make sure + you have these utilities on your system. + +5) Required DLL's for redistribution + + The AFS Control Panel for Win95/98 requires Microsoft DLL's that can + be installed using: + VC6RedistSetup_enu.exe + This is located at: + http://support.microsoft.com/support/kb/articles/Q259/4/03.ASP + +6) Installation + + First, execute "nmake /f ntmake9x media" to copy all the client + executables and other files to DEST\WinInstall. + + You can then install the client onto a target Windows 9x machine by + executing: + install.bat + For example, + install.bat DEST\WinInstall\ c: \afscli almaden.ibm.com 40000 + + If you do not wish to use the batch file, you can install the client + manually by performing the following steps. + + 1. On the target machine, copy all the files from DEST\WinInstall to the + install location (usually c:\afscli). + 2. Add entries to the target's AUTOEXEC.BAT file as follows: + set AFSCONF=c:\afscli (replace with your install dir.) + path %path%;c:\afscli + 3. Copy the template.reg file to afscli.reg. Replace any references + to c: and afscli with your install location. Double click on the + afscli.reg file to add the registry entries to the target system. + 4. Create the following AFS configuration files in the install dir.: + - ThisCell: + containing the name of your home cell + - cache.info: + containing your cache configuration. For example, + to configure a cache of 40,000 1KB blocks with a disk cache + location of c:\afscache, you would enter in this file: + /afs:c:\afscache;40000 + (The cache location has no effect unless you have enabled + the experimental disk cache support.) + - CellServDB: + the cell server database. You can get the latest version from AFS: + /afs/transarc.com/service/etc/CellServDB.export + 5. Reboot the target machine. + 6. You can now start the client by executing the program WinAfsLoad.exe + from the install directory. diff --git a/src/TechNotes-WIN9X b/src/TechNotes-WIN9X new file mode 100644 index 000000000..ced7f49e5 --- /dev/null +++ b/src/TechNotes-WIN9X @@ -0,0 +1,154 @@ +Win9x AFS Client: Technical Notes +--------------------------------- + +This file gives a technical overview of the Win9x AFS client and describes +the main differences from the NT client. + + +Overview +-------- + +The Windows 9x client is based on the Windows NT/2000 client. Like the +NT client, it exports AFS through an SMB interface. Programs access AFS +files by mounting AFS submounts as SMB shares and using the built-in +Windows SMB client to communicate with the AFS client. The AFS client +acts as an SMB server. It runs entirely at user level. + +DOS box implementation and VXD's +-------------------------------- + +The main program of the Win9x client, afsd.exe, is implemented as a +32-bit DOS program. It is compiled using the DJGPP compiler and runs in +a Windows 9x DOS virtual machine. This approach was necessary to avoid +a well-known deadlock problem in Windows 9x when the kernel calls up +to a user-level Win32 daemon: the original requesting program grabs the +Win16Mutex before entering the kernel. The request is then passed up to +the daemon, who attempts to service it using network or file I/O calls. +These calls also attempt to obtain the Win16Mutex, which is still being +held by the original requester, so there is a deadlock. + +To avoid this problem, the daemon runs in a DOS box. I/O calls from +a DOS program do not attempt to obtain the Win16Mutex, so the deadlock +is avoided. This approach was discovered by the Coda team at Carnegie +Mellon University and used to implement a Win9x version of their client. +The Win9x AFS client uses the same approach. It also uses the Coda team's +SOCK.VXD which was written to provide network functions to a DOS program. +Sockets functions which call SOCK.VXD were added to the DJGPP library. + +For more information about the Coda team's approach to this problem, see +their paper from Usenix 1999: +http://www.cs.cmu.edu/afs/cs/project/coda/Web/docdir/freenix99.pdf + +Note that the AFS client also requires the Coda team's MMAP.VXD. We are +not actually calling this VXD, but afsd crashes if it is built without +it (i.e., by building with dos-gcc -bw95 instead of -bmmap). Solutions to +this problem welcomed.. + +Netbios functions +----------------- + +The Windows AFS clients communicate with user applications using the +SMB protocol, as described above. SMB communication is done using the +Netbios interface. In Win32, there is a built-in function Netbios() +which accomplishes this. In a DOS program, however, this function is +unavailable. However, Netbios functionality is available in the BIOS +by calling interrupt 0x5c. The NCB (Netbios Control Block) and data +buffer must be in conventional DOS memory, i.e., below 1 MB. This memory +can only be accessed in DJGPP by using the DOS memory access functions: +dosmemget(), dosmemput(), _farpeekX() and _farpokeX(). The Win9x client +uses a separately-allocated DOS memory buffer and copies data to and from +DOS memory for network communication. + +Functions were also added to LWP's iomgr.c to check for the completion +of Netbios requests. The IOMGR now checks for NCB completion in addition +to checking for timer expiration, signal delivery, and performing select() +on file descriptors. + +See the new files: netbios95.c, dosutils95.c, and the various changes +(marked by "#ifdef DJGPP") to smb.c in WINNT/afsd. Also see lwp/iomgr.c. + +Thread functions +---------------- + +Unlike the NT client which uses Win32 thread and locking functions, +the Win9x client uses the LWP package from the AFS source distribution. +An interface layer was added to allow NT and Win9x to make the same calls. +For example, thrd_Create() is now used to create a thread. In NT, this +is just a macro to the Win32 function CreateThread(). In Win9x, it is a +function which calls the LWP function LWP_CreateProcess(). See the new +files osithrd95.c, osithrd95.h, and osithrdnt.h in WINNT/client_osi. + +Configuration parameters +------------------------ + +In DJGPP, it is not feasible to access the system registry, which is +where the NT client stores its configuration info. For the Win9x client, +the Unix approach is followed instead: the local cell is in a file called +"ThisCell", cache configuration is in a file called "cache.info", and +the cell database is stored in "CellServDB" instead of "afsdcell.ini". +Many parameters are passed via the command line to afsd.exe and are +processed just like the Unix clients. + +See the new files afsd_init95.c and afsd95.c in WINNT/afsd. + +Authentication +-------------- + +In the functions SetToken() and GetToken(), the NT client sends and +receives the session key using a separate RPC which should use encryption, +rather than including the session key in the pioctl packet. The Win9x +version avoids this RPC and puts the session key back into the pioctl. +This should not be a security issue on Win9x since it is a single-user +machine. (The pioctl packet will not be visible externally.) See files +WINNT/afsd/cm_ioctl.c and auth/ktc_nt.c. + +Persistent (disk) caching +------------------------- + +Disk caching support was added for the 9x client. This has barely been +tested and is still very experimental! In addition, there are numerous +performance issues. It relies on the fact that LWP is a non-preemptive +threads package, so no locking is done to protect shared data structures. +In addition, it uses synchronous I/O to read and write disk files. Since +LWP is a user-level threads package, any calls to normal I/O system calls +like read() or write() will block the entire process. One better approach +would be to add support for local disk file descriptors to the select() +call used by IOMGR, and then to use IOMGR_Select to enqueue I/O requests +to the disk. Currently, the select() function supports only sockets. + +It should be fairly easy to adapt this code for the NT client. See the +implementation in WINNT/afsd/cm_diskcache95.c. To enable this code, +define DISKCACHE95 in WINNT/afsd/Makefile.djgpp. + +Utility programs +---------------- + +The utility programs, such as klog.exe and fs.exe, are Win32 programs and +are built using the Microsoft compiler. Changes to the code for these +files are marked by "#ifdef AFS_WIN95_ENV". + +GUI interface +------------- + +The Win9x client does not use the NT configuration GUI programs in +client_creds and client_cpa (Control Panel Applet.) It uses a separate +GUI program called WinAfsLoad.exe in WINNT/win9xpanel. This program can +start afsd.exe and keep track of submounts and token expiration. + +The Explorer shell extension, which allows right clicking on a file +in Windows Explorer to get an AFS submenu, is supported in Win9x. +See WINNT/client_exp. + +Integrated logon +---------------- + +Integrated logon is not supported in the 9x client. + +Known issues +------------ + +1) The Microsoft linker LINK386.exe causes a deadlock when attempting to +create an executable on an AFS filesystem. Somehow, the linker appears +to be preempting the entire machine so afsd.exe cannot run to service +requests. Solutions to this problem eagerly sought! (This problem does +not seem to occur with the Win9x Coda client.) diff --git a/src/WINNT/afsd/Makefile.djgpp b/src/WINNT/afsd/Makefile.djgpp new file mode 100644 index 000000000..678857356 --- /dev/null +++ b/src/WINNT/afsd/Makefile.djgpp @@ -0,0 +1,68 @@ +# +# Makefile.djgpp +# make information for this directory +# requires gmake +# + +SOURCES = afsd95.c afsd_init95.c cm_access.c cm_aclent.c cm_buf.c \ + cm_callback.c cm_cell.c cm_config.c cm_conn.c cm_daemon.c \ + cm_dcache.c cm_dir.c cm_dnlc.c cm_ioctl.c cm_scache.c \ + cm_server.c cm_user.c cm_utils.c cm_vnodeops.c cm_volume.c \ + dosutils95.c largeint95.c netbios95.c smb.c smb_ioctl.c \ + cm_diskcache95.c queue95.c afsmsg95.c smb3.c + +include ../../config/Makefile.djgpp.common + +# apply changes from common for this directory +# +# no changes for this directory + +# what this directory builds +# +TARGETS = afsd.exe +all : $(TARGETS) +install : $(DESTBIN)/afsd.exe #$(DESTBIN)/klog.exe +#CFLAGS += -I../vxd_lib +#CFLAGS += -DAFS_VXD +CFLAGS += -DDOS_PKT_WHOLE + +INCFILES = \ + $(DESTINC)/netbios95.h \ + $(DESTINC)/largeint95.h \ + $(DESTINC)/dosdefs95.h \ + $(DESTINC)/afs/afsmsg95.h + +# hard-wired dependency information +# +REQUIRED_LIBS = $(DESTLIB)/liblwp.a $(DESTLIB)/libosi.a \ + $(DESTLIB)/afs/libcmd.a $(DESTLIB)/afs/libafsint.a \ + $(DESTLIB)/afs/libvldb.a $(DESTLIB)/librxkad.a \ + $(DESTLIB)/librx.a $(DESTLIB)/librxstat.a + + +afsd.exe : $(ALL_OBJS) $(REQUIRED_LIBS) + +includes: $(INCFILES) + +EXECUTABLES = afsd afsd.exe + +$(DESTLIB)/liblwp.a : + $(MAKE) -C ../lwp install + +$(DESTLIB)/librx.a : + $(MAKE) -C ../rx install + +$(DESTLIB)/libosi.a : + $(MAKE) -C ../client_osi install + +$(DESTLIB)/libcmd.a : + $(MAKE) -C ../../cmd install + +$(DESTLIB)/libafsint.a : + $(MAKE) -C ../../fsint install + +$(DESTLIB)/librxkad.a : + $(MAKE) -C ../../rxkad install + +$(DESTLIB)/libvldb.a : + $(MAKE) -C ../../vlserver install diff --git a/src/WINNT/afsd/afsd95.c b/src/WINNT/afsd/afsd95.c new file mode 100644 index 000000000..3aa6bc7d0 --- /dev/null +++ b/src/WINNT/afsd/afsd95.c @@ -0,0 +1,205 @@ +/* + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + */ + +#include +#include + +/*#include */ +#include +/*#include */ + +#include +#include + +#include +#include +#include +/*#include */ +#include "afsd.h" +#include "afsd_init.h" + + +char main_statusText[100]; +osi_log_t *afsd_logp; + +extern int traceOnPanic; +BOOL InitInstance(struct cmd_syndesc *as, char *arock); +extern int afs_shutdown; +int tried_shutdown=0; + +int afs_current_status = AFS_STATUS_INIT; + +/* + * Notifier function for use by osi_panic + */ +void afsd_notifier(char *msgp, char *filep, long line) +{ + char tbuffer[100]; + if (filep) + sprintf(tbuffer, "Error at file %s, line %d", filep, line); + else + strcpy(tbuffer, "Error at unknown location"); + + if (!msgp) + msgp = "Assertion failure"; + + /*MessageBox(NULL, tbuffer, msgp, MB_OK|MB_ICONSTOP|MB_SETFOREGROUND);*/ + + afsd_ForceTrace(TRUE); + + if (traceOnPanic) { + /*asm("int 3");*/ + } + + afs_exit(AFS_EXITCODE_PANIC); +} + +/* Init function called when window application starts. Inits instance and + * application together, since in Win32 they're essentially the same. + * + * Function then goes into a loop handling user interface messages. Most are + * used to handle redrawing the icon. + */ +int main(int argc, char *argv[]) +{ + struct cmd_syndesc *ts; + + fprintf(stderr, "AFS Client for Windows 95.\n"); + /*fprintf(stderr, "Use Ctrl-C to shut down client.\n\n\n");*/ + ts = cmd_CreateSyntax((char *) 0, (int (*)()) InitInstance, (char *) 0, "start AFS"); + cmd_AddParm(ts, "-lanadapt", CMD_SINGLE, CMD_OPTIONAL, "LAN adapter number"); + cmd_AddParm(ts, "-threads", CMD_SINGLE, CMD_OPTIONAL, "Number of server threads"); + cmd_AddParm(ts, "-rootvol", CMD_SINGLE, CMD_OPTIONAL, "name of AFS root volume"); + cmd_AddParm(ts, "-stat", CMD_SINGLE, CMD_OPTIONAL, "number of stat entries"); + cmd_AddParm(ts, "-memcache", CMD_FLAG, CMD_OPTIONAL, "use memory cache"); + cmd_AddParm(ts, "-cachedir", CMD_SINGLE, CMD_OPTIONAL, "cache directory"); + cmd_AddParm(ts, "-mountdir", CMD_SINGLE, CMD_OPTIONAL, "mount location"); + cmd_AddParm(ts, "-daemons", CMD_SINGLE, CMD_OPTIONAL, "number of daemons to use"); + cmd_AddParm(ts, "-nosettime", CMD_FLAG, CMD_OPTIONAL, "don't set the time"); + cmd_AddParm(ts, "-verbose", CMD_FLAG, CMD_OPTIONAL, "display lots of information"); + cmd_AddParm(ts, "-debug", CMD_FLAG, CMD_OPTIONAL, "display debug info"); + cmd_AddParm(ts, "-chunksize", CMD_SINGLE, CMD_OPTIONAL, "log(2) of chunk size"); + cmd_AddParm(ts, "-dcache", CMD_SINGLE, CMD_OPTIONAL, "number of dcache entries"); + cmd_AddParm(ts, "-confdir", CMD_SINGLE, CMD_OPTIONAL, "configuration directory"); + cmd_AddParm(ts, "-logfile", CMD_SINGLE, CMD_OPTIONAL, "Place to keep the CM log"); + cmd_AddParm(ts, "-waitclose", CMD_FLAG, CMD_OPTIONAL, "make close calls synchronous"); + cmd_AddParm(ts, "-shutdown", CMD_FLAG, CMD_OPTIONAL, "Shutdown all afs state"); + cmd_AddParm(ts, "-sysname", CMD_SINGLE, CMD_OPTIONAL, "System name (@sys value)"); + cmd_AddParm(ts, "-gateway", CMD_FLAG, CMD_OPTIONAL, "machine is a gateway"); + cmd_AddParm(ts, "-tracebuf", CMD_SINGLE, CMD_OPTIONAL, "trace buffer size"); + cmd_AddParm(ts, "-startup", CMD_FLAG, CMD_OPTIONAL, "start AFS client"); + cmd_AddParm(ts, "-diskcache", CMD_SINGLE, CMD_OPTIONAL, "diskcache size"); + + return (cmd_Dispatch(argc, argv)); +} + +/* initialize the process. Reads the init files to get the appropriate + * information. */ +void vxd_Shutdown(void); +int afsd_shutdown(int); +int shutdown_handler(int); + +BOOL InitInstance(struct cmd_syndesc *as, char *arock) +{ + long code; + char *reason; + +#ifdef DJGPP + osi_Init(); +#endif + +#ifndef DJGPP + osi_InitPanic(afsd_notifier); +#endif + + /*sleep(10);*/ + + afsi_start(); + + code = afsMsg_Init(); + if (code != 0) + osi_panic("socket failure", __FILE__, __LINE__); + + code = afsd_InitCM(&reason, as, arock); + if (code != 0) + osi_panic(reason, __FILE__, __LINE__); + + code = afsd_InitDaemons(&reason); + if (code != 0) + osi_panic(reason, __FILE__, __LINE__); + + code = afsd_InitSMB(&reason); + if (code != 0) + osi_panic(reason, __FILE__, __LINE__); + + signal(SIGINT, shutdown_handler); + + thrd_Yield(); /* give new threads a chance to run */ + + /* send message to GUI caller indicating successful init */ + afs_current_status = AFS_STATUS_RUNNING; + afsMsg_StatusChange(afs_current_status, 0, NULL); + +#ifdef DJGPP + /* Keep the process from just terminating */ + while(afs_shutdown == 0) + { + /*IOMGR_Sleep(180);*/ + IOMGR_Sleep(8); + /* workaround: WaitForKeystroke(nonzero num) calls + IOMGR_Select, though Win95 select works only on sockets */ + /* so, we poll instead */ + /*if (LWP_WaitForKeystroke(0)) + break;*/ + } + afsd_shutdown(0); +#endif + afs_exit(0); + + return (TRUE); +} + +int shutdown_handler(int x) +{ + if (!tried_shutdown) + { + fprintf(stderr, "This program should not be shut down manually. It should " + "be shut down by the\nWindows AFS Client Control Center. Press Ctrl-C " + "again if you really want to do this.\n"); + fflush(stderr); + tried_shutdown = 1; + } + else + { + fprintf(stderr, "Shutting down AFSD...\n"); + fflush(stderr); + afs_shutdown = 1; + } +} + +int afsd_shutdown(int x) +{ +#ifdef AFS_VXD + vxd_Shutdown(); +#else + smb_Shutdown(); +#endif + + fprintf(stderr, "AFSD shutdown complete.\n"); + /*exit(0);*/ +} + +void afs_exit(int exitCode) +{ + afs_current_status = AFS_STATUS_EXITING; + afsMsg_StatusChange(afs_current_status, + exitCode, NULL); + afsMsg_Shutdown(); + exit(exitCode); +} diff --git a/src/WINNT/afsd/afsd_init95.c b/src/WINNT/afsd/afsd_init95.c new file mode 100644 index 000000000..602255fa6 --- /dev/null +++ b/src/WINNT/afsd/afsd_init95.c @@ -0,0 +1,746 @@ +/* + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + */ + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include "afsd.h" +#include +#include +#include +#include +#include "cm_rpc.h" + +#define AFSDIR_CLIENT_ETC_DIRPATH "c:/" +#define AFSLOGFILE "afs.log" +#define CACHEINFOFILE "cache.info" + +extern int RXAFSCB_ExecuteRequest(); +extern int RXSTATS_ExecuteRequest(); + +osi_log_t *afsd_logp; + +char cm_rootVolumeName[64]; +DWORD cm_rootVolumeNameLen; +cm_volume_t *cm_rootVolumep = NULL; +cm_cell_t *cm_rootCellp = NULL; +cm_fid_t cm_rootFid; +cm_scache_t *cm_rootSCachep; +char cm_mountRoot[1024]; +DWORD cm_mountRootLen; +int cm_logChunkSize; +int cm_chunkSize; +int afs_diskCacheChunks; +char cm_cachePath[128]; +int cm_diskCacheEnabled = 0; + +int smb_UseV3; + +int LANadapter; +int lanAdaptSet = 0; +int rootVolSet = 0; +int cacheSetTime = TRUE; +int afsd_verbose = 0; +int chunkSize; + +int numBkgD; +int numSvThreads; + +int traceOnPanic = 0; + +int logReady = 0; + +char cm_HostName[200]; +long cm_HostAddr; + +/*char cm_CachePath[200];*/ +/*DWORD cm_CachePathLen;*/ +char cm_CacheInfoPath[1024]; +int cacheBlocks; +int sawCacheSize=0, sawDiskCacheSize=0, sawMountRoot=0; +int sawCacheBaseDir=0; +char cm_AFSLogFile[200]; +int afsd_CloseSynch = 0; +int afs_shutdown = 0; +char cm_confDir[200]; + +BOOL isGateway = FALSE; +BOOL reportSessionStartups = FALSE; + +int afsd_debug; +cm_initparams_v1 cm_initParams; + +/* + * AFSD Initialization Log + * + * This is distinct from the regular debug logging facility. + * Log items go directly to a file, not to an array in memory, so that even + * if AFSD crashes, the log can be inspected. + */ + +FILE *afsi_file; + +void +afsi_start() +{ + char wd[100]; + char t[100], u[100]; + int zilch; + int code; + time_t now; + char *p; + + afsi_file = NULL; + /*code = GetWindowsDirectory(wd, sizeof(wd)); + if (code == 0) return;*/ + strcpy (wd, "C:"); + strcat(wd, "\\afsd_init.log"); + /*GetTimeFormat(LOCALE_SYSTEM_DEFAULT, 0, NULL, NULL, t, sizeof(t));*/ + time (&now); + strcpy(t, asctime(localtime(&now))); + /*afsi_file = CreateFile(wd, GENERIC_WRITE, FILE_SHARE_READ, NULL, + CREATE_ALWAYS, FILE_FLAG_WRITE_THROUGH, NULL);*/ + /*afsi_file = open(wd, O_RDWR | O_CREAT | O_RSHARE);*/ + afsi_file = fopen(wd, "wt"); + setbuf(afsi_file, NULL); + + /*GetTimeFormat(LOCALE_SYSTEM_DEFAULT, 0, NULL, NULL, u, sizeof(u));*/ + time (&now); + strcpy(u, asctime(localtime(&now))); + p = strchr(u, '\n'); if (p) *p = 0; + p = strchr(u, '\r'); if (p) *p = 0; + strcat(t, ": Create log file\n"); + strcat(u, ": Created log file\n"); + /*WriteFile(afsi_file, t, strlen(t), &zilch, NULL); + WriteFile(afsi_file, u, strlen(u), &zilch, NULL);*/ + /*write(afsi_file, t, strlen(t)); + write(afsi_file, u, strlen(u));*/ + fputs(t, afsi_file); + fputs(u, afsi_file); +} + +void +afsi_log(char *pattern, ...) +{ + char s[100], t[100], u[100]; + int zilch; + time_t now; + va_list ap; +#ifndef DEBUG + return; +#endif + va_start(ap, pattern); + + vsprintf(s, pattern, ap); + /*GetTimeFormat(LOCALE_SYSTEM_DEFAULT, 0, NULL, NULL, t, sizeof(t));*/ + time(&now); + strcpy(t, asctime(localtime(&now))); + sprintf(u, "%s: %s\n", t, s); + if (afsi_file != NULL) + /* fputs(u, stderr); */ + fputs(u, afsi_file); + /*write(afsi_file, u, strlen(u));*/ + /*WriteFile(afsi_file, u, strlen(u), &zilch, NULL);*/ +} + +/* + * Standard AFSD trace + */ + +void afsd_ForceTrace(BOOL flush) +{ + FILE *handle; + int len; + char buf[100]; + + if (!logReady) return; + + /*len = GetTempPath(99, buf);*/ + /*strcpy(&buf[len], "/afsd.log");*/ + strcpy(buf, "c:/afsd.log"); + /*handle = CreateFile(buf, GENERIC_WRITE, FILE_SHARE_READ, + NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);*/ + /*handle = open(buf, O_RDWR | O_CREAT | O_RSHARE);*/ + handle = fopen(buf, "wt"); + if (handle == NULL) { + logReady = 0; + osi_panic("Cannot create log file", __FILE__, __LINE__); + } + osi_LogPrint(afsd_logp, handle); + if (flush) + fflush(handle); + /*FlushFileBuffers(handle);*/ + /*CloseHandle(handle);*/ + fclose(handle); +} + +/*------------------------------------------------------------------------------ + * ParseCacheInfoFile + * + * Description: + * Open the file containing the description of the workstation's AFS cache + * and pull out its contents. The format of this file is as follows: + * + * cm_mountRoot:cacheBaseDir:cacheBlocks + * + * Arguments: + * None. + * + * Returns: + * 0 if everything went well, + * 1 otherwise. + * + * Environment: + * Nothing interesting. + * + * Side Effects: + * Sets globals. + *---------------------------------------------------------------------------*/ + +int ParseCacheInfoFile() +{ + static char rn[]="ParseCacheInfoFile"; /*This routine's name*/ + FILE *cachefd; /*Descriptor for cache info file*/ + int parseResult; /*Result of our fscanf()*/ + int32 tCacheBlocks; + char tCacheBaseDir[1024], *tbd, tCacheMountDir[1024], *tmd; + /*char cacheBaseDir[1024]; /* cache in mem, this is ignored */ + + if (afsd_debug) + printf("%s: Opening cache info file '%s'...\n", + rn, cm_CacheInfoPath); + + cachefd = fopen(cm_CacheInfoPath, "r"); + if (!cachefd) { + printf("%s: Can't read cache info file '%s'\n", + rn, cm_CacheInfoPath); + return(1); + } + + /* + * Parse the contents of the cache info file. All chars up to the first + * colon are the AFS mount directory, all chars to the next colon are the + * full path name of the workstation cache directory and all remaining chars + * represent the number of blocks in the cache. + */ + tCacheMountDir[0] = tCacheBaseDir[0] = '\0'; + parseResult = fscanf(cachefd, + "%1024[^;];%1024[^;];%d", + tCacheMountDir, tCacheBaseDir, &tCacheBlocks); + + /* + * Regardless of how the parse went, we close the cache info file. + */ + fclose(cachefd); + + if (parseResult == EOF || parseResult < 3) { + printf("%s: Format error in cache info file!\n", + rn); + if (parseResult == EOF) + printf("\tEOF encountered before any field parsed.\n"); + else + printf("\t%d out of 3 fields successfully parsed.\n", + parseResult); + + printf("\tcm_mountRoot: '%s'\n\tcm_cachePath: '%s'\n\tcacheBlocks: %d\n", + cm_mountRoot, cm_cachePath, cacheBlocks); + return(1); + } + + for (tmd = tCacheMountDir; *tmd == '\n' || *tmd == ' ' || *tmd == '\t'; tmd++) ; + for (tbd = tCacheBaseDir; *tbd == '\n' || *tbd == ' ' || *tbd == '\t'; tbd++) ; + /* now copy in the fields not explicitly overridden by cmd args */ + if (!sawMountRoot) + { + strcpy(cm_mountRoot, tmd); + cm_mountRootLen = strlen(tmd); + } + if (!sawCacheBaseDir) + strcpy(cm_cachePath, tbd); + if (!sawCacheSize) + cacheBlocks = tCacheBlocks; + + if (afsd_debug) { + printf("%s: Cache info file successfully parsed:\n", + rn); + printf("\tcm_mountRoot: '%s'\n\tcm_cachePath: '%s'\n\tcacheBlocks: %d\n", + tmd, tbd, tCacheBlocks); + } + /*printf("cm_cachePath: %s\n", cm_cachePath);*/ + + /*PartSizeOverflow(tbd, cacheBlocks);*/ + + return(0); +} + +/* + * AFSD Initialization + */ + +int afsd_InitCM(char **reasonP, struct cmd_syndesc *as, char *arock) +{ + osi_uid_t debugID; + long cacheBlocks; + long cacheSize; + long logChunkSize; + long stats; + long traceBufSize; + long ltt, ltto; + char rootCellName[256]; + struct rx_service *serverp; + static struct rx_securityClass *nullServerSecurityClassp; + struct hostent *thp; + char *msgBuf; + char buf[200]; + DWORD dummyLen; + long code; + struct cmd_syndesc *ts; + char *afsconf_path; + long diskCacheSize; + /*WSADATA WSAjunk; + + WSAStartup(0x0101, &WSAjunk);*/ + +#ifndef DJGPP + /* setup osidebug server at RPC slot 1000 */ + osi_LongToUID(1000, &debugID); + code = osi_InitDebug(&debugID); + afsi_log("osi_InitDebug code %d", code); +// osi_LockTypeSetDefault("stat"); /* comment this out for speed * + if (code != 0) { + *reasonP = "unknown error"; + return -1; + } +#endif + + /* who are we ? */ + gethostname(cm_HostName, sizeof(cm_HostName)); +#ifdef DJGPP + /* For some reason, we may be getting space-padded hostnames. + If so, we take out the padding so that we can append -AFS later. */ + { + char *space = strchr(cm_HostName,' '); + if (space) *space = '\0'; + } +#endif + afsi_log("gethostname %s", cm_HostName); + thp = gethostbyname(cm_HostName); + memcpy(&cm_HostAddr, thp->h_addr_list[0], 4); + + /* seed random number generator */ + srand(ntohl(cm_HostAddr)); + + /* Get configuration parameters from command line */ + + /* call atoi on the appropriate parsed results */ + + if (!as->parms[20].items) { + /* -startup */ + fprintf(stderr, "Please do not run this program directly. Use the AFS Client Windows loader\nto start AFS.\n"); + exit(1); + } + + if (as->parms[0].items) { + /* -lanadapt */ + LANadapter = atoi(as->parms[0].items->data); + lanAdaptSet = 1; + afsi_log("LAN adapter number %d", LANadapter); + } + else + { + LANadapter = -1; + afsi_log("Default LAN adapter number"); + } + + if (as->parms[1].items) { + /* -threads */ + numSvThreads = atoi(as->parms[1].items->data); + afsi_log("%d server threads", numSvThreads); + } + else + { + numSvThreads = CM_CONFIGDEFAULT_SVTHREADS; + afsi_log("Defaulting to %d server threads", numSvThreads); + } + + if (as->parms[2].items) { + /* -rootvol */ + strcpy(cm_rootVolumeName, as->parms[2].items->data); + rootVolSet = 1; + afsi_log("Root volume %s", cm_rootVolumeName); + } + else + { + strcpy(cm_rootVolumeName, "root.afs"); + afsi_log("Default root volume name root.afs"); + } + + if (as->parms[3].items) { + /* -stat */ + stats = atoi(as->parms[3].items->data); + afsi_log("Status cache size %d", stats); + } + else + { + stats = CM_CONFIGDEFAULT_STATS; + afsi_log("Default status cache size %d", stats); + } + + if (as->parms[4].items) { + /* -memcache */ + /* no-op */ + } + + if (as->parms[5].items) { + /* -cachedir */ + /* no-op; cache is in memory, not mapped file */ + strcpy(cm_cachePath, as->parms[5].items->data); + sawCacheBaseDir = 1; + } + + if (as->parms[6].items) { + /* -mountdir */ + strcpy(cm_mountRoot, as->parms[6].items->data); + cm_mountRootLen = strlen(cm_mountRoot); + sawMountRoot = 1; + afsi_log("Mount root %s", cm_mountRoot); + } + else + { + strcpy(cm_mountRoot, "/afs"); + cm_mountRootLen = 4; + /* Don't log */ + } + + if (as->parms[7].items) { + /* -daemons */ + numBkgD = atoi(as->parms[7].items->data); + afsi_log("%d background daemons", numBkgD); + } + else + { + numBkgD = CM_CONFIGDEFAULT_DAEMONS; + afsi_log("Defaulting to %d background daemons", numBkgD); + } + + if (as->parms[8].items) { + /* -nosettime */ + cacheSetTime = FALSE; + } + + if (as->parms[9].items) { + /* -verbose */ + afsd_verbose = 1; + } + + if (as->parms[10].items) { + /* -debug */ + afsd_debug = 1; + afsd_verbose = 1; + } + + if (as->parms[11].items) { + /* -chunksize */ + chunkSize = atoi(as->parms[11].items->data); + if (chunkSize < 12 || chunkSize > 30) { + afsi_log("Invalid chunk size %d, using default", + logChunkSize); + logChunkSize = CM_CONFIGDEFAULT_CHUNKSIZE; + } + } else { + logChunkSize = CM_CONFIGDEFAULT_CHUNKSIZE; + afsi_log("Default chunk size %d", logChunkSize); + } + cm_logChunkSize = logChunkSize; + cm_chunkSize = 1 << logChunkSize; + + if (as->parms[12].items) { + /* -dcache */ + cacheSize = atoi(as->parms[12].items->data); + afsi_log("Cache size %d", cacheSize); + sawCacheSize = 1; + } + else + { + cacheSize = CM_CONFIGDEFAULT_CACHESIZE; + afsi_log("Default cache size %d", cacheSize); + } + + afsconf_path = getenv("AFSCONF"); + if (!afsconf_path) + strcpy(cm_confDir, AFSDIR_CLIENT_ETC_DIRPATH); + else + strcpy(cm_confDir, afsconf_path); + if (as->parms[13].items) { + /* -confdir */ + strcpy(cm_confDir, as->parms[13].items->data); + } + + sprintf(cm_CacheInfoPath, "%s/%s", cm_confDir, CACHEINFOFILE); + + sprintf(cm_AFSLogFile, "%s/%s", cm_confDir, AFSLOGFILE); + if (as->parms[14].items) { + /* -logfile */ + strcpy(cm_AFSLogFile, as->parms[14].items->data); + } + + if (as->parms[15].items) { + /* -waitclose */ + afsd_CloseSynch = 1; + } + + if (as->parms[16].items) { + /* -shutdown */ + afs_shutdown = 1; + /* + * Cold shutdown is the default + */ + printf("afsd: Shutting down all afs processes and afs state\n"); + /*call_syscall(AFSOP_SHUTDOWN, 1);*/ + exit(0); + } + + if (as->parms[17].items) { + /* -sysname */ + strcpy(cm_sysName, as->parms[17].items->data); + } + else + strcpy(cm_sysName, "i386_win95"); + + if (as->parms[18].items) { + /* -gateway */ + isGateway = 1; + afsi_log("Set for %s service", + isGateway ? "gateway" : "stand-alone"); + } + else + isGateway = 0; + + if (as->parms[19].items) { + /* -tracebuf */ + traceBufSize = atoi(as->parms[19].items->data); + afsi_log("Trace Buffer size %d", traceBufSize); + } + else + { + traceBufSize = CM_CONFIGDEFAULT_TRACEBUFSIZE; + afsi_log("Default trace buffer size %d", traceBufSize); + } + + if (as->parms[21].items) { + /* -diskcache */ + diskCacheSize = atoi(as->parms[21].items->data); + cm_diskCacheEnabled = 1; + afsi_log("Disk cache size %d K", diskCacheSize); + /*printf("Disk cache size %d K", diskCacheSize);*/ + sawDiskCacheSize = 1; + } + else + { + diskCacheSize = 50000; /*CM_CONFIGDEFAULT_DISKCACHESIZE;*/ + afsi_log("Default disk cache size %d", diskCacheSize); + } + + if (ParseCacheInfoFile()) { + exit(1); + } + + /* setup early variables */ + /* These both used to be configurable. */ + smb_UseV3 = 1; + buf_bufferSize = CM_CONFIGDEFAULT_BLOCKSIZE; + + /* turn from 1024 byte units into memory blocks */ + cacheBlocks = (cacheSize * 1024) / buf_bufferSize; + afs_diskCacheChunks = (diskCacheSize * 1024) / buf_bufferSize; + /*printf("afs_diskCacheChunks=%d\n", afs_diskCacheChunks);*/ + + /* + * Save client configuration for GetCacheConfig requests + */ + cm_initParams.nChunkFiles = 0; + cm_initParams.nStatCaches = stats; + cm_initParams.nDataCaches = 0; + cm_initParams.nVolumeCaches = 0; + cm_initParams.firstChunkSize = cm_chunkSize; + cm_initParams.otherChunkSize = cm_chunkSize; + cm_initParams.cacheSize = cacheSize; + cm_initParams.setTime = 0; + cm_initParams.memCache = 0; + + /* setup and enable debug log */ + afsd_logp = osi_LogCreate("afsd", traceBufSize); + afsi_log("osi_LogCreate log addr %x", afsd_logp); + osi_LogEnable(afsd_logp); + logReady = 1; + +#if 0 + /* get network related info */ + cm_noIPAddr = CM_MAXINTERFACE_ADDR; + code = syscfg_GetIFInfo(&cm_noIPAddr, + cm_IPAddr, cm_SubnetMask, + cm_NetMtu, cm_NetFlags); + + if ( (cm_noIPAddr <= 0) || (code <= 0 ) ) + afsi_log("syscfg_GetIFInfo error code %d", code); + else + afsi_log("First Network address %x SubnetMask %x", + cm_IPAddr[0], cm_SubnetMask[0]); +#endif + + /* initialize RX, and tell it to listen to port 7001, which is used for + * callback RPC messages. + */ + code = rx_Init(htons(7001)); + afsi_log("rx_Init code %x", code); + if (code != 0) { + *reasonP = "afsd: failed to init rx client on port 7001"; + return -1; + } + + /* Initialize the RPC server for session keys */ + /*RpcInit();*/ + + /* create an unauthenticated service #1 for callbacks */ + nullServerSecurityClassp = rxnull_NewServerSecurityObject(); + serverp = rx_NewService(0, 1, "AFS", &nullServerSecurityClassp, 1, + RXAFSCB_ExecuteRequest); + afsi_log("rx_NewService addr %x", serverp); + if (serverp == NULL) { + *reasonP = "unknown error"; + return -1; + } + + nullServerSecurityClassp = rxnull_NewServerSecurityObject(); + serverp = rx_NewService(0, RX_STATS_SERVICE_ID, "rpcstats", + &nullServerSecurityClassp, 1, RXSTATS_ExecuteRequest); + afsi_log("rx_NewService addr %x", serverp); + if (serverp == NULL) { + *reasonP = "unknown error"; + return -1; + } + + /* start server threads, *not* donating this one to the pool */ + rx_StartServer(0); + afsi_log("rx_StartServer"); + + /* init user daemon, and other packages */ + cm_InitUser(); + + cm_InitACLCache(2*stats); + + cm_InitConn(); + + cm_InitCell(); + + cm_InitServer(); + + cm_InitVolume(); + + cm_InitIoctl(); + + smb_InitIoctl(); + + cm_InitCallback(); + + cm_InitSCache(stats); + + code = cm_InitDCache(0, cacheBlocks); + + afsi_log("cm_InitDCache code %x", code); + if (code != 0) { + *reasonP = "error initializing cache"; + return -1; + } + + code = cm_GetRootCellName(rootCellName); + afsi_log("cm_GetRootCellName code %d rcn %s", code, + (code ? "" : rootCellName)); + if (code != 0) { + *reasonP = "can't find root cell name in ThisCell"; + return -1; + } + + cm_rootCellp = cm_GetCell(rootCellName, CM_FLAG_CREATE); + afsi_log("cm_GetCell addr %x", cm_rootCellp); + if (cm_rootCellp == NULL) { + *reasonP = "can't find root cell in CellServDB"; + return -1; + } + + return 0; +} + +int afsd_InitDaemons(char **reasonP) +{ + long code; + cm_req_t req; + + cm_InitReq(&req); + + /* this should really be in an init daemon from here on down */ + + code = cm_GetVolumeByName(cm_rootCellp, cm_rootVolumeName, cm_rootUserp, &req, CM_FLAG_CREATE, &cm_rootVolumep); + afsi_log("cm_GetVolumeByName code %x root vol %x", code, + (code ? 0xffffffff : cm_rootVolumep)); + if (code != 0) { + *reasonP = "can't find root volume in root cell"; + return -1; + } + + /* compute the root fid */ + cm_rootFid.cell = cm_rootCellp->cellID; + cm_rootFid.volume = cm_GetROVolumeID(cm_rootVolumep); + cm_rootFid.vnode = 1; + cm_rootFid.unique = 1; + + code = cm_GetSCache(&cm_rootFid, &cm_rootSCachep, cm_rootUserp, &req); + afsi_log("cm_GetSCache code %x scache %x", code, + (code ? 0xffffffff : cm_rootSCachep)); + if (code != 0) { + *reasonP = "unknown error"; + return -1; + } + + cm_InitDaemon(numBkgD); + afsi_log("cm_InitDaemon"); + + return 0; +} + +int afsd_InitSMB(char **reasonP) +{ + char hostName[200]; + char *ctemp; + + /* Do this last so that we don't handle requests before init is done. + * Here we initialize the SMB listener. + */ + strcpy(hostName, cm_HostName); + ctemp = strchr(hostName, '.'); /* turn ntdfs.* into ntdfs */ + if (ctemp) *ctemp = 0; + hostName[11] = 0; /* ensure that even after adding the -A, we + * leave one byte free for the netbios server + * type. + */ + strcat(hostName, "-AFS"); + strupr(hostName); + smb_Init(afsd_logp, hostName, smb_UseV3, LANadapter, numSvThreads); + afsi_log("smb_Init"); + + return 0; +} diff --git a/src/WINNT/afsd/afsmsg95.c b/src/WINNT/afsd/afsmsg95.c new file mode 100644 index 000000000..5abec8c24 --- /dev/null +++ b/src/WINNT/afsd/afsmsg95.c @@ -0,0 +1,119 @@ +/* + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + */ + +/* This file contains functions used by the Windows 95 (DJGPP) AFS client + to communicate with the startup executable. */ + +#include +#include +#include +#include + +#include "afs/afsmsg95.h" + +int sock; +struct sockaddr_in addr; +extern int errno; + +int afsMsg_Init() +{ + int rc; + struct sockaddr_in myaddr; + + sock = socket(AF_INET, SOCK_DGRAM, 0); + if (sock < 0) + return -1; + + addr.sin_addr.s_addr = htonl(0x7f000001); /* 127.0.0.1 */ + addr.sin_family = AF_INET; + addr.sin_port = htons(AFS_MSG_PORT); + + myaddr.sin_addr.s_addr = INADDR_ANY; + myaddr.sin_family = AF_INET; + myaddr.sin_port = 0; + + rc = bind(sock, (struct sockaddr *) &myaddr, sizeof(myaddr)); +#ifdef DEBUG + fprintf(stderr, "afsMsg_Init: bind sock %d rc=%d\n", sock, rc); +#endif + + return 0; +} + +int afsMsg_StatusChange(int status, int exitCode, char *string) +{ + afsMsg_statChange_t *msgP; + int rc; + int slen = 0; + char msgBuf[AFS_MAX_MSG_LEN]; + int now; + + msgP = (afsMsg_statChange_t *) msgBuf; + + msgP->hdr.msgtype = AFS_MSG_STATUS_CHANGE; + + msgP->newStatus = status; + msgP->exitCode = exitCode; + + if (string) + { + slen = strlen(string); /* one extra for NULL */ + if (slen > AFS_MAX_MSG_LEN - sizeof(afsMsg_statChange_t)) + slen = AFS_MAX_MSG_LEN - sizeof(afsMsg_statChange_t); + strncpy(&msgP->message, string, slen); + } + + msgP->hdr.length = sizeof(afsMsg_statChange_t) + slen; + + rc = sendto(sock, msgP, msgP->hdr.length, 0, (struct sockaddr *) &addr, + sizeof(addr)); + /*rc = send(sock, &msg, msg.hdr.length, 0);*/ + time(&now); +#ifdef DEBUG + fprintf(stderr, "%s: sent status change %d to sock %d length %d size=%d errno=%d\n", + asctime(localtime(&now)), status, + sock, msgP->hdr.length, rc, (rc < 0 ? errno:0)); +#endif + fflush(stdout); + + return rc; +} + +int afsMsg_Print(char *str, int level) +{ + afsMsg_print_t *msgP; + int rc; + char msgBuf[AFS_MAX_MSG_LEN]; + int slen; + + slen = strlen(str); /* one extra for NULL */ + if (slen > AFS_MAX_MSG_LEN - sizeof(afsMsg_statChange_t)) + slen = AFS_MAX_MSG_LEN - sizeof(afsMsg_statChange_t); + strncpy(&msgP->message, str, slen); + + msgP->hdr.msgtype = AFS_MSG_PRINT; + msgP->hdr.length = sizeof(afsMsg_hdr_t) + slen; + msgP->debugLevel = level; + strcpy(&msgP->message, str); + + rc = sendto(sock, msgP, msgP->hdr.length, 0, (struct sockaddr *) &addr, + sizeof(addr)); + return rc; +} + +int afsMsg_Shutdown() +{ + int rc; + rc = close(sock); + if (rc < 0) fprintf(stderr, "error closing socket, rc=%d\n", rc); +#ifdef DEBUG + else fprintf(stderr, "socket closed\n"); +#endif + fflush(stderr); +} diff --git a/src/WINNT/afsd/afsmsg95.h b/src/WINNT/afsd/afsmsg95.h new file mode 100644 index 000000000..57f14933a --- /dev/null +++ b/src/WINNT/afsd/afsmsg95.h @@ -0,0 +1,40 @@ +#ifndef _AFSMSG_H +#define _AFSMSG_H + +#define AFS_MSG_PORT 2020 + +#define AFS_MAX_MSG_LEN 512 + +typedef struct _afsMsg_hdr { + int msgtype; + int length; +} afsMsg_hdr_t; + +#define AFS_MSG_STATUS_CHANGE 1 +#define AFS_MSG_PRINT 2 + +typedef struct _afsMsg_statChange { + afsMsg_hdr_t hdr; + int oldStatus; + int newStatus; + int exitCode; + char message; +} afsMsg_statChange_t; + +#define AFS_STATUS_NOSTATUS -1 +#define AFS_STATUS_INIT 1 +#define AFS_STATUS_RUNNING 2 +#define AFS_STATUS_EXITING 3 + +#define AFS_EXITCODE_NORMAL 0 +#define AFS_EXITCODE_PANIC 2 +#define AFS_EXITCODE_NETWORK_FAILURE 3 +#define AFS_EXITCODE_GENERAL_FAILURE 100 + +typedef struct _afsMsg_print { + afsMsg_hdr_t hdr; + int debugLevel; + char message; +} afsMsg_print_t; + +#endif diff --git a/src/WINNT/afsd/afsrpc95.h b/src/WINNT/afsd/afsrpc95.h new file mode 100644 index 000000000..a763f574e --- /dev/null +++ b/src/WINNT/afsd/afsrpc95.h @@ -0,0 +1,22 @@ +#ifndef AFSRPC_H +#define AFSRPC_H + +/* Copied from declaration of GUID in RPCDCE.H */ +typedef struct afs_uuid { + unsigned long Data1; + unsigned short Data2; + unsigned short Data3; + unsigned char Data4[8]; +} afs_uuid_t; + +long AFSRPC_SetToken( + afs_uuid_t uuid, + unsigned char sessionKey[8] +); + +long AFSRPC_GetToken( + afs_uuid_t uuid, + unsigned char sessionKey[8] +); + +#endif diff --git a/src/WINNT/afsd/cm_diskcache95.c b/src/WINNT/afsd/cm_diskcache95.c new file mode 100644 index 000000000..a1263bbd2 --- /dev/null +++ b/src/WINNT/afsd/cm_diskcache95.c @@ -0,0 +1,760 @@ +/* + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + */ + +/* This code is experimental persistent disk cache support for the + Windows 95/DJGPP AFS client. It uses synchronous I/O and assumes + non-preemptible threads (which is the case in DJGPP), so it has + no locking. */ + + +#ifdef DISKCACHE95 + +#include +#include +#include +#include +#include +#include + +#include "afsd.h" + +cm_diskcache_t **diskHashTable; /* pointers to hash chains */ +Queue diskLRUList; +Queue openFileList; +cm_diskcache_t *diskCBBuf; + +extern int afs_diskCacheChunks; +/*extern int cm_diskCacheChunkSize;*/ +extern long buf_bufferSize; +long cm_diskCacheChunkSize; +extern char cm_cachePath[]; +extern int cm_cachePathLen; +extern int cm_diskCacheEnabled; + +int cacheInfo_fd; +int accessOrd = 0; /* monotonically increasing access ordinal */ +int updates = 0; +int afs_dhashsize = 2048; +int openCacheFiles = 0; + +char cacheInfoPath[128]; +char cacheFileName[128]; + +extern int errno; + +#define MAX_OPEN_FILES 22 + +/* internal functions */ +void diskcache_WriteCacheInfo(cm_diskcache_t *dcp); +int diskcache_New(); +cm_diskcache_t *diskcache_Find(cm_fid_t *fid, int chunk); +cm_diskcache_t *diskcache_Alloc(cm_fid_t *fid, int chunk, int dataVersion); +int diskcache_Read(cm_diskcache_t *dcp, char *buf, int size); +int diskcache_Write(cm_diskcache_t *dcp, char *buf, int size); + +#define complain printf + +#define OFFSET_TO_CHUNK(a) (LargeIntegerDivideByLong((a), cm_diskCacheChunkSize)) +#define GEN_CACHE_DIR_NAME(name, path, i) \ + sprintf(name, "%s\\D%07d", cm_cachePath, (i) / CACHE_FILES_PER_DIR) +#define GEN_CACHE_FILE_NAME(name, path, i) \ + sprintf(name, "%s\\D%07d\\C%07d", path, (i) / CACHE_FILES_PER_DIR, \ + (i) % CACHE_FILES_PER_DIR) + +/* Initialize the disk cache */ +int diskcache_Init() +{ + int i; + int rc; + int fd; + int invalid; + int index; + char *chunkBuf; + char tmpBuf[512]; + struct stat cacheInfoStat, chunkStat; + cm_cacheInfoHdr_t hdr; + cm_diskcache_t *dcp; + int validCount = 0; + + if (!cm_diskCacheEnabled) + return 0; + + cm_diskCacheChunkSize = buf_bufferSize; + if (cm_diskCacheChunkSize % buf_bufferSize != 0) + { + complain("Error: disk cache chunk size %d not a multiple of buffer size %d\n", + cm_diskCacheChunkSize, buf_bufferSize); + return CM_ERROR_INVAL; + } + + /* alloc mem for chunk file control blocks */ + diskCBBuf = (cm_diskcache_t *) malloc(afs_diskCacheChunks * sizeof(cm_diskcache_t)); + if (diskCBBuf == NULL) + return CM_ERROR_SPACE; + memset(diskCBBuf, 0, afs_diskCacheChunks * sizeof(cm_diskcache_t)); + + /* alloc mem for hash table pointers */ + diskHashTable = (cm_diskcache_t **) malloc(afs_dhashsize * sizeof(cm_diskcache_t *)); + if (diskHashTable == NULL) + return CM_ERROR_SPACE; + memset(diskHashTable, 0, afs_dhashsize*sizeof(cm_diskcache_t *)); + + QInit(&diskLRUList); + QInit(&openFileList); + + /*sprintf(cacheInfoPath, "%s\\%s", cm_cachePath, CACHE_INFO_FILE);*/ + memset(cacheInfoPath, 0, 128); + DPRINTF("cm_cachePath=%s\n", cm_cachePath); + strncpy(cacheInfoPath, cm_cachePath, 50); + strcat(cacheInfoPath, "\\"); + strcat(cacheInfoPath, CACHE_INFO_FILE); + DPRINTF("cacheInfoPath=%s\n", cacheInfoPath); + + cacheInfo_fd = open(cacheInfoPath, O_RDWR | O_BINARY); + + if (cacheInfo_fd < 0) + { + /* file not present */ + return diskcache_New(); /* initialize new empty disk cache */ + } + + /* get stat of cache info file */ + rc = fstat(cacheInfo_fd, &cacheInfoStat); + + /* Check for valid header in cache info file */ + rc = read(cacheInfo_fd, &hdr, sizeof(cm_cacheInfoHdr_t)); + if (rc < sizeof(cm_cacheInfoHdr_t) || + hdr.magic != CACHE_INFO_MAGIC) + /*hdrp = (cm_cacheInfoHdr_t *) tmpBuf;*/ + { + close(cacheInfo_fd); + return diskcache_New(); + } + + if (hdr.chunks != afs_diskCacheChunks || + hdr.chunkSize != cm_diskCacheChunkSize) + { + /* print error message saying params don't match */ + return CM_ERROR_INVAL; + } + + chunkBuf = (char *) malloc(cm_diskCacheChunkSize); + if (chunkBuf == NULL) + return CM_ERROR_SPACE; + + /* read metadata from cache info file into control blocks */ + /* reconstruct hash chains based on fid, chunk */ + for (i = 0; i < afs_diskCacheChunks; i++) + { /* for all cache chunks */ + if (i % 500 == 0) + { + printf("%d...", i); + fflush(stdout); + } + dcp = &diskCBBuf[i]; + dcp->refCount = 0; + rc = read(cacheInfo_fd, &dcp->f, sizeof(struct fcache)); + if (rc < sizeof(struct fcache)) + { + /* print error message about reading cache info file */ + /* this isn't the right error code for a read error */ + return CM_ERROR_INVAL; + } + + if (dcp->f.index != i) + return CM_ERROR_INVAL; /* index should match position in cache info file */ + + /* Try to open cache file. This chunk will be invalidated if we can't + find the file, the file is newer than the cache info file, the file + size doesn't match the cache info file, or the file's header is + invalid. */ + GEN_CACHE_FILE_NAME(cacheFileName, cm_cachePath, i); +#if 1 + /*fd = open(cacheFileName, O_RDWR | O_BINARY); + if (fd < 0) invalid = 1; + else + { + rc = fstat(fd, &chunkStat);*/ + rc = stat(cacheFileName, &chunkStat); + + if (rc < 0) invalid = 1; + /*else if (cacheInfoStat.st_mtime < chunkStat.st_mtime + 120) invalid = 1;*/ + else if (cacheInfoStat.st_mtime < chunkStat.st_mtime) invalid = 1; + /*else if (cacheInfoStat.st_mtime < dcp->f.modTime + 120) invalid = 1;*/ + else if (cacheInfoStat.st_mtime < dcp->f.modTime) invalid = 1; + else if (cm_diskCacheChunkSize != chunkStat.st_size || + dcp->f.chunkBytes != chunkStat.st_size) invalid = 1; + /*else + {*/ + /*rc = read(fd, chunkBuf, cm_diskCacheChunkSize); + if (rc < 0) invalid = 1;*/ + + /*else + { + cacheFileHdrP = (cm_cacheFileHdr_t *) chunkBuf; + if (cacheFileHdrP->magic != CACHE_FILE_MAGIC || + cacheFileHdrP->index != i) + { + invalid = 1; + } + }*/ + /*}*/ + /*}*/ +#else + invalid = 0; +#endif + + if (invalid == 0) + { + /* Cache file seems to be valid */ + + validCount++; + DPRINTF("Found fid/chunk=%08x-%08x-%08x-%08x/%04d in slot=%d dcp=%x\n", + dcp->f.fid.cell, dcp->f.fid.volume, dcp->f.fid.vnode, + dcp->f.fid.unique, dcp->f.chunk, i, dcp); + /* Put control block in hash table */ + index = DCHash(&dcp->f.fid, dcp->f.chunk); + /*osi_QAdd(&diskHashTable[index], &dcp->f.hashq);*/ + + /* add to head of hash list. (we should probably look at + ord here instead. use queues?) */ + dcp->hash_next = diskHashTable[index]; + dcp->hash_prev = NULL; + if (diskHashTable[index]) diskHashTable[index]->hash_prev = dcp; + diskHashTable[index] = dcp; + + /* Add to LRU queue in access time order (lowest at tail) */ + QAddOrd(&diskLRUList, &dcp->lruq, dcp->f.accessOrd); + + close(fd); + } + else + { + /* Cache file is invalid */ + + /* Create the cache file with correct size */ + memset(chunkBuf, 0, cm_diskCacheChunkSize); + /*cacheFileHdrP->magic = CACHE_FILE_MAGIC; + cacheFileHdrP->index = i;*/ + + if (fd != 0) close(fd); + /* Note that if the directory this file is supposed to be in doesn't + exist, the creat call will fail and we will return an error. */ + /*fd = creat(cacheFileName, S_IRUSR|S_IWUSR);*/ + fd = open(cacheFileName, O_RDWR | O_BINARY | O_CREAT | O_TRUNC, + S_IRUSR | S_IWUSR); + if (fd < 0) return CM_ERROR_INVAL; /* couldn't create file */ + rc = write(fd, chunkBuf, cm_diskCacheChunkSize); + if (rc < 0) /* ran out of space? */ + return CM_ERROR_INVAL; + close(fd); + + /* We consider an invalid chunk as empty, so we put it at tail of LRU */ + memset(dcp, 0, sizeof(cm_diskcache_t)); + dcp->f.accessOrd = 0; + dcp->f.states = DISK_CACHE_EMPTY; + dcp->f.index = i; + dcp->f.chunkBytes = cm_diskCacheChunkSize; + /*osi_QAdd(diskLRUList, &dcp->lruq);*/ + QAddOrd(&diskLRUList, &dcp->lruq, dcp->f.accessOrd); /* head is LRU */ + + /* write out cache info modifications */ + lseek(cacheInfo_fd, -sizeof(struct fcache), SEEK_CUR); + write(cacheInfo_fd, &dcp->f, sizeof(struct fcache)); + } + } /* for all cache chunks */ + + free(chunkBuf); + /*close(cacheInfo_fd);*/ + fprintf(stderr, "\nFound %d of %d valid %d-byte blocks\n", validCount, + afs_diskCacheChunks, cm_diskCacheChunkSize); + + return 0; +} + +/* create empty disk cache files */ +/* assumes tables have already been malloc'd by diskcache_Init */ +int diskcache_New() +{ + int i; + int rc; + int fd; + int invalid; + int index; + /*char cacheInfoPath[256]; + char cacheFileName[256];*/ + char dirName[256]; + char *chunkBuf; + struct stat cacheInfoStat, chunkStat; + cm_cacheInfoHdr_t hdr; + cm_diskcache_t *dcp; + + sprintf(cacheInfoPath, "%s\\%s", cm_cachePath, CACHE_INFO_FILE); + /*cacheInfo_fd = creat(cacheInfoPath, S_IRUSR | S_IWUSR);*/ + cacheInfo_fd = open(cacheInfoPath, O_RDWR | O_BINARY | O_CREAT | O_TRUNC, + S_IRUSR | S_IWUSR); + if (cacheInfo_fd < 0) + { + complain("diskcache_New: Error creating cache info file in cache directory %s\n", + cm_cachePath); + return CM_ERROR_INVAL; + } + + /* write valid header */ + hdr.magic = CACHE_INFO_MAGIC; + hdr.chunks = afs_diskCacheChunks; + hdr.chunkSize = cm_diskCacheChunkSize; + rc = write(cacheInfo_fd, (char *) &hdr, sizeof(cm_cacheInfoHdr_t)); + if (rc < 0) + return CM_ERROR_INVAL; + + chunkBuf = (char *) malloc(cm_diskCacheChunkSize); + if (chunkBuf == NULL) + return CM_ERROR_SPACE; + memset(chunkBuf, 0, cm_diskCacheChunkSize); + + for (i = 0; i < afs_diskCacheChunks; i++) + { /* for all cache chunks */ + if (i % 500 == 0) + { + printf("%d...", i); + fflush(stdout); + } + + dcp = &diskCBBuf[i]; + + dcp->refCount = 0; + /* $$$: init mutex mx */ + memset(dcp, 0, sizeof(cm_diskcache_t)); + dcp->f.accessOrd = 0; + dcp->f.index = i; + dcp->f.states = DISK_CACHE_EMPTY; + dcp->f.chunkBytes = cm_diskCacheChunkSize; + QAddT(&diskLRUList, &dcp->lruq, dcp->f.accessOrd); /* head is LRU */ + rc = write(cacheInfo_fd, &dcp->f, sizeof(struct fcache)); + + if (i % CACHE_FILES_PER_DIR == 0) + { + GEN_CACHE_DIR_NAME(dirName, cm_cachePath, i); + rc = mkdir(dirName, S_IRUSR | S_IWUSR); + if (rc < 0 && errno != EEXIST) + { + complain("diskcache_New: Couldn't create cache directory %s\n", dirName); + return CM_ERROR_INVAL; + } + } + + GEN_CACHE_FILE_NAME(cacheFileName, cm_cachePath, i); + /*fd = creat(cacheFileName, S_IRUSR | S_IWUSR);*/ + fd = open(cacheFileName, O_RDWR | O_BINARY | O_CREAT | O_TRUNC, + S_IRUSR | S_IWUSR); + if (fd < 0) + { + if (errno == ENOSPC) + complain("diskcache_New: Not enough space in cache path to create file %s\n", + cacheFileName); + else + complain("diskcache_New: Couldn't create cache file %s\n", cacheFileName); + return CM_ERROR_INVAL; + } + + /*fileHdr.magic = CACHE_FILE_MAGIC; + fileHdr.index = i; + rc = write(fd, &fileHdr, sizeof(cm_cacheFileHdr_t)); /* maybe we should write + a full block? */ + /*if (rc == 0) + {*/ + rc = write(fd, chunkBuf, cm_diskCacheChunkSize); + /*}*/ + + if (rc < 0) + { + if (errno == ENOSPC) + complain("diskcache_New: Not enough space in cache path to write to file %s\n", + cacheFileName); + else + complain("diskcache_New: Couldn't write to cache file %s\n", + cacheFileName); + return CM_ERROR_INVAL; + } + + close(fd); + } /* for all cache chunks */ + + free(chunkBuf); + + /*close(cacheInfo_fd);*/ + + return 0; +} + +/* Get chunk from the cache or allocate a new chunk */ +int diskcache_Get(cm_fid_t *fid, osi_hyper_t *offset, char *buf, int size, int *dataVersion, int *dataCount, cm_diskcache_t **dcpRet) +{ + cm_diskcache_t *dcp; + int rc; + int chunk; + + + if (!cm_diskCacheEnabled) + { + *dcpRet = NULL; + return 0; + } + + chunk = OFFSET_TO_CHUNK(*offset); /* chunk number */ + + DPRINTF("diskcache_Get: fid/chunk=%08x-%08x-%08x-%08x/%04d\n", + fid->cell, fid->volume, fid->vnode, fid->unique, chunk); + + dcp = diskcache_Find(fid, chunk); + if (dcp != NULL) + { + rc = diskcache_Read(dcp, buf, size); + *dataVersion = dcp->f.dataVersion; /* update caller's data version */ + if (rc < 0) + return -1; + else + *dataCount = rc; + } + else + { + dcp = diskcache_Alloc(fid, chunk, *dataVersion); + if (dcp == NULL) + return -1; + } + + if (++updates >= CACHE_INFO_UPDATES_PER_WRITE) + { + updates = 0; + diskcache_WriteCacheInfo(dcp); /* update cache info for this slot */ + } + + *dcpRet = dcp; + /*printf("diskcache_Get: returning dcp=%x\n", dcp);*/ + return 0; +} + + +/* Look for a file chunk in the cache */ +cm_diskcache_t *diskcache_Find(cm_fid_t *fid, int chunk) +{ + int index; + cm_diskcache_t *dcp; + cm_diskcache_t *prev; + + index = DCHash(fid, chunk); + dcp = diskHashTable[index]; + prev = NULL; + + while (dcp != NULL) + { + if (cm_FidCmp(&dcp->f.fid, fid) == 0 && chunk == dcp->f.chunk) + { + dcp->f.accessOrd = accessOrd++; + /* Move it to the beginning of the list */ + if (diskHashTable[index] != dcp) + { + assert(dcp->hash_prev->hash_next == dcp); + dcp->hash_prev->hash_next = dcp->hash_next; + if (dcp->hash_next) + { + assert(dcp->hash_next->hash_prev == dcp); + dcp->hash_next->hash_prev = dcp->hash_prev; + } + dcp->hash_next = diskHashTable[index]; + dcp->hash_prev = NULL; + if (diskHashTable[index]) diskHashTable[index]->hash_prev = dcp; + diskHashTable[index] = dcp; + } + break; + } + prev = dcp; + dcp = dcp->hash_next; + } + + if (dcp) + DPRINTF("diskcache_Find: fid/chunk=%08x-%08x-%08x-%08x/%04d slot=%d hash=%d dcp=%x\n", + fid->cell, fid->volume, fid->vnode, fid->unique, chunk, dcp->f.index, index, dcp); + else + DPRINTF("diskcache_Find: fid/chunk=%08x/%04d not found\n", + fid->unique, chunk); + + return dcp; +} + +int diskcache_Read(cm_diskcache_t *dcp, char *buf, int size) +{ + char cacheFileName[256]; + int fd; + int rc; + int opened = 0; + + GEN_CACHE_FILE_NAME(cacheFileName, cm_cachePath, dcp->f.index); + + DPRINTF("diskcache_Read: filename=%s dcp=%x\n", cacheFileName, + dcp); + + /* For reads, we will use the fd if already open, but we won't leave + the file open. Note that if we use async I/O, we will need to + do locking to prevent someone from closing the file while I/O + is going on. But for now, all I/O is synchronous, and threads + are non-preemptible. */ + + if (dcp->openfd == 0) + { + fd = open(cacheFileName, O_RDWR | O_BINARY); + if (fd < 0) + { + complain("diskcache_Read: Couldn't open cache file %s\n", cacheFileName); + return -1; + } + opened = 1; + } + else + fd = dcp->openfd; + + if (fd < 0) + { + complain("diskcache_Read: Couldn't open cache file %s\n", cacheFileName); + return -1; + } + + rc = read(fd, buf, size); + if (rc < 0) + { + complain("diskcache_Read: Couldn't read cache file %s\n", cacheFileName); + close(fd); return -1; + } + + if (opened) + close(fd); /* close it if we opened it */ + return rc; /* bytes read */ +} + +/* Write out buffer to disk */ +int diskcache_Update(cm_diskcache_t *dcp, char *buf, int size, int dataVersion) +{ + if (!cm_diskCacheEnabled) + return 0; + + DPRINTF("diskcache_Update dcp=%x, dataVersion=%d\n", dcp, dataVersion); + diskcache_Write(dcp, buf, size); + /*diskcache_SetMRU(dcp);*/ + dcp->f.dataVersion = dataVersion; + /*dcp->f.accessOrd = accessOrd++;*/ + /*QMoveToTail(&diskLRUList, &dcp->lruq, dcp->f.accessOrd);*/ + + if (++updates >= CACHE_INFO_UPDATES_PER_WRITE) + { + updates = 0; + diskcache_WriteCacheInfo(dcp); /* update cache info */ + } + return 0; +} + +/* Allocate a new chunk file control block for this fid/chunk */ +cm_diskcache_t *diskcache_Alloc(cm_fid_t *fid, int chunk, int dataVersion) +{ + cm_diskcache_t *dcp; + QLink* q; + int index; + int stole=0, stolen_chunk, stolen_fid_unique; + + /* Remove LRU elt. (head) from free list */ + q = QServe(&diskLRUList); + if (q == NULL) + dcp = NULL; + else + dcp = (cm_diskcache_t *) MEM_TO_OBJ(cm_diskcache_t, lruq, q); + if (dcp == NULL) + { + DPRINTF("diskcache_Alloc: fid/chunk=%08x/%04d allocation failed\n", + fid->unique, chunk); + return NULL; + } + + /* Use this element for this fid/chunk */ + if (dcp->f.states == DISK_CACHE_USED) + { + /* Remove from old hash chain */ + if (dcp->hash_prev) + { + assert(dcp->hash_prev->hash_next == dcp); + dcp->hash_prev->hash_next = dcp->hash_next; + } + else + { + index = DCHash(&dcp->f.fid, dcp->f.chunk); + diskHashTable[index] = dcp->hash_next; + } + if (dcp->hash_next) + { + assert(dcp->hash_next->hash_prev == dcp); + dcp->hash_next->hash_prev = dcp->hash_prev; + } + + stole = 1; + stolen_chunk = dcp->f.chunk; + stolen_fid_unique = dcp->f.fid.unique; + } + + memcpy(&dcp->f.fid, fid, sizeof(cm_fid_t)); + dcp->f.chunk = chunk; + dcp->f.dataVersion = dataVersion; + dcp->f.accessOrd = accessOrd++; + dcp->f.states = DISK_CACHE_USED; + + /* allocate at head of new hash chain */ + index = DCHash(fid, chunk); + /*osi_QAddH(&diskHashTable[index], &dcp->hashq);*/ + dcp->hash_next = diskHashTable[index]; + dcp->hash_prev = NULL; + if (diskHashTable[index]) diskHashTable[index]->hash_prev = dcp; + diskHashTable[index] = dcp; + + /* put at tail of queue */ + QAddT(&diskLRUList, &dcp->lruq, dcp->f.accessOrd); + + if (stole) + DPRINTF("diskcache_Alloc: fid/chunk=%08x/%04d (recyc fid/chunk=%08x/%04d) " + "slot=%d hash=%d dcp=%x\n", + fid->unique, chunk, stolen_fid_unique, stolen_chunk, + dcp->f.index, index, dcp); + else + DPRINTF("diskcache_Alloc: fid/chunk=%08x/%04d slot=%d hash=%d dcp=%x\n", + fid->unique, chunk, dcp->f.index, index, dcp); + return dcp; +} + +/* Write this chunk to its disk file */ +int diskcache_Write(cm_diskcache_t *dcp, /*int bufferNum,*/ char *buf, int size) +{ + char cacheFileName[256]; + int fd; + int rc; + int opened = 0; + QLink *q; + + /*return 0;*/ + + DPRINTF("diskcache_Write\n"); + + /* write bytes of buf into chunk file */ + GEN_CACHE_FILE_NAME(cacheFileName, cm_cachePath, dcp->f.index); + if (dcp->openfd == 0) + { + dcp->openfd = open(cacheFileName, O_RDWR | O_BINARY); + if (dcp->openfd < 0) + { + dcp->openfd = 0; + complain("diskcache_Write: Couldn't open cache file %s\n", cacheFileName); + return -1; + } + opened = 1; + } + + /*lseek(dcp->openfd, bufferNum * buf_bufferSize, SEEK_SET);*/ + /* only write size bytes */ + rc = write(dcp->openfd, buf, size); + if (rc < 0) + { + complain("diskcache_Write: Couldn't write cache file %s\n", cacheFileName); + close(dcp->openfd); dcp->openfd = 0; return rc; + } + + if (opened) + { + /* add to open file list */ + QAddT(&openFileList, &dcp->openq, 0); + openCacheFiles++; + } + else + QMoveToTail(&openFileList, &dcp->openq, 0); + + if (openCacheFiles >= MAX_OPEN_FILES) + { + /* close longest-open file */ + q = QServe(&openFileList); + dcp = (cm_diskcache_t *) MEM_TO_OBJ(cm_diskcache_t, openq, q); + assert(dcp != NULL); + if (dcp->openfd > 0) + close(dcp->openfd); + dcp->openfd = 0; + openCacheFiles--; + } + + return 0; +} + +/* we accessed this chunk (hit on buffer read), so move to MRU */ +void diskcache_Touch(cm_diskcache_t *dcp) +{ + if (!cm_diskCacheEnabled || !dcp) return; + dcp->f.accessOrd = accessOrd++; + QMoveToTail(&diskLRUList, &dcp->lruq, dcp->f.accessOrd); /* tail is MRU */ +} + +/* invalidate this disk cache entry */ +int diskcache_Invalidate(cm_diskcache_t *dcp) +{ + /* We consider an invalid chunk as empty, so we put it at tail of LRU */ + QRemove(&diskLRUList, &dcp->lruq); + + dcp->f.accessOrd = 0; + dcp->f.states = DISK_CACHE_EMPTY; + dcp->f.chunk = 0; + memset(&dcp->f.fid, sizeof(cm_fid_t)); + /*osi_QAdd(diskLRUList, &dcp->lruq);*/ + QAddH(&diskLRUList, &dcp->lruq, dcp->f.accessOrd); /* head is LRU */ +} + +void diskcache_WriteCacheInfo(cm_diskcache_t *dcp) +{ + /*char cacheInfoPath[256]; + int cacheInfo_fd;*/ + int rc; + + /*return; /* skip this for perf. testing */ + /*sprintf(cacheInfoPath, "%s\\%s", cm_cachePath, CACHE_INFO_FILE); + cacheInfo_fd = open(cacheInfoPath, O_RDWR);*/ + + DPRINTF("diskcache_WriteCacheInfo\n"); + + lseek(cacheInfo_fd, dcp->f.index * sizeof(struct fcache) + + sizeof(cm_cacheInfoHdr_t), SEEK_SET); + + rc = write(cacheInfo_fd, &dcp->f, sizeof(struct fcache)); + if (rc < 0) + complain("diskcache_WriteCacheInfo: Couldn't write cache info file, error=%d\n", errno); + /*fsync(cacheInfo_fd);*/ + + /*close(cacheInfo_fd);*/ +} + +void diskcache_Shutdown() +{ + cm_diskcache_t *dcp; + QLink *q; + + /* close cache info file */ + close (cacheInfo_fd); + + /* close all open cache files */ + q = QServe(&openFileList); + while (q) + { + dcp = (cm_diskcache_t *) MEM_TO_OBJ(cm_diskcache_t, openq, q); + if (dcp->openfd) + close(dcp->openfd); + q = QServe(&openFileList); + } +} + +#endif /* DISKCACHE95 */ diff --git a/src/WINNT/afsd/cm_diskcache95.h b/src/WINNT/afsd/cm_diskcache95.h new file mode 100644 index 000000000..f8721e0f0 --- /dev/null +++ b/src/WINNT/afsd/cm_diskcache95.h @@ -0,0 +1,81 @@ +/* + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + */ + +#ifndef CM_DISKCACHE_H +#define CM_DISKCACHE_H + +#include "queue95.h" + +#define DCHash(v, c) ((((v)->vnode + (v)->volume + (c))) & (afs_dhashsize-1)) + +#define CACHE_INFO_FILE "cacheInfo" + +#define CACHE_INFO_MAGIC 0x34564321 +#define CACHE_FILE_MAGIC 0x78931230 +#define CACHE_FILES_PER_DIR 1000 +#define CACHE_INFO_UPDATES_PER_WRITE 1 + +#define DPRINTF if (0) printf + +/* kept on disk and in dcache entries */ +struct fcache { + cm_fid_t fid; /* Fid for this file */ + int32 modTime; /* last time this entry was modified */ + /*afs_hyper_t versionNo; /* Associated data version number */ + int dataVersion; + int chunk; /* Relative chunk number */ + int chunkBytes; /* Num bytes in this chunk */ + char states; /* Has this chunk been modified? */ + int accessOrd; /* change to 64 bit later */ +#define DISK_CACHE_EMPTY 0 +#define DISK_CACHE_USED 1 + int index; /* absolute chunk number */ + int checksum; + /*char pad[464]; /* pad up to 512 bytes */ +}; + +/* in-memory chunk file control block */ +typedef struct cm_diskcache { + struct fcache f; + + /*osi_queue_t lruq; + osi_queue_t hashq;*/ + QLink lruq; + QLink openq; + int openfd; /* open file descriptor */ + struct cm_diskcache *hash_next; + struct cm_diskcache *hash_prev; + int refCount; + osi_mutex_t mx; +} cm_diskcache_t; + +typedef struct cm_cacheInfoHdr { + int magic; + int chunks; /* total chunks in cache */ + int chunkSize; + char pad[500]; /* pad up to 512 bytes */ +} cm_cacheInfoHdr_t; + +typedef struct cm_cacheFileHdr { + int magic; + int index; +} cm_cacheFileHdr_t; + +/* external functions */ + +/* Initialize the disk cache */ +int diskcache_Init(); +/* Get chunk from the cache or allocate a new chunk */ +int diskcache_Get(cm_fid_t *fid, osi_hyper_t *offset, char *buf, int size, int *dataVersion, int *dataCount, cm_diskcache_t **dcpRet); +/* Write out buffer to disk */ +int diskcache_Update(cm_diskcache_t *dcp, char *buf, int size, int dataVersion); +/* we accessed this chunk, so move to MRU */ +void diskcache_Touch(cm_diskcache_t *dcp); + +#endif /* CM_DISKCACHE_H */ diff --git a/src/WINNT/afsd/cm_rpc95.h b/src/WINNT/afsd/cm_rpc95.h new file mode 100644 index 000000000..0b5a63bd8 --- /dev/null +++ b/src/WINNT/afsd/cm_rpc95.h @@ -0,0 +1,31 @@ +/* + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + */ + +#ifndef __CM_RPC_H__ +#define __CM_RPC_H__ + +/* Copied from declaration of GUID in RPCDCE.H */ +typedef struct afs_uuid { + unsigned long Data1; + unsigned short Data2; + unsigned short Data3; + unsigned char Data4[8]; +} afs_uuid_t; + +long AFSRPC_SetToken( + afs_uuid_t uuid, + unsigned char sessionKey[8] +); + +long AFSRPC_GetToken( + afs_uuid_t uuid, + unsigned char sessionKey[8] +); + +#endif /* __CM_RPC_H__ */ diff --git a/src/WINNT/afsd/dosdefs95.h b/src/WINNT/afsd/dosdefs95.h new file mode 100644 index 000000000..5c14377d5 --- /dev/null +++ b/src/WINNT/afsd/dosdefs95.h @@ -0,0 +1,55 @@ +#ifndef DOSDEFS_H +#define DOSDEFS_H + +/* dos_ptr is the phys. addr. accepted by farpeek/farpoke functions, i.e., + dos_ptr = segment * 16 + offset */ +#define dos_ptr unsigned long + +/* get/set structure member of a struct in DOS memory */ +#define get_dos_member_b(T, ptr, memb) _farpeekb(_dos_ds, (ptr) + (dos_ptr)&(((T*)0)->memb)) +#define get_dos_member_w(T, ptr, memb) _farpeekw(_dos_ds, (ptr) + (dos_ptr)&(((T*)0)->memb)) +#define get_dos_member_l(T, ptr, memb) _farpeekl(_dos_ds, (ptr) + (dos_ptr)&(((T*)0)->memb)) + +#define set_dos_member_b(T, ptr, memb, val) \ + _farpokeb(_dos_ds, (ptr) + (dos_ptr)&(((T*)0)->memb), val) +#define set_dos_member_w(T, ptr, memb, val) \ + _farpokew(_dos_ds, (ptr) + (dos_ptr)&(((T*)0)->memb), val) +#define set_dos_member_l(T, ptr, memb, val) \ + _farpokel(_dos_ds, (ptr) + (dos_ptr)&(((T*)0)->memb), val) + +typedef struct _filetime +{ + unsigned int dwLowDateTime; + unsigned int dwHighDateTime; +} FILETIME; + +#define FILE_ACTION_ADDED 0x00000001 +#define FILE_ACTION_REMOVED 0x00000002 +#define FILE_ACTION_MODIFIED 0x00000003 +#define FILE_ACTION_RENAMED_OLD_NAME 0x00000004 +#define FILE_ACTION_RENAMED_NEW_NAME 0x00000005 + +#define FILE_NOTIFY_CHANGE_FILE_NAME 0x00000001 +#define FILE_NOTIFY_CHANGE_DIR_NAME 0x00000002 +#define FILE_NOTIFY_CHANGE_ATTRIBUTES 0x00000004 +#define FILE_NOTIFY_CHANGE_SIZE 0x00000008 +#define FILE_NOTIFY_CHANGE_LAST_WRITE 0x00000010 +#define FILE_NOTIFY_CHANGE_LAST_ACCESS 0x00000020 +#define FILE_NOTIFY_CHANGE_CREATION 0x00000040 +#define FILE_NOTIFY_CHANGE_SECURITY 0x00000100 + +#define ULONG unsigned long +#define USHORT unsigned short +#define WCHAR wchar_t + +#define GetTickCount gettime_ms +#define GetCurrentTime gettime_ms + +#define lstrcpy strcpy +#define strcmpi stricmp +#define lstrlen strlen +#define _stricmp stricmp +#define _strlwr strlwr +#define _strupr strupr + +#endif diff --git a/src/WINNT/afsd/dosutils95.c b/src/WINNT/afsd/dosutils95.c new file mode 100644 index 000000000..298491695 --- /dev/null +++ b/src/WINNT/afsd/dosutils95.c @@ -0,0 +1,294 @@ +/* + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + */ + +/* functions for DJGPP to write to DOS memory or duplicate Win32 functions. */ + +#include +#include +#include +#include +#include "dosdefs95.h" + +#define MIN(a, b) ((a) < (b) ? (a) : (b)) + +dos_memset(dos_ptr offset, int val, int size) +{ + int i; + + for (i = 0; i < size; i++) + { + _farpokeb(_dos_ds, offset++, val); + } +} + +char *dos_strcpy_get(char *str, unsigned int offset) +{ + register char a; + + while ((a = _farpeekb(_dos_ds, offset++)) != 0) + *str++ = a; + *str = 0; + + return str; +} + +char *dos_strncpy_get(char *str, unsigned int offset, int len) +{ + register char a; + register int n=0; + + while ((a = _farpeekb(_dos_ds, offset++)) != 0 && n++ < len) + *str++ = a; + *str = 0; + + return str; +} + +dos_ptr dos_strcpy_put(dos_ptr offset, char *str) +{ + char a; + + while ((a = *str++) != 0) + _farpokeb(_dos_ds, offset++, a); + _farpokeb(_dos_ds, offset, 0); + + return offset; +} + +dos_ptr dos_strncpy_put(dos_ptr offset, char *str, int len) +{ + register char a; + register int n=0; + + while ((a = *str++) != 0 && n++ < len) + _farpokeb(_dos_ds, offset++, a); + _farpokeb(_dos_ds, offset, 0); + + return offset; +} + +dos_ptr dos_strrchr(dos_ptr offset, char c) +{ + dos_ptr temp = 0; + char a; + + while ((a = _farpeekb(_dos_ds, offset++)) != 0) + { + if (a == c) temp = offset-1; + } + + return temp; +} + +int dos_strcmp(unsigned char *str, dos_ptr offset) +{ + register unsigned char a, b; + + while (((a = *str++) == (b = _farpeekb(_dos_ds, offset++))) && a && b); + return a-b; +} + +int dos_strncmp(unsigned char *str, dos_ptr offset, int len) +{ + register unsigned char a, b; + register int i=0; + + while (i++ < len && ((a = *str++) == (b = _farpeekb(_dos_ds, offset++))) && a && b); + return a-b; +} + +int dos_strlen(dos_ptr offset) +{ + int len=0; + + while (_farpeekb(_dos_ds, offset++)) + len++; + + return len; +} + + +int sub_time(struct timeval a, struct timeval b) +{ + int n = a.tv_sec - b.tv_sec; + n *= 1000000; + n += a.tv_usec - b.tv_usec; + return n / 1000; +} + +int tm_to_ms(struct timeval t) +{ + int n = t.tv_sec * 1000; + n += t.tv_usec / 1000; + return n; +} + +int gettime_ms() +{ + struct timeval t; + int n = t.tv_sec * 1000; + + gettimeofday(&t, NULL); + n += t.tv_usec / 1000; + return n; +} + +int gettime_us() +{ + struct timeval t; + int n; + + gettimeofday(&t, NULL); + n = t.tv_sec * 1000000; + n += t.tv_usec; + return n; +} + +int GetPrivateProfileString(char *sect, char *key, char *def, + char *buf, int len, char *file) +{ + char s[256]; + char skey[128]; + int nchars=0; + int amt; + int offset; + char sectstr[256]; + char *p; + FILE *f = fopen(file, "r"); + if (!f) return 0; + + sprintf(sectstr, "[%s]", sect); + while (1) + { + fgets(s, 256, f); + if (feof(f)) break; + + /* look for section names */ + if (s[0] != '[') + continue; + + /* if sect is NULL, copy all section names */ + if (!sect) + { + amt = MIN(strlen(s)+1, len-1); + strncpy(buf, s, amt-1); + buf[amt] = 0; + len -= amt; + buf += amt; + nchars += amt; + continue; + } + + /* continue if non-matching section name */ + if (sect && strnicmp(s+1, sect, strlen(sect)) != 0) + continue; + + /* else we have the correct section */ + + while (len > 0) + { + fgets(s, 256, f); + if (feof(f)) break; + + /* get the key part */ + strcpy(skey, s); + p = strrchr(skey, '='); + if (!p) { fclose(f); return 0; } + *p = 0; + + /* continue if key doesn't match */ + if (key && stricmp(skey, key) != 0) + continue; + + /* if NULL key, copy key names */ + if (!key) + { + amt = MIN(strlen(skey)+1, len-2); + strncpy(buf, skey, amt); + buf[amt] = 0; + buf[amt+1] = 0; /* final trailing NULL */ + len -= amt; + buf += amt; + nchars += amt; + continue; + } + + /* discard key= and newline */ + offset = strlen(key) + 1; + amt = MIN(strlen(s+offset)-1, len-1); + strncpy(buf, s+offset, amt); + buf[amt] = 0; + len -= amt; + buf += amt; + nchars += amt; + } + } + + if (nchars == 0) + { + if (def) + { + strcpy(buf, def); + nchars = strlen(def); + } + } + + fclose(f); + return nchars; +} + +int WritePrivateProfileString(char *sect, char *key, char *str, char *file) +{ + char tmpfile[256], s[256], sectstr[256]; + int found = 0; + char *p; + FILE *fr = fopen(file, "r"); + FILE *fw = fopen(tmpfile, "w"); + + strcpy(tmpfile, file); + p = strrchr(tmpfile, '.'); + *p = 0; + strcat(tmpfile, ".tmp"); /* change extension to .tmp */ + + sprintf(sectstr, "[%s]", sect); + while (1) + { + fgets(s, 256, fr); + if (feof(fr)) break; + + fputs(s, fw); + + /* look for section names */ + if (found || s[0] != '[') + { + continue; + } + + if (stricmp(s, sectstr) == 0) + { + /* found section, print new item */ + found = 1; + strcpy(s, key); + strcat(s, "="); + strcat(s, str); + strcat(s, "\n"); + fputs(s, fw); + } + } + fclose(fw); + fclose(fr); + + /* delete old file */ + remove(file); + + /* rename .tmp */ + rename(tmpfile, file); + + return found; +} diff --git a/src/WINNT/afsd/largeint95.c b/src/WINNT/afsd/largeint95.c new file mode 100644 index 000000000..19c2c4e90 --- /dev/null +++ b/src/WINNT/afsd/largeint95.c @@ -0,0 +1,217 @@ +/* + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + */ + +/* Large integer support for DJGPP */ + +#include +#include "largeint95.h" + +LARGE_INTEGER LargeIntegerAdd(LARGE_INTEGER a, LARGE_INTEGER b) +{ + LARGE_INTEGER c; + long long *c1 = (long long *) &c; + long long *a1 = (long long *) &a; + long long *b1 = (long long *) &b; + *c1 = *a1 + *b1; + return c; +} + +LARGE_INTEGER LargeIntegerSubtract(LARGE_INTEGER a, LARGE_INTEGER b) +{ + LARGE_INTEGER c; + long long *c1 = (long long *) &c; + long long *a1 = (long long *) &a; + long long *b1 = (long long *) &b; + *c1 = *a1 - *b1; + return c; +} + +LARGE_INTEGER ConvertLongToLargeInteger(unsigned long a) +{ + LARGE_INTEGER n; + + n.LowPart = a; + n.HighPart = 0; + return n; +} + +LARGE_INTEGER LargeIntegerMultiplyLongByLong(unsigned long a, unsigned long b) +{ + LARGE_INTEGER c; + long long *c1 = (long long *) &c; + + *c1 = (long long) a * (long long) b; + return c; +} + +LARGE_INTEGER LargeIntegerMultiplyByLong(LARGE_INTEGER a, unsigned long b) +{ + LARGE_INTEGER c; + long long *c1 = (long long *) &c; + long long *a1 = (long long *) &a; + + *c1 = *a1 * (long long) b; + return c; +} + +unsigned long LargeIntegerDivideByLong(LARGE_INTEGER a, unsigned long b) +{ + lldiv_t q; + long long *a1 = (long long *) &a; + + q = lldiv(*a1, (long long) b); + return (unsigned long) q.quot; +} + +#if 0 +LARGE_INTEGER LargeIntegerAdd(LARGE_INTEGER a, LARGE_INTEGER b) +{ + LARGE_INTEGER c; + + c.LowPart = a.LowPart + b.LowPart; + c.HighPart = a.HighPart + b.HighPart; + + /* not sure how to do a real carry */ + if (c.LowPart < a.LowPart) + c.HighPart++; + + return c; +} + +LARGE_INTEGER LargeIntegerSubtract(LARGE_INTEGER a, LARGE_INTEGER b) +{ + LARGE_INTEGER c; + + c.LowPart = a.LowPart - b.LowPart; + c.HighPart = a.HighPart - b.HighPart; + + /* borrow */ + if (c.LowPart > a.LowPart) + c.HighPart--; + + return c; +} + +__inline__ unsigned long mult32(unsigned long a, unsigned long b, + unsigned long *ov) +{ + unsigned long p, o; + + /* multiply low part and save the overflow bits */ + __asm__ __volatile__ ("movl %2, %%eax\n + mull %3, %%eax\n + movl %%eax, %0\n + movl %%edx, %1" + : "=g" (p), "=g" (o) + : "g" (a), "g" (b) + : "ax", "dx", "memory" + ); + *ov = o; + return p; +} + +__inline__ unsigned long div32(unsigned long a, unsigned long b, + unsigned long *rem) +{ + unsigned long q, r; + + /* multiply low part and save the overflow bits */ + __asm__ __volatile__ ("movl %2, %%eax\n + divl %3, %%eax\n + movl %%eax, %0\n + movl %%edx, %1" + : "=g" (q), "=g" (r) + : "g" (a), "g" (b) + : "ax", "dx", "memory" + ); + *rem = r; + return q; +} + +LARGE_INTEGER LargeIntegerMultiplyLongByLong(unsigned long a, unsigned long b) +{ + LARGE_INTEGER prod; + + prod.LowPart = mult32(a, b, &prod.HighPart); + return prod; +} + +LARGE_INTEGER LargeIntegerMultiplyByLong(LARGE_INTEGER a, unsigned long b) +{ + LARGE_INTEGER prod; + unsigned long x, prodl, prodh, ovl, ovh; + + /* multiply low part and save the overflow bits */ + prod.LowPart = mult32(a.LowPart, b, &ovl); + + /* multiply high part */ + prod.HighPart = mult32(a.HighPart, b, &ovh); + + /* add overflow from low part */ + prod.HighPart += ovl; + + return prod; +} + +unsigned long LargeIntegerDivideByLong(LARGE_INTEGER a, unsigned long b, unsigned long *rem) +{ + unsigned long n, r, q; + LARGE_INTEGER t; + + if (b == 0) { return 0; } + if (b == 1) { *rem = 0; return a.LowPart; } + + n = div32(a.LowPart, b, &r); + if (a.HighPart == 0) + { + *rem = r; + return n; + } + else + { + q = div32(0xffffffff-b+1, b, &r); + q++; + n += q * a.HighPart; + n += LargeIntegerDivideByLong(LargeIntegerMultiplyLongByLong(r, a.HighPart), b, rem); + return n; + } +} +#endif + +#if 0 +int LargeIntegerGreaterThan(LARGE_INTEGER a, LARGE_INTEGER b) +{ + if (a.HighPart > b.HighPart) return 1; + else if (a.HighPart == b.HighPart && a.LowPart > b.LowPart) return 1; + else return 0; +} + +int LargeIntegerGreaterThanOrEqualTo(LARGE_INTEGER a, LARGE_INTEGER b) +{ + if (a.HighPart > b.HighPart) return 1; + else if (a.HighPart == b.HighPart && a.LowPart >= b.LowPart) return 1; + else return 0; +} + +int LargeIntegerEqualTo(LARGE_INTEGER a, LARGE_INTEGER b) +{ + if (a.HighPart == b.HighPart && a.LowPart == b.LowPart) return 1; + else return 0; +} + +int LargeIntegerGreaterOrEqualToZero(LARGE_INTEGER a) +{ + return ((a.HighPart & 0x8fffffff) ? 0 : 1); +} + +int LargeIntegerLessThanZero(LARGE_INTEGER a) +{ + return ((a.HighPart & 0x8fffffff) ? 1 : 0); +} +#endif diff --git a/src/WINNT/afsd/largeint95.h b/src/WINNT/afsd/largeint95.h new file mode 100644 index 000000000..f55b4118e --- /dev/null +++ b/src/WINNT/afsd/largeint95.h @@ -0,0 +1,45 @@ +#ifndef LARGEINT_H +#define LARGEINT_H + +typedef struct { + unsigned long LowPart; + unsigned long HighPart; +} LARGE_INTEGER; + +LARGE_INTEGER LargeIntegerAdd(LARGE_INTEGER a, LARGE_INTEGER b); +LARGE_INTEGER LargeIntegerSubtract(LARGE_INTEGER a, LARGE_INTEGER b); +/*int LargeIntegerGreaterThan(LARGE_INTEGER a, LARGE_INTEGER b); +int LargeIntegerGreaterThanOrEqualTo(LARGE_INTEGER a, LARGE_INTEGER b); +int LargeIntegerEqualTo(LARGE_INTEGER a, LARGE_INTEGER b); +int LargeIntegerGreaterOrEqualToZero(LARGE_INTEGER a); +int LargeIntegerLessThanZero(LARGE_INTEGER a);*/ +LARGE_INTEGER ConvertLongToLargeInteger(unsigned long a); +LARGE_INTEGER LargeIntegerMultiplyByLong(LARGE_INTEGER a, unsigned long b); +unsigned long LargeIntegerDivideByLong(LARGE_INTEGER a, unsigned long b); + +#define LargeIntegerGreaterThan(a, b) \ + ((a).HighPart > (b).HighPart || \ + ((a).HighPart == (b).HighPart && (a).LowPart > (b).LowPart)) + +#define LargeIntegerGreaterThanOrEqualTo(a, b) \ + ((a).HighPart > (b).HighPart || \ + ((a).HighPart == (b).HighPart && (a).LowPart >= (b).LowPart)) + +#define LargeIntegerLessThan(a, b) \ + ((a).HighPart < (b).HighPart || \ + ((a).HighPart == (b).HighPart && (a).LowPart < (b).LowPart)) + +#define LargeIntegerLessThanOrEqualTo(a, b) \ + ((a).HighPart < (b).HighPart || \ + ((a).HighPart == (b).HighPart && (a).LowPart <= (b).LowPart)) + +#define LargeIntegerEqualTo(a, b) \ + ((a).HighPart == (b).HighPart && (a).LowPart == (b).LowPart) + +#define LargeIntegerGreaterOrEqualToZero(a) ((a).HighPart >= 0) + +#define LargeIntegerLessThanZero(a) ((a).HighPart < 0) + +#define LargeIntegerNotEqualToZero(a) ((a).HighPart || (a).LowPart) + +#endif diff --git a/src/WINNT/afsd/netbios95.c b/src/WINNT/afsd/netbios95.c new file mode 100644 index 000000000..bc86a3c60 --- /dev/null +++ b/src/WINNT/afsd/netbios95.c @@ -0,0 +1,71 @@ +/* + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + */ + +/* Netbios function for DJGPP: calls interrupt 5Ch for Netbios function. + NCB and buffer space must be in DOS memory (below 1MB). */ + +#include +#include +#include +#include +#include "dosdefs95.h" +#include "netbios95.h" + +extern int handler_seg, handler_off; + +int Netbios(NCB *Ncb, dos_ptr dos_ncb) +{ + __dpmi_regs regs; + int asynch = 1; + dos_ptr oldncb_buffer; + +#if 1 + if (Ncb->ncb_command == NCBRESET || + Ncb->ncb_command == NCBCANCEL || + Ncb->ncb_command == NCBUNLINK || + Ncb->ncb_command == NCBADDNAME || + Ncb->ncb_command == NCBENUM || + Ncb->ncb_command == NCBDELNAME) /* temp */ + asynch = 0; +#else + if (1) + asynch = 0; +#endif + else + /* set to asynchronous */ + Ncb->ncb_command |= ASYNCH; + + /* adjust ncb_buffer pointer to be a segment:zero-offset pointer + for __dpmi_int */ + oldncb_buffer = Ncb->ncb_buffer; + Ncb->ncb_buffer = Ncb->ncb_buffer << 12; + + /*if (asynch) + Ncb->ncb_post = (handler_seg << 16) | handler_off;*/ + + /* copy to DOS space */ + dosmemput(Ncb, sizeof(NCB), dos_ncb); + + /* set address of NCB in registers */ + memset(®s, 0, sizeof(regs)); + regs.d.ebx = 0; + regs.x.ds = regs.x.es = dos_ncb/16; + + __dpmi_int(0x5c,®s); + /*dosmemget(__tb, sizeof(NCB), Ncb);*/ + + if (asynch) + IOMGR_NCBSelect(Ncb, dos_ncb, NULL); + + /* undo the change to ncb_buffer */ + Ncb->ncb_buffer = oldncb_buffer; + + return regs.x.ax; +} + diff --git a/src/WINNT/afsd/netbios95.h b/src/WINNT/afsd/netbios95.h new file mode 100644 index 000000000..5fd7e66d4 --- /dev/null +++ b/src/WINNT/afsd/netbios95.h @@ -0,0 +1,124 @@ +/* + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + */ + +#ifndef NETBIOS_H +#define NETBIOS_H + +#define BYTE char +#define WORD short + +#define NCBNAMSZ 16 /* absolute length of a net name */ +#define MAX_LANA 254 /* lana's in range 0 to MAX_LANA inclusive */ + +#define MAX_COMPUTERNAME_LENGTH 15 + + +#define UCHAR unsigned char +#define PUCHAR unsigned char * +#define WORD short + +#include "osithrd95.h" + +typedef struct _NCB { + UCHAR ncb_command; + UCHAR ncb_retcode; + UCHAR ncb_lsn; + UCHAR ncb_num; + unsigned int ncb_buffer; + WORD ncb_length; + UCHAR ncb_callname[NCBNAMSZ]; + UCHAR ncb_name[NCBNAMSZ]; + UCHAR ncb_rto; + UCHAR ncb_sto; + int (*ncb_post)(); + UCHAR ncb_lana_num; + UCHAR ncb_cmd_cplt; + UCHAR ncb_reserve[10]; + UCHAR ncb_reserve2[4]; + EVENT_HANDLE ncb_event; +} NCB, *PNCB; + +/* this struct is returned by NCBENUM command in Win32 but is not available + in DJGPP. */ +typedef struct { + int length; + int lana[8]; +} LANA_ENUM; + + +#define NCBCALL 0x10 +#define NCBLISTEN 0x11 +#define NCBHANGUP 0x12 +#define NCBSEND 0x14 +#define NCBRECV 0x15 +#define NCBRECVANY 0x16 +#define NCBCHAINSEND 0x17 +#define NCBDGSEND 0x20 +#define NCBDGRECV 0x21 +#define NCBDGSENDBC 0x22 +#define NCBDGRECVBC 0x23 +#define NCBADDNAME 0x30 +#define NCBDELNAME 0x31 +#define NCBRESET 0x32 +#define NCBASTAT 0x33 +#define NCBSSTAT 0x34 +#define NCBCANCEL 0x35 +#define NCBADDGRNAME 0x36 +#define NCBENUM 0x37 +#define NCBUNLINK 0x70 +#define NCBSENDNA 0x71 +#define NCBCHAINSENDNA 0x72 +#define NCBLANSTALERT 0x73 +#define NCBACTION 0x77 +#define NCBFINDNAME 0x78 +#define NCBTRACE 0x79 +#define ASYNCH 0x80 + + +#define NRC_GOODRET 0x00 +#define NRC_BUFLEN 0x01 +#define NRC_ILLCMD 0x03 +#define NRC_CMDTMO 0x05 +#define NRC_INCOMP 0x06 +#define NRC_BADDR 0x07 +#define NRC_SNUMOUT 0x08 +#define NRC_NORES 0x09 +#define NRC_SCLOSED 0x0a +#define NRC_CMDCAN 0x0b +#define NRC_DUPNAME 0x0d +#define NRC_NAMTFUL 0x0e +#define NRC_ACTSES 0x0f +#define NRC_LOCTFUL 0x11 +#define NRC_REMTFUL 0x12 +#define NRC_ILLNN 0x13 +#define NRC_NOCALL 0x14 +#define NRC_NOWILD 0x15 +#define NRC_INUSE 0x16 +#define NRC_NAMERR 0x17 +#define NRC_SABORT 0x18 +#define NRC_NAMCONF 0x19 +#define NRC_IFBUSY 0x21 +#define NRC_TOOMANY 0x22 +#define NRC_BRIDGE 0x23 +#define NRC_CANOCCR 0x24 +#define NRC_CANCEL 0x26 +#define NRC_DUPENV 0x30 +#define NRC_ENVNOTDEF 0x34 +#define NRC_OSRESNOTAV 0x35 +#define NRC_MAXAPPS 0x36 +#define NRC_NOSAPS 0x37 +#define NRC_NORESOURCES 0x38 +#define NRC_INVADDRESS 0x39 +#define NRC_INVDDID 0x3B +#define NRC_LOCKFAIL 0x3C +#define NRC_OPENERR 0x3f +#define NRC_SYSTEM 0x40 +#define NRC_PENDING 0xff + +#endif /* NETBIOS_H */ diff --git a/src/WINNT/afsd/queue95.c b/src/WINNT/afsd/queue95.c new file mode 100644 index 000000000..06f64547c --- /dev/null +++ b/src/WINNT/afsd/queue95.c @@ -0,0 +1,165 @@ +/* + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + */ + +/* queue.c + * + * Generic queue for use with Windows 95/DJGPP disk cache + * + ************************************************************************/ + +#ifdef DISKCACHE95 + +#define NULL 0 +#include "queue95.h" +#include + +void QInit(Queue *queue) +{ + queue->head = NULL; + queue->tail = NULL; + queue->currpos = NULL; +} + +void QAddT(Queue *queue, QLink* node, int ord) +{ + /*QLink* node = new QLink;*/ + + /*node->item = x;*/ + node->ord = ord; + node->next = NULL; + node->prev = NULL; + if (!queue->tail) + queue->head = queue->tail = node; + else { + queue->tail->next = node; + queue->tail = node; + node->prev = queue->tail; + } + queue->size++; +} + +void QAddH(Queue *queue, QLink *node, int ord) +{ + node->ord = ord; + node->next = NULL; + node->prev = NULL; + if (!queue->head) + queue->head = queue->tail = node; + else { + node->next = queue->head; + queue->head->prev = node; + queue->head = node; + } + queue->size++; +} + +void QAddOrd(Queue *queue, QLink *node, int ord) +{ + /*QLink* node = new QLink;*/ + QLink* p, *prev; + + node->ord = ord; + node->next = NULL; + node->prev = NULL; + if (!queue->tail) + queue->head = queue->tail = node; + else { + p = queue->head; + while (p && ord >= p->ord) { /* add towards tail end if equals found */ + prev = p; + p = p->next; + } + if (p == queue->head) { + QAddH(queue, node, ord); + } + else if (p == NULL) { + QAddT(queue, node, ord); + } + else { + node->next = p; + node->prev = prev; + prev->next = node; + } + } + queue->size++; +} + +QLink* QServe(Queue *queue) +{ + QLink *n = queue->head; + + if (!queue->head) return NULL; + if (queue->head == queue->tail) + queue->head = queue->tail = NULL; + else + queue->head = n->next; + queue->size--; + return n; +} + +void QMoveToTail(Queue *queue, QLink *n, int ord) +{ + QRemove(queue, n); + QAddT(queue, n, ord); +} + +void QRemove(Queue *queue, QLink *n) +{ + /*QLink* n2 = NULL;*/ + + if (!queue->head) return; + /*while(n && n != x) { + n2 = n; + n = n->next; + }*/ + if (n == queue->currpos) { + if (n == queue->head) queue->currpos = n->next; + if (n == queue->tail) queue->currpos = n->prev; + if (n->prev) queue->currpos = n->prev; + } + + if (n->prev) + { + /*assert(n->prev->next == n);*/ + n->prev->next = n->next; + } + else + queue->head = n->next; + + if (n->next) + { + /*assert(n->next->prev == n);*/ + n->next->prev = n->prev; + } + else + queue->tail = n->prev; + + queue->size--; +} + +QLink *QCurrent(Queue *queue) +{ + /*if (currpos) return currpos->item; + else return NULL;*/ + return queue->currpos; +} + +void QIterate(Queue *queue) +{ + QLink* node; + + node = queue->head; + while (node) { + printf("node=%x, ord=%f\n", node, node->ord); + node = node->next; + } + fflush(stdout); +} + +#endif /* DISKCACHE95 */ diff --git a/src/WINNT/afsd/queue95.h b/src/WINNT/afsd/queue95.h new file mode 100644 index 000000000..8bbb8f4a6 --- /dev/null +++ b/src/WINNT/afsd/queue95.h @@ -0,0 +1,63 @@ +/* + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + */ + +/* queue.h + * + * Class declaration for generic queue for use with Windows 95/DJGPP client + * disk cache + * + ***************************************************************************/ + +#ifndef _QUEUE_H +#define _QUEUE_H + +/* offset of member m in struct T */ +#define OFFSETOF(T, m) ((USHORT) &(((T *) NULL)->m)) + +/* get pointer to parent struct T containing member m at address p */ +#define MEM_TO_OBJ(T, m, p) ((char *)(p) - OFFSETOF(T, m)) + +typedef struct _QLink { + struct _QLink *next; + struct _QLink *prev; + int ord; +} QLink; + +typedef struct _Queue { + QLink *head; + QLink *tail; + int size; + QLink *currpos; +} Queue; + +/* add item to tail of queue */ +void QAddT(Queue *queue, QLink* node, int ord); + +/* add item to head of queue */ +void QAddH(Queue *queue, QLink *node, int ord); + +/* add item based on order value */ +void QAddOrd(Queue *queue, QLink *node, int ord); + +/* remove and return head of queue */ +QLink* QServe(Queue *queue); + +/* move item to tail of queue */ +void QMoveToTail(Queue *queue, QLink *x, int ord); + +/* remove item from queue */ +void QRemove(Queue *queue, QLink* x); + +/* return current position */ +QLink *QCurrent(Queue *queue); + +/* print out list of queued items */ +void QIterate(Queue *queue); + +#endif diff --git a/src/WINNT/client_osi/Makefile.djgpp b/src/WINNT/client_osi/Makefile.djgpp new file mode 100644 index 000000000..863ec504d --- /dev/null +++ b/src/WINNT/client_osi/Makefile.djgpp @@ -0,0 +1,32 @@ +# +# Makefile.djgpp +# make information for this directory +# requires gmake +# + +SOURCES = osifd.c osilog.c osiqueue.c osithrd95.c +include ../../config/Makefile.djgpp.common + +# apply changes from common for this directory +# +# no changes for this directory + +# what this directory builds +# +TARGETS = libosi.a +all : $(TARGETS) +install : $(DESTLIB)/libosi.a includes + +INCFILES = \ + $(DESTINC)/osi.h \ + $(DESTINC)/osifd.h \ + $(DESTINC)/osilog.h \ + $(DESTINC)/osiqueue.h \ + $(DESTINC)/osisleep.h \ + $(DESTINC)/osiutils.h \ + $(DESTINC)/osithrd95.h + +# hard-wired dependency information +# +libosi.a : $(ALL_OBJS) +includes: $(INCFILES) diff --git a/src/WINNT/client_osi/osithrd95.c b/src/WINNT/client_osi/osithrd95.c new file mode 100644 index 000000000..339a6bedd --- /dev/null +++ b/src/WINNT/client_osi/osithrd95.c @@ -0,0 +1,348 @@ +/* + * Copyright (C) 1998, 1989 Transarc Corporation - All rights reserved + * + * (C) COPYRIGHT IBM CORPORATION 1987, 1988 + * LICENSED MATERIALS - PROPERTY OF IBM + * + */ + +/* Copyright (C) 1994 Cazamar Systems, Inc. */ + +#include "osi.h" +#include "lwp.h" +/*#include "lock95.h"*/ +#include + +#include + +/* +thread95.c + +This code implements a partial OSI-over-LWP(and IOMGR) layer for threading +and synchronization, for the AFS NT code port to Windows 9x. +*/ + +// It so happens that all code seen so far throws away *thread_id; +// unfortunately, callers do not send thread_id==NULL instead of getting +// a value and tossing it. :( +thread_t thrd_Create(int attributes, int stacksize, ThreadFunc func, + void *parm, int flags, int *thread_id, char *name) +{ + PROCESS lwp_pid; + + // Reserve priority 0 for IOMGR; we use pri 1 by default + if (name) + LWP_CreateProcess(func, stacksize, 1, parm, name, &lwp_pid); + else + LWP_CreateProcess(func, stacksize, 1, parm, "thread", &lwp_pid); + + // In principle, the "right" way to do thread_id is to create a mapping + // between thread_id integers and LWP PROCESS names, but we're not using + // the IDs for anything anyway, so... + // actually, it turns out PROCESS is a pointer, so we fudge with that for now + // just to return a nonzero value + *thread_id = (int) lwp_pid; + + return lwp_pid; +} + +thread_t thrd_Current() +{ + PROCESS pid; + LWP_CurrentProcess(&pid); + return pid; +} + +int thrd_Close(thread_t thrd) +{ + int rc = LWP_DestroyProcess(thrd); + if (rc == LWP_SUCCESS) + return 0; + else + return -1; +} + +/* The following thread-local-storage and critical-section functions are + not used. */ +/* +DWORD thrd_Alloc(void) +{ + char **NewRock = NULL; + static int NextTag = 0; // Because LWP is not preemptive, we need no mutex + + NewRock = (char **) malloc (sizeof(LPVOID *)); + if (NewRock == NULL) + return 0xFFFFFFFF; + *NewRock = (LPVOID *) malloc(sizeof(LPVOID)); + if (*NewRock == NULL) { + free(NewRock); + return 0xFFFFFFFF; + } + + if (LWP_NewRock(++NextTag,NewRock)) + return 0xFFFFFFFF; + else + return NextTag; +} + +LPVOID thrd_GetValue(DWORD Index) +{ + char *ptr; + if (LWP_GetRock((int) Index, &ptr)) { + // SetLastError + return 0; + } else { + return * ((LPVOID *) ptr); + } +} + +BOOL thrd_SetValue(DWORD Index, LPVOID Value) { + char *ptr; + if (LWP_GetRock((int) Index, &ptr)) { + // SetLastError + return 0; + } else { + * ((LPVOID *) ptr) = Value; + return TRUE; + } +} + +#define LPCRITICAL_SECTION (struct Lock*) + +#define thrd_InitCrit (Lock_Init) +#define thrd_EnterCrit (ObtainWriteLock) +#define thrd_LeaveCrit (ReleaseWriteLock) + +// LWP has no formal destructor for locks. +#define thrd_DeleteCrit(x) ; + +*/ + + +/* Since LWP is nonpreemptive, arithmetic needs no special handling. */ + +LONG thrd_Increment(LPLONG number) +{ + ++*number; + return *number; +} + +LONG thrd_Decrement(LPLONG number) +{ + --*number; + return *number; +} + +LONG thrd_Exchange(LPLONG number, LONG value) +{ + LONG oldval = *number; + *number = value; + return oldval; +} + +// CreateEvent is always called with (NULL,(T/F),(T/F),NULL) +// This code will assume it and fail otherwise. +// SetLastError() is not implemented, i.e., if thrd_CreateEvent fails, +// there is no corresponding GetLastError() to pull out error codes +// at this time. +EVENT *thrd_CreateEvent(void *f, BOOL manual, BOOL startsignaled, void *g) +{ + // LWP code checks eventnames against NULL as an error condition, + // so we start counting from 1 instead of zero. + // It turns out that LWP uses event names as unique integer values, + // even though these values are cast as char pointers. We will use + // integers, since they are never dereferenced by LWP. + static unsigned long NextEventName = 1L; + EVENT *event; + + // Startup stuff + if ((f != NULL) || (g != NULL)) { + // Panic! This scenario is not implemented. + assert(0); + return NULL; + } + + // Create an event + if ((event=(EVENT*)malloc(sizeof(EVENT))) == NULL) + { + // SetLastError out of memory + return NULL; + } + if (manual) + event->state = startsignaled ? manualsignal : manualunsig; + else + event->state = startsignaled ? autosignal : autounsig; + event->name = (char *) NextEventName; + + // Increment NextEventName + ++NextEventName; + + return event; +} + +BOOL thrd_SetEvent(EVENT *event) +{ + if (event==NULL) + return FALSE; + if (AUTOMATIC(event)) + event->state = autosignal; + else + event->state = manualsignal; + LWP_SignalProcess(event->name); + return TRUE; +} + +BOOL thrd_ResetEvent(EVENT *event) +{ + if (event==NULL) + return FALSE; + if (AUTOMATIC(event)) + event->state = autounsig; + else + event->state = manualunsig; + return TRUE; +} + +// It appears there is a slight difference in the two wait schemes. +// Win32's WaitForSingleObject returns only when the wait is finished; +// LWP's WaitProcess may return randomly, and so requires while() wrapping +// (a little busywaiting). +DWORD thrd_WaitForSingleObject_Event(EVENT *event, DWORD timeoutms) +{ + if (timeoutms != INFINITE) { + // Panic! + assert(0); + return WAIT_FAILED; + } + if (event == NULL) { + return WAIT_FAILED; + } + while (!SIGNALED(event)) + LWP_WaitProcess(event->name); + if (AUTOMATIC(event)) + event->state = autounsig; + return WAIT_OBJECT_0; +} + +DWORD thrd_WaitForMultipleObjects_Event(DWORD count, EVENT* events[], + BOOL waitforall, DWORD timeoutms) +{ + if ((timeoutms != INFINITE) || waitforall) { + // Panic! This functionality not implemented. + assert(0); + return WAIT_FAILED; + } + if (events == NULL) { + return WAIT_FAILED; + } + + // Do the actual wait + { + // Construct the list of LWP events to wait on + char *names[count+1]; + int i; + for (i=0;istate = autounsig; + return (WAIT_OBJECT_0 + i); + } + names[i] = events[i]->name; + } + names[count] = NULL; + + // Do the wait for something to signal + while (1) { + LWP_MwaitProcess(1,names); + // Find who got signalled: MwaitProcess doesn't tell us. + for (i=0; istate = autounsig; + return WAIT_OBJECT_0 + i; + } + } + } + // not reached + assert(0); + } + // not reached + assert(0); +} + +int osi_Once(osi_once_t *argp) +{ + long i; + + lock_ObtainMutex(&argp->atomic); + + if (argp->done == 0) { + argp->done = 1; + return 1; + } + + /* otherwise we've already been initialized, so clear lock and return */ + lock_ReleaseMutex(&argp->atomic); + return 0; +} + +void osi_EndOnce(osi_once_t *argp) +{ + lock_ReleaseMutex(&argp->atomic); +} + +int osi_TestOnce(osi_once_t *argp) +{ + long localDone; + long i; + + lock_ObtainMutex(&argp->atomic); + + localDone = argp->done; + + /* drop interlock */ + lock_ReleaseMutex(&argp->atomic); + + return (localDone? 0 : 1); +} + +void osi_panic(char *s, char *f, long l) +{ + fprintf(stderr, "Fatal error: %s at %s:%d\n", s, f, l); + exit(1); +} + +/* return true iff x is prime */ +int osi_IsPrime(unsigned long x) +{ + unsigned long c; + + /* even numbers aren't prime */ + if ((x & 1) == 0 && x != 2) return 0; + + for(c = 3; c x) return 1; + } + + /* probably never get here */ + return 1; +} + +/* return first prime number less than or equal to x */ +unsigned long osi_PrimeLessThan(unsigned long x) { + unsigned long c; + + for(c = x; c > 1; c--) { + if (osi_IsPrime(c)) return c; + } + + /* ever reached? */ + return 1; +} diff --git a/src/WINNT/client_osi/osithrd95.h b/src/WINNT/client_osi/osithrd95.h new file mode 100644 index 000000000..8b23b2864 --- /dev/null +++ b/src/WINNT/client_osi/osithrd95.h @@ -0,0 +1,130 @@ +#ifndef THRD95_H +#define THRD95_H + +#include +#include +#include +#include + +/* Since we don't have windows.h to define booleans, we do it ourselves */ +#ifndef TRUE + #define TRUE (1) +#endif +#ifndef FALSE + #define FALSE (0) +#endif + +#define osi_rwlock_t struct Lock +#define osi_mutex_t struct Lock + +#define osi_Init() { PROCESS pid; LWP_InitializeProcessSupport(1,&pid); IOMGR_Initialize(); } + +/* +#define lock_InitializeMutex(a, b) Lock_Init(a) +#define lock_InitializeRWLock(a, b) Lock_Init(a) +*/ + +#define lock_InitializeRWLock(a, b) Lock_Init(a) +#define lock_InitializeMutex(a, b) lock_InitializeRWLock(a,b) + +#define lock_ObtainWrite(a) ObtainWriteLock(a) +#define lock_ObtainRead(a) ObtainReadLock(a) +#define lock_ObtainMutex(a) lock_ObtainWrite(a) +#define lock_ReleaseRead(a) ReleaseReadLock(a) +#define lock_ReleaseWrite(a) ReleaseWriteLock(a) +#define lock_ReleaseMutex(a) lock_ReleaseWrite(a) + +#define lock_FinalizeRWLock(a) /* */ +#define lock_FinalizeMutex(a) lock_FinalizeRWLock(a) + +/* +#define lock_TryWrite(a) if (!WriteLocked(a)) ObtainWriteLock(a) +#define lock_TryRead(a) if (!WriteLocked(a)) ObtainReadLock(a) +#define lock_TryMutex(a) if (!WriteLocked(a)) ObtainWriteLock(a) +*/ +#define lock_TryWrite(a) ( ((CheckLock(a)) == 0) ? (({ObtainWriteLock(a);}), 1) : 0 ) +#define lock_TryRead(a) ( ((CheckLock(a)) > -1) ? (({ObtainReadLock(a);}), 1) : 0 ) +#define lock_TryMutex(a) lock_TryWrite(a) +#define lock_GetMutexState(a) CheckLock(a) +#define lock_AssertMutex(a) assert(lock_GetMutexState(a) == -1) +#define lock_AssertWrite(a) assert(lock_GetMutexState(a) == -1) + +#define Crit_Sec osi_mutex_t +#define thrd_InitCrit(a) lock_InitializeMutex(a, "cs") +#define thrd_EnterCrit lock_ObtainMutex +#define thrd_LeaveCrit lock_ReleaseMutex +#define thrd_DeleteCrit(a) + +// Does LWP take a char* and read it as ASCIIZ, or as a pointer? +// ASCIIZ, perhaps? +/* +#define osi_Sleep(a) { char buf[sizeof(long)+1]; memcpy(buf,&a,sizeof(long)); buf[sizeof(long)]='\0'; LWP_WaitProcess(buf); } +*/ +// Actually, pointer (from reading LWP source) +#define osi_Sleep(a) LWP_WaitProcess(a); + +#define __do_LWP_sleep(v,l,f) { f(l); osi_Sleep(v); } +#define osi_SleepM(a,b) __do_LWP_sleep(a,b,lock_ReleaseMutex) +#define osi_SleepR(a,b) __do_LWP_sleep(a,b,lock_ReleaseRead) +#define osi_SleepW(a,b) __do_LWP_sleep(a,b,lock_ReleaseWrite) + +/* +#define osi_Wakeup(a) { char buf[sizeof(long)+1]; memcpy(buf,&a,sizeof(long)); buf[sizeof(long)]='\0'; LWP_SignalProcess(buf); } +*/ +#define osi_Wakeup(a) LWP_SignalProcess(a) + +/* +#define thrd_Sleep(a) IOMGR_Select(0, 0, 0, 0, a) +*/ +#define thrd_Sleep(a) IOMGR_Sleep((a)/1000) + +#define thrd_Yield LWP_DispatchProcess + +/* For thread95.c */ +#define __EVENT_NAME_LENGTH 10 +typedef struct __event { + enum { manualunsig = 0, autounsig = 2, + autosignal = 3, manualsignal = 1 } state; + char *name; // "Name" of corresponding LWP events + // char name[__EVENT_NAME_LENGTH+1]; // Name of corresponding LWP events +} EVENT; +#define SIGNALED(event) (event->state & 0x01) +#define AUTOMATIC(event) (event->state & 0x02) + +typedef PROCESS thread_t; +typedef int (*ThreadFunc)(void *); +typedef int SecurityAttrib; + +thread_t thrd_Create(int attributes, int stacksize, ThreadFunc func, + void *parm, int flags, int *thread_id, char *name); +#define thrd_Exit(rc) return(rc) +thread_t thrd_Current(void); +int thrd_Close(thread_t thrd); +#define thrd_CloseHandle(h) + +typedef long int LONG; +typedef LONG *LPLONG; +LONG thrd_Increment(LPLONG number); +LONG thrd_Decrement(LPLONG number); +LONG thrd_Exchange(LPLONG number, LONG value); + +typedef enum { False=0, True=1 } BOOL; +typedef EVENT *EVENT_HANDLE; /* Absorbs Win32 type HANDLE when used for synch */ +EVENT *thrd_CreateEvent(void *f, BOOL manual, BOOL startsignaled, void *g); +BOOL thrd_SetEvent(EVENT *event); +BOOL thrd_ResetEvent(EVENT *event); + +typedef unsigned long DWORD; +#define INFINITE (0xFFFFFFFF) // infinite timeout for waits +#define WAIT_FAILED (0xFFFFFFFF) +#define WAIT_OBJECT_0 (0L) +#define CONST const +DWORD thrd_WaitForSingleObject_Event(EVENT *event, DWORD timeoutms); +DWORD thrd_WaitForMultipleObjects_Event(DWORD count, EVENT* events[], + BOOL waitforall, DWORD timeoutms); + +#define osi_Time gettime_ms + +typedef FILE *FILE_HANDLE; + +#endif /* #ifndef THRD95_H */ diff --git a/src/WINNT/client_osi/osithrdnt.h b/src/WINNT/client_osi/osithrdnt.h new file mode 100644 index 000000000..bac94fb8d --- /dev/null +++ b/src/WINNT/client_osi/osithrdnt.h @@ -0,0 +1,36 @@ +/* Defines for abstraction layer for NT */ + +#ifndef THREAD_NT_H +#define THREAD_NT_H + +#define thread_t HANDLE +#define ThreadFunc LPTHREAD_START_ROUTINE +#define SecurityAttrib PSECURITY_ATTRIBUTES + +#define thrd_Create(security, stacksize, function, arg1, arg2, pid, name) \ + CreateThread(security, stacksize, function, arg1, arg2, pid) + +#define thrd_CloseHandle(phandle) CloseHandle(phandle) + +#define thrd_CreateEvent CreateEvent +#define thrd_SetEvent SetEvent +#define thrd_ResetEvent ResetEvent +#define thrd_Increment InterlockedIncrement +#define thrd_Decrement InterlockedDecrement +#define thrd_WaitForSingleObject_Event WaitForSingleObject +#define thrd_WaitForMultipleObjects_Event WaitForMultipleObjects + +#define thrd_Sleep Sleep + +#define Crit_Sec CRITICAL_SECTION +#define thrd_InitCrit InitializeCriticalSection +#define thrd_EnterCrit EnterCriticalSection +#define thrd_LeaveCrit LeaveCriticalSection +#define thrd_DeleteCrit DeleteCriticalSection + +#define thrd_Current GetCurrentThreadId + +#define EVENT_HANDLE HANDLE +#define FILE_HANDLE HANDLE + +#endif /* THREAD_NT_H */ diff --git a/src/mkdest.pl b/src/mkdest.pl new file mode 100644 index 000000000..c3e33c37f --- /dev/null +++ b/src/mkdest.pl @@ -0,0 +1,78 @@ +#!/usr/bin/perl + +# mkdest: make AFS platform directory for build + +if ($#ARGV >= 0) { + $srcdir = $ARGV[0]; +} +else { + $srcdir = "/tmp/src"; +} +$dir = $ENV{PWD}; + +print "Create build tree from the AFS source tree $srcdir\n"; +print "Create links in platform tree $dir\n"; + +print "continue (y/n) ? "; + +chop ($ans = ); +exit if ($ans ne "y"); + +mkdir "dest", 0755 || die "Can't create directory dest\n"; +mkdir "obj", 0755 || die "Can't create directory obj\n"; +chdir "obj" || die "Can't change to directory obj\n"; + +&dodir($srcdir, ".."); + +sub dodir { + local($dir,$destpath) = @_; + print "$dir\n"; + local($a); + local($i); + + #if (-e "$dir/RCS") { + ## Make RCS link and check out all files in this directory + #system("ln -sf $dir/RCS"); + #system("co RCS/*"); + #} + + opendir(DIR,$dir) || die "Can't open directory $dir\n"; + local(@allfiles) = readdir(DIR); + closedir(DIR); + + $thisdir = &lastcomp($dir); + system("ln -s $destpath/dest DEST"); + system("ln -s $destpath/../src/$thisdir SRC"); + + foreach $a (@allfiles) { + #print "$a\n"; + if (! -d "$dir/$a") { + system("ln -s SRC/$a"); + next; + } + next if $a eq '.'; + next if $a eq '..'; + next if $a eq 'RCS'; + + # Make this subdirectory on local copy + mkdir $a, 0755 || die "Can't create directory $dir/$a\n"; + chdir $a || die "Can't change to directory $dir/$a\n"; + + # Recursively process this directory + &dodir("$dir/$a", "$destpath/.."); + chdir '..'; + } +} + +sub lastcomp { + local($dir) = @_; + + $_ = $dir; + if (/$srcdir\/(\S+)/) { + $dir = $1; + } + else { + $dir = $_; + } + return $dir; +} diff --git a/src/rmbat.bat b/src/rmbat.bat new file mode 100644 index 000000000..ccc332870 --- /dev/null +++ b/src/rmbat.bat @@ -0,0 +1,16 @@ +@echo off +if [%1]==[-f] shift +if [%1]==[/f] shift +if [%1]==[-F] shift +if [%1]==[/F] shift +if [%1]==[/q] shift +if [%1]==[/Q] shift +if [%1]==[-q] shift +if [%1]==[-Q] shift +if [%1]==[-f] shift +if [%1]==[/f] shift +if [%1]==[-F] shift +if [%1]==[/F] shift +if not [%1]==[] del %1 <%AFSROOT%\DEST\BIN\rmbat.rsp +if not [%1]==[] shift +if not [%1]==[] %AFSROOT%\DEST\BIN\rmbat %1 %2 %3 %4 %5 %6 %7 %8 diff --git a/src/rmbat.rsp b/src/rmbat.rsp new file mode 100644 index 000000000..5758d80da --- /dev/null +++ b/src/rmbat.rsp @@ -0,0 +1 @@ +y diff --git a/src/symlink.bat b/src/symlink.bat new file mode 100644 index 000000000..5e03e72e1 --- /dev/null +++ b/src/symlink.bat @@ -0,0 +1 @@ +@echo %1 %2 %3 %4 %5 \ No newline at end of file