home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD1.bin / gnu / src / diffs / pdksh-4.9.diffs < prev    next >
Encoding:
Text File  |  1995-01-21  |  106.9 KB  |  3,894 lines

  1. diff -rc --new-file pdksh-4.9/Makefile /gnu/src/amiga/pdksh-4.9/Makefile
  2. *** pdksh-4.9/Makefile    Wed May  4 14:46:25 1994
  3. --- /gnu/src/amiga/pdksh-4.9/Makefile    Thu Jan  1 00:00:00 1970
  4. ***************
  5. *** 1,43 ****
  6. - # PD Bourne/Korn Shell
  7. - # $Id: Makefile,v 1.5 93/05/08 15:59:28 sjg Exp $
  8. - SHELL = /bin/sh
  9. - MAKE  = make
  10. - CC=gcc -pipe -g -O
  11. - LN=ln -s
  12. - #LN=ln
  13. - #CONFIG= -D_SYSV
  14. - #CONFIG= -D_BSD 
  15. - #CONFIG= -D_BSD -DHAVE_SYS_STDTYPES
  16. - #CONFIG= -D_V7
  17. - #CONFIG= -D_ST                # Atari ST
  18. - #CONFIG= -D_BSDI -D_POSIX_TERM        # BSD/386
  19. - CONFIG= -D_BSD -D_POSIX_TERM        # 386bsd
  20. - MANPAGES = ksh.1
  21. - #MANDIR=/usr/catman/u_man/man1
  22. - #MANDIR=/usr/man/man1
  23. - #INSTALL=bsdinstall
  24. - INSTALL=install
  25. - all:    ksh
  26. - ksh:    libs
  27. -     ( cd sh ; $(MAKE) 'CC=$(CC)' 'CONFIG=$(CONFIG)' $@ )
  28. - libs:
  29. -     ( cd std ; $(MAKE) 'CC=$(CC)' 'CONFIG=$(CONFIG)' 'LN=$(LN)' libs )
  30. - install: sh/ksh
  31. -     ( cd sh ; $(INSTALL) -s ksh $(DESTDIR)/bin )
  32. - sh/ksh:    ksh
  33. - inst-man: $(MANPAGES)
  34. -     $(INSTALL) -c -m 444 $(MANPAGES) $(MANDESTDIR)/man1
  35. - clean clobber:
  36. -     ( cd std ; $(MAKE) $@ )
  37. -     ( cd sh ; $(MAKE) $@ )
  38. -     -rm -f *.out
  39. --- 0 ----
  40. diff -rc --new-file pdksh-4.9/Makefile.in /gnu/src/amiga/pdksh-4.9/Makefile.in
  41. *** pdksh-4.9/Makefile.in    Thu Jan  1 00:00:00 1970
  42. --- /gnu/src/amiga/pdksh-4.9/Makefile.in    Sun Jul 10 10:31:14 1994
  43. ***************
  44. *** 0 ****
  45. --- 1,54 ----
  46. + # PD Bourne/Korn Shell
  47. + # $Id: Makefile,v 1.5 93/05/08 15:59:28 sjg Exp $
  48. + #### Start of system configuration section. ####
  49. + srcdir = @srcdir@
  50. + VPATH = @srcdir@
  51. + # Common prefix for machine-independent installed files.
  52. + prefix = /gnu
  53. + # Common prefix for machine-dependent installed files.
  54. + exec_prefix = $(prefix)
  55. + # Directory to install executables in.
  56. + bindir = $(exec_prefix)/bin
  57. + # Directory to install libraries in.
  58. + libdir = $(exec_prefix)/lib
  59. + # Directory to install the Info files in.
  60. + infodir = $(prefix)/info
  61. + # Directory to install the man page in.
  62. + mandir = $(prefix)/man/man$(manext)
  63. + # Number to put on the man page filename.
  64. + manext = 1
  65. + # Program to install executables.
  66. + INSTALL_PROGRAM = @INSTALL_PROGRAM@
  67. + # Program to install data like man pages.
  68. + INSTALL_DATA = @INSTALL_DATA@
  69. + # Generic install program.
  70. + INSTALL = @INSTALL@
  71. + #### End of system configuration section. ####
  72. + SHELL =        /bin/sh
  73. + MAKE =        make
  74. + MANPAGES =    ksh.1
  75. + all:        ksh
  76. + ksh:        libs
  77. +         @( cd sh ; $(MAKE) $@ )
  78. + libs:
  79. + #        @( cd std ; $(MAKE) $@ )
  80. + install:
  81. +         $(INSTALL_DATA) -c $(srcdir)/ksh.1 $(mandir)/ksh.1
  82. +         @( cd sh ; $(MAKE) $@ )
  83. + clean clobber:
  84. + #        @( cd std ; $(MAKE) $@ )
  85. +         @( cd sh ; $(MAKE) $@ )
  86. +         -rm -f *.out
  87. diff -rc --new-file pdksh-4.9/Product-Info /gnu/src/amiga/pdksh-4.9/Product-Info
  88. *** pdksh-4.9/Product-Info    Thu Jan  1 00:00:00 1970
  89. --- /gnu/src/amiga/pdksh-4.9/Product-Info    Fri Nov 18 12:52:14 1994
  90. ***************
  91. *** 0 ****
  92. --- 1,31 ----
  93. + .name
  94. + pdksh
  95. + .fullname
  96. + Ksh compatible shell
  97. + .type
  98. + Shell
  99. + .short
  100. + A UNIX ksh compatible shell for AmigaDOS
  101. + .description
  102. + A KSH-like shell that is compatible enough with the real UNIX ksh to
  103. + be used with most scripts that the UNIX ksh can run.
  104. + .version
  105. + 4.9
  106. + .date
  107. + .author
  108. + Eric Gisin
  109. + Charles Forsyth
  110. + John R MacMillan
  111. + Simon J. Gerraty
  112. + Markus Wild
  113. + .distribution
  114. + Public Domain
  115. + .requirements
  116. + Amiga binary requires ixemul.library.
  117. + .docs
  118. + !README.AMIGA!
  119. + README
  120. + .described-by
  121. + Fred Fish (fnf@amigalib.com)
  122. + .submittal
  123. + Downloaded via ftp from wuarchive.wustl.edu.
  124. diff -rc --new-file pdksh-4.9/README.AMIGA /gnu/src/amiga/pdksh-4.9/README.AMIGA
  125. *** pdksh-4.9/README.AMIGA    Thu Jan  1 00:00:00 1970
  126. --- /gnu/src/amiga/pdksh-4.9/README.AMIGA    Tue Jun 14 08:46:22 1994
  127. ***************
  128. *** 0 ****
  129. --- 1,75 ----
  130. + This is the first release of the AmigaDOS port of pdksh, based on
  131. + the official 4.5 release of pdksh.
  132. + Don't currently expect too much support for this, it's mainly for people
  133. + who want a true /bin/sh compatible shell, and don't primarily want a
  134. + replacement for the CLI SYSTEM SHELL.
  135. + Notes to the sources
  136. + ====================
  137. + If you cross-check with MANIFEST you see that I didn't include the std/
  138. + directory. This is simply because it's not needed with ixemul.library, and
  139. + I didn't want to include something useless for AmigaDOS. If you plan to
  140. + compile pdksh under an environment that would need std/, best thing is you
  141. + get the original distribution from a site archiving comp.sources.misc.
  142. + DON'T FORGET TO SET THE PURE BIT ON KSH, archiving might have deleted it.
  143. + Known problems
  144. + ==============
  145. + o This really is a problem of ixemul.library v39.41: vfork() crashes when
  146. +   under kickstart 1.3. I don't know exactly what happend that made vfork()
  147. +   crash under 1.3, it once worked. However, I don't feel like investigating
  148. +   this to extremes, I don't use 1.3 any longer. If someone really wants
  149. +   it fixed, contact me, and we'll find a way.
  150. + o don't stress ksh with ^C when in the commandline editor. Breaking usually
  151. +   works to abort commands, don't use it when you already have the prompt.
  152. +   This is probably a bug somewhere in select(), will need investigation.
  153. + Debugging help
  154. + ==============
  155. + If you set the TRACE_LEVEL environment variable, ksh tells you the address
  156. + of its main() function. This is extremely useful to interprete enforcer-
  157. + output, since in vfork()d processes, hunk-o-matic won't work and enforcer
  158. + doesn't output any hunk-offsets, just PC values. If you subtract the
  159. + address of main() from that PC, you get a relative value, instead of an
  160. + absolute, process dependant PC, which you can then use to look at the
  161. + code in your favorite disassembler.
  162. + libs/ixemul.library
  163. + ===================
  164. + This is the current version of the library, and it replaces the one
  165. + distributed with gcc21-920420.lha. Don't use any old libraries, they are
  166. + very buggy in those areas explored by ksh;-))
  167. + ixpipe-handler/*
  168. + ================
  169. + This is the first version of a bridge between ixemul.library and 
  170. + programs reading/writing to DOS filehandles. I'd be happy for comments
  171. + on this! Be sure to mount the handler before trying to use I/O
  172. + redirection on non-ixemul programs in ksh! Don't try to use it IXPIPE:
  173. + like PIPE:, they're totally different! IXPIPE: is used automatically
  174. + if a non-ixemul program is execve()'d for each file descriptor 0, 1 or
  175. + 2 who's type is not that of a plain DOS file. A pipe would be an
  176. + example of a non-dos type.
  177. + Favorite usage
  178. + ==============
  179. + Setup a directory, assign BIN: to it, and copy ksh into BIN:sh. That way,
  180. + you can have the usual
  181. + SHELL=/bin/sh
  182. + in your Makefile ;-))
  183. + Happy testing!
  184. + -Markus Wild
  185. + <wild@nessie.cs.id.ethz.ch>  and  <wild@amiga.physik.unizh.ch>
  186. diff -rc --new-file pdksh-4.9/configure /gnu/src/amiga/pdksh-4.9/configure
  187. *** pdksh-4.9/configure    Thu Jan  1 00:00:00 1970
  188. --- /gnu/src/amiga/pdksh-4.9/configure    Tue Jun 14 10:10:02 1994
  189. ***************
  190. *** 0 ****
  191. --- 1,1117 ----
  192. + #!/bin/sh
  193. + # Guess values for system-dependent variables and create Makefiles.
  194. + # Generated automatically using autoconf version 1.11 
  195. + # Copyright (C) 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
  196. + # This configure script is free software; you can redistribute it and/or
  197. + # modify it under the terms of the GNU General Public License as published
  198. + # by the Free Software Foundation; either version 2, or (at your option)
  199. + # any later version.
  200. + # This script is distributed in the hope that it will be useful, but
  201. + # WITHOUT ANY WARRANTY; without even the implied warranty of
  202. + # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
  203. + # Public License for more details.
  204. + # You should have received a copy of the GNU General Public License
  205. + # along with this program; if not, write to the Free Software
  206. + # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  207. + # Save the original args to write them into config.status later.
  208. + configure_args="$*"
  209. + # Only options that might do something get documented.
  210. + ac_usage="Usage: configure [options] [host]
  211. + Options: [defaults in brackets after descriptions]
  212. + --build=BUILD        configure for building on BUILD [BUILD=HOST]
  213. + --disable-FEATURE    do not include FEATURE (same as --enable-FEATURE=no)
  214. + --enable-FEATURE[=ARG]    include FEATURE [ARG=yes]
  215. + --exec-prefix=PREFIX    install host dependent files in PREFIX [/usr/local]
  216. + --help            print this message
  217. + --host=HOST        configure for HOST [guessed]
  218. + --prefix=PREFIX        install host independent files in PREFIX [/usr/local]
  219. + --quiet, --silent    do not print \`checking for...' messages
  220. + --srcdir=DIR        find the sources in DIR [configure dir or ..]
  221. + --target=TARGET        configure for TARGET [TARGET=HOST]
  222. + --verbose        print results of checks
  223. + --version        print the version of autoconf that created configure
  224. + --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
  225. + --without-PACKAGE    do not use PACKAGE (same as --with-PACKAGE=no)
  226. + --x-includes=DIR    X include files are in DIR
  227. + --x-libraries=DIR    X library files are in DIR"
  228. + # Initialize some variables set by options.
  229. + # The variables have the same names as the options, with
  230. + # dashes changed to underlines.
  231. + build=NONE
  232. + exec_prefix=
  233. + host=NONE
  234. + no_create=
  235. + nonopt=NONE
  236. + norecursion=
  237. + prefix=
  238. + program_prefix=
  239. + program_suffix=
  240. + program_transform_name=
  241. + silent=
  242. + srcdir=
  243. + target=NONE
  244. + verbose=
  245. + x_includes=
  246. + x_libraries=
  247. + ac_prev=
  248. + for ac_option
  249. + do
  250. +   # If the previous option needs an argument, assign it.
  251. +   if test -n "$ac_prev"; then
  252. +     eval "$ac_prev=\$ac_option"
  253. +     ac_prev=
  254. +     continue
  255. +   fi
  256. +   # Accept (but ignore some of) the important Cygnus configure
  257. +   # options, so we can diagnose typos.
  258. +   case "$ac_option" in
  259. +   -*=*) ac_optarg=`/bin/echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
  260. +   *) ac_optarg= ;;
  261. +   esac
  262. +   case "$ac_option" in
  263. +   -build | --build | --buil | --bui | --bu | --b)
  264. +     ac_prev=build ;;
  265. +   -build=* | --build=* | --buil=* | --bui=* | --bu=* | --b=*)
  266. +     build="$ac_optarg" ;;
  267. +   -disable-* | --disable-*)
  268. +     ac_feature=`/bin/echo $ac_option|sed -e 's/-*disable-//'`
  269. +     # Reject names that aren't valid shell variable names.
  270. +     if test -n "`/bin/echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
  271. +       /bin/echo "configure: $ac_feature: invalid feature name" >&2; exit 1
  272. +     fi
  273. +     ac_feature=`/bin/echo $ac_feature| sed 's/-/_/g'`
  274. +     eval "enable_${ac_feature}=no" ;;
  275. +   -enable-* | --enable-*)
  276. +     ac_feature=`/bin/echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
  277. +     # Reject names that aren't valid shell variable names.
  278. +     if test -n "`/bin/echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
  279. +       /bin/echo "configure: $ac_feature: invalid feature name" >&2; exit 1
  280. +     fi
  281. +     ac_feature=`/bin/echo $ac_feature| sed 's/-/_/g'`
  282. +     case "$ac_option" in
  283. +       *=*) ;;
  284. +       *) ac_optarg=yes ;;
  285. +     esac
  286. +     eval "enable_${ac_feature}='$ac_optarg'" ;;
  287. +   # For backward compatibility, recognize -exec-prefix and --exec_prefix.
  288. +   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
  289. +   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
  290. +   | --exec | --exe | --ex)
  291. +     ac_prev=exec_prefix ;;
  292. +   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
  293. +   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
  294. +   | --exec=* | --exe=* | --ex=*)
  295. +     exec_prefix="$ac_optarg" ;;
  296. +   -gas | --gas | --ga | --g)
  297. +     with_gas=yes ;; # Obsolete; use --with-gas.
  298. +   -help | --help | --hel | --he)
  299. +     cat << EOF
  300. + $ac_usage
  301. + EOF
  302. +     exit 0 ;;
  303. +   -host | --host | --hos | --ho)
  304. +     ac_prev=host ;;
  305. +   -host=* | --host=* | --hos=* | --ho=*)
  306. +     host="$ac_optarg" ;;
  307. +   -nfp | --nfp | --nf)
  308. +     with_fp=no ;; # Obsolete; use --without-fp.
  309. +   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
  310. +   | --no-cr | --no-c)
  311. +     no_create=yes ;;
  312. +   -norecursion | --norecursion | --norecursio | --norecursi \
  313. +   | --norecurs | --norecur | --norecu | --norec | --nore | --nor)
  314. +     norecursion=yes ;;
  315. +   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
  316. +     ac_prev=prefix ;;
  317. +   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
  318. +     prefix="$ac_optarg" ;;
  319. +   -program-prefix | --program-prefix | --program-prefi | --program-pref \
  320. +   | --program-pre | --program-pr | --program-p)
  321. +     ac_prev=program_prefix ;;
  322. +   -program-prefix=* | --program-prefix=* | --program-prefi=* \
  323. +   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
  324. +     program_prefix="$ac_optarg" ;;
  325. +   -program-suffix | --program-suffix | --program-suffi | --program-suff \
  326. +   | --program-suf | --program-su | --program-s)
  327. +     ac_prev=program_suffix ;;
  328. +   -program-suffix=* | --program-suffix=* | --program-suffi=* \
  329. +   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
  330. +     program_suffix="$ac_optarg" ;;
  331. +   -program-transform-name | --program-transform-name \
  332. +   | --program-transform-nam | --program-transform-na \
  333. +   | --program-transform-n | --program-transform- \
  334. +   | --program-transform | --program-transfor \
  335. +   | --program-transfo | --program-transf \
  336. +   | --program-trans | --program-tran \
  337. +   | --progr-tra | --program-tr | --program-t)
  338. +     ac_prev=program_transform_name ;;
  339. +   -program-transform-name=* | --program-transform-name=* \
  340. +   | --program-transform-nam=* | --program-transform-na=* \
  341. +   | --program-transform-n=* | --program-transform-=* \
  342. +   | --program-transform=* | --program-transfor=* \
  343. +   | --program-transfo=* | --program-transf=* \
  344. +   | --program-trans=* | --program-tran=* \
  345. +   | --progr-tra=* | --program-tr=* | --program-t=*)
  346. +     program_transform_name="$ac_optarg" ;;
  347. +   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
  348. +   | -silent | --silent | --silen | --sile | --sil)
  349. +     silent=yes ;;
  350. +   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
  351. +     ac_prev=srcdir ;;
  352. +   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
  353. +     srcdir="$ac_optarg" ;;
  354. +   -target | --target | --targe | --targ | --tar | --ta | --t)
  355. +     ac_prev=target ;;
  356. +   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
  357. +     target="$ac_optarg" ;;
  358. +   -v | -verbose | --verbose | --verbos | --verbo | --verb)
  359. +     verbose=yes ;;
  360. +   -version | --version | --versio | --versi | --vers)
  361. +     /bin/echo "configure generated by autoconf version 1.11"
  362. +     exit 0 ;;
  363. +   -with-* | --with-*)
  364. +     ac_package=`/bin/echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
  365. +     # Reject names that aren't valid shell variable names.
  366. +     if test -n "`/bin/echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
  367. +       /bin/echo "configure: $ac_package: invalid package name" >&2; exit 1
  368. +     fi
  369. +     ac_package=`/bin/echo $ac_package| sed 's/-/_/g'`
  370. +     case "$ac_option" in
  371. +       *=*) ;;
  372. +       *) ac_optarg=yes ;;
  373. +     esac
  374. +     eval "with_${ac_package}='$ac_optarg'" ;;
  375. +   -without-* | --without-*)
  376. +     ac_package=`/bin/echo $ac_option|sed -e 's/-*without-//'`
  377. +     # Reject names that aren't valid shell variable names.
  378. +     if test -n "`/bin/echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
  379. +       /bin/echo "configure: $ac_package: invalid package name" >&2; exit 1
  380. +     fi
  381. +     ac_package=`/bin/echo $ac_package| sed 's/-/_/g'`
  382. +     eval "with_${ac_package}=no" ;;
  383. +   --x) with_x=yes ;; # Obsolete; use --with-x.
  384. +   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
  385. +   | --x-incl | --x-inc | --x-in | --x-i)
  386. +     ac_prev=x_includes ;;
  387. +   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
  388. +   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
  389. +     x_includes="$ac_optarg" ;;
  390. +   -x-libraries | --x-libraries | --x-librarie | --x-librari \
  391. +   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
  392. +     ac_prev=x_libraries ;;
  393. +   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
  394. +   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
  395. +     x_libraries="$ac_optarg" ;;
  396. +   -*) /bin/echo "configure: $ac_option: invalid option; use --help to show usage" >&2; exit 1
  397. +     ;;
  398. +   *) 
  399. +     if test -n "`/bin/echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
  400. +       /bin/echo "configure: warning: $ac_option: invalid host type" >&2
  401. +     fi
  402. +     if test "x$nonopt" != xNONE; then
  403. +       /bin/echo "configure: can only configure for one host and one target at a time" >&2; exit 1
  404. +     fi
  405. +     nonopt="$ac_option"
  406. +     ;;
  407. +   esac
  408. + done
  409. + if test -n "$ac_prev"; then
  410. +   /bin/echo "configure: missing argument to --`/bin/echo $ac_prev | sed 's/_/-/g'`" >&2; exit 1
  411. + fi
  412. + trap 'rm -fr conftest* confdefs* core $ac_clean_files; exit 1' 1 2 15
  413. + trap 'rm -fr confdefs* $ac_clean_files' 0
  414. + # Save the original args if we used an alternate arg parser.
  415. + ac_configure_temp="${configure_args-$*}"
  416. + # Strip out --no-create and --norecursion so they don't pile up.
  417. + configure_args=
  418. + for ac_arg in $ac_configure_temp; do
  419. +   case "$ac_arg" in
  420. +   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
  421. +   | --no-cr | --no-c) ;;
  422. +   -norecursion | --norecursion | --norecursio | --norecursi \
  423. +   | --norecurs | --norecur | --norecu | --norec | --nore | --nor) ;;
  424. +   *) configure_args="$configure_args $ac_arg" ;;
  425. +   esac
  426. + done
  427. + # NLS nuisances.
  428. + # These must not be set unconditionally because not all systems understand
  429. + # e.g. LANG=C (notably SCO).
  430. + if test "${LC_ALL+set}" = 'set'; then LC_ALL=C; export LC_ALL; fi
  431. + if test "${LANG+set}"   = 'set'; then LANG=C;   export LANG;   fi
  432. + # confdefs.h avoids OS command line length limits that DEFS can exceed.
  433. + rm -rf conftest* confdefs.h
  434. + # AIX cpp loses on an empty file, so make sure it contains at least a newline.
  435. + /bin/echo > confdefs.h
  436. + # A filename unique to this package, relative to the directory that
  437. + # configure is in, which we can look for to find out if srcdir is correct.
  438. + ac_unique_file=sh/sh.h
  439. + # Find the source files, if location was not specified.
  440. + if test -z "$srcdir"; then
  441. +   ac_srcdir_defaulted=yes
  442. +   # Try the directory containing this script, then `..'.
  443. +   ac_prog=$0
  444. +   ac_confdir=`/bin/echo $ac_prog|sed 's%/[^/][^/]*$%%'`
  445. +   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
  446. +   srcdir=$ac_confdir
  447. +   if test ! -r $srcdir/$ac_unique_file; then
  448. +     srcdir=..
  449. +   fi
  450. + fi
  451. + if test ! -r $srcdir/$ac_unique_file; then
  452. +   if test x$ac_srcdir_defaulted = xyes; then
  453. +     /bin/echo "configure: can not find sources in ${ac_confdir} or .." >&2; exit 1
  454. +   else
  455. +     /bin/echo "configure: can not find sources in ${srcdir}" >&2; exit 1
  456. +   fi
  457. + fi
  458. + ac_ext=c
  459. + # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
  460. + ac_cpp='${CPP}'
  461. + ac_compile='${CC-cc} $CFLAGS $LDFLAGS conftest.${ac_ext} -o conftest $LIBS >/dev/null 2>&1'
  462. + # We want these before the checks, so the checks can modify their values.
  463. + test -z "$CFLAGS" && CFLAGS= auto_cflags=1
  464. + test -z "$LDFLAGS" && LDFLAGS=
  465. + if test -z "$CC"; then
  466. +   # Extract the first word of `gcc', so it can be a program name with args.
  467. +   set ac_dummy gcc; ac_word=$2
  468. +   test -n "$silent" || /bin/echo "checking for $ac_word"
  469. +   IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  470. +   for ac_dir in $PATH; do
  471. +     test -z "$ac_dir" && ac_dir=.
  472. +     if test -f $ac_dir/$ac_word; then
  473. +       CC="gcc"
  474. +       break
  475. +     fi
  476. +   done
  477. +   IFS="$ac_save_ifs"
  478. + fi
  479. + test -z "$CC" && CC="cc"
  480. + test -n "$CC" && test -n "$verbose" && /bin/echo "    setting CC to $CC"
  481. + # Find out if we are using GNU C, under whatever name.
  482. + cat > conftest.c <<EOF
  483. + #ifdef __GNUC__
  484. +   yes
  485. + #endif
  486. + EOF
  487. + ${CC-cc} -E conftest.c > conftest.out 2>&1
  488. + if egrep yes conftest.out >/dev/null 2>&1; then
  489. +   GCC=1 # For later tests.
  490. + fi
  491. + rm -f conftest*
  492. + # If we're using gcc and the user hasn't specified CFLAGS, add -O to CFLAGS.
  493. + test -n "$GCC" && test -n "$auto_cflags" && CFLAGS="$CFLAGS -O2"
  494. + test -n "$silent" || /bin/echo "checking how to run the C preprocessor"
  495. + if test -z "$CPP"; then
  496. +   # This must be in double quotes, not single quotes, because CPP may get
  497. +   # substituted into the Makefile and ``${CC-cc}'' will simply confuse
  498. +   # make.  It must be expanded now.
  499. +   CPP="${CC-cc} -E"
  500. +   cat > conftest.${ac_ext} <<EOF
  501. + #include "confdefs.h"
  502. + #include <stdio.h>
  503. + Syntax Error
  504. + EOF
  505. + # Some shells (Coherent) do redirections in the wrong order, so need
  506. + # the parens.
  507. + ac_err=`eval "($ac_cpp conftest.${ac_ext} >/dev/null) 2>&1"`
  508. + if test -z "$ac_err"; then
  509. +   :
  510. + else
  511. +   rm -rf conftest*
  512. +   CPP="${CC-cc} -E -traditional-cpp"
  513. +   cat > conftest.${ac_ext} <<EOF
  514. + #include "confdefs.h"
  515. + #include <stdio.h>
  516. + Syntax Error
  517. + EOF
  518. + # Some shells (Coherent) do redirections in the wrong order, so need
  519. + # the parens.
  520. + ac_err=`eval "($ac_cpp conftest.${ac_ext} >/dev/null) 2>&1"`
  521. + if test -z "$ac_err"; then
  522. +   :
  523. + else
  524. +   rm -rf conftest*
  525. +   CPP=/lib/cpp
  526. + fi
  527. + rm -f conftest*
  528. + fi
  529. + rm -f conftest*
  530. + fi
  531. + test -n "$verbose" && /bin/echo "    setting CPP to $CPP"
  532. + if test -n "$GCC"; then
  533. +   test -n "$silent" || /bin/echo "checking whether -traditional is needed"
  534. +   ac_pattern="Autoconf.*'x'"
  535. +   ac_prog='#include <sgtty.h>
  536. + Autoconf TIOCGETP'
  537. +   cat > conftest.${ac_ext} <<EOF
  538. + #include "confdefs.h"
  539. + $ac_prog
  540. + EOF
  541. + eval "$ac_cpp conftest.${ac_ext} > conftest.out 2>&1"
  542. + if egrep "$ac_pattern" conftest.out >/dev/null 2>&1; then
  543. +   rm -rf conftest*
  544. +   ac_need_trad=1
  545. + fi
  546. + rm -f conftest*
  547. +   if test -z "$ac_need_trad"; then
  548. +     ac_prog='#include <termio.h>
  549. + Autoconf TCGETA'
  550. +     cat > conftest.${ac_ext} <<EOF
  551. + #include "confdefs.h"
  552. + $ac_prog
  553. + EOF
  554. + eval "$ac_cpp conftest.${ac_ext} > conftest.out 2>&1"
  555. + if egrep "$ac_pattern" conftest.out >/dev/null 2>&1; then
  556. +   rm -rf conftest*
  557. +   ac_need_trad=1
  558. + fi
  559. + rm -f conftest*
  560. +   fi
  561. +   test -n "$ac_need_trad" && CC="$CC -traditional"
  562. + fi
  563. + # Make sure to not get the incompatible SysV /etc/install and
  564. + # /usr/sbin/install, which might be in PATH before a BSD-like install,
  565. + # or the SunOS /usr/etc/install directory, or the AIX /bin/install,
  566. + # or the AFS install, which mishandles nonexistent args, or
  567. + # /usr/ucb/install on SVR4, which tries to use the nonexistent group
  568. + # `staff', or /sbin/install on IRIX which has incompatible command-line
  569. + # syntax.  Sigh.
  570. + #
  571. + #     On most BSDish systems install is in /usr/bin, not /usr/ucb
  572. + #     anyway.
  573. + # This turns out not to be true, so the mere pathname isn't an indication
  574. + # of whether the program works.  What we really need is a set of tests for
  575. + # the install program to see if it actually works in all the required ways.
  576. + #
  577. + # Avoid using ./install, which might have been erroneously created
  578. + # by make from ./install.sh.
  579. + if test -z "${INSTALL}"; then
  580. +   test -n "$silent" || /bin/echo "checking for a BSD compatible install"
  581. +   IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  582. +   for ac_dir in $PATH; do
  583. +     case "$ac_dir" in
  584. +     ''|.|/gnu/etc|/sbin|/usr/sbin|/usr/etc|/usr/afsws/bin|/usr/ucb) ;;
  585. +     *)
  586. +       # OSF1 and SCO ODT 3.0 have their own names for install.
  587. +       for ac_prog in installbsd scoinst install; do
  588. +         if test -f $ac_dir/$ac_prog; then
  589. +       if test $ac_prog = install &&
  590. +             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
  591. +         # AIX install.  It has an incompatible calling convention.
  592. +         # OSF/1 installbsd also uses dspmsg, but is usable.
  593. +         :
  594. +       else
  595. +         INSTALL="$ac_dir/$ac_prog -c"
  596. +         break 2
  597. +       fi
  598. +     fi
  599. +       done
  600. +       ;;
  601. +     esac
  602. +   done
  603. +   IFS="$ac_save_ifs"
  604. + fi
  605. + if test -z "$INSTALL"; then
  606. +   # As a last resort, use the slow shell script.
  607. +   for ac_dir in ${srcdir} ${srcdir}/.. ${srcdir}/../..; do
  608. +     if test -f $ac_dir/install.sh; then
  609. +       INSTALL="$ac_dir/install.sh -c"; break
  610. +     fi
  611. +   done
  612. + fi
  613. + if test -z "$INSTALL"; then
  614. +   /bin/echo "configure: can not find install.sh in ${srcdir} or ${srcdir}/.. or ${srcdir}/../.." >&2; exit 1
  615. + fi
  616. + test -n "$verbose" && /bin/echo "    setting INSTALL to $INSTALL"
  617. + # Use test -z because SunOS4 sh mishandles ${INSTALL_PROGRAM-'${INSTALL}'}.
  618. + # It thinks the first close brace ends the variable substitution.
  619. + test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
  620. + test -n "$verbose" && /bin/echo "    setting INSTALL_PROGRAM to $INSTALL_PROGRAM"
  621. + test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
  622. + test -n "$verbose" && /bin/echo "    setting INSTALL_DATA to $INSTALL_DATA"
  623. + if test -z "$RANLIB"; then
  624. +   # Extract the first word of `ranlib', so it can be a program name with args.
  625. +   set ac_dummy ranlib; ac_word=$2
  626. +   test -n "$silent" || /bin/echo "checking for $ac_word"
  627. +   IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  628. +   for ac_dir in $PATH; do
  629. +     test -z "$ac_dir" && ac_dir=.
  630. +     if test -f $ac_dir/$ac_word; then
  631. +       RANLIB="ranlib"
  632. +       break
  633. +     fi
  634. +   done
  635. +   IFS="$ac_save_ifs"
  636. + fi
  637. + test -z "$RANLIB" && RANLIB=":"
  638. + test -n "$RANLIB" && test -n "$verbose" && /bin/echo "    setting RANLIB to $RANLIB"
  639. + test -n "$silent" || /bin/echo "checking for ANSI C header files"
  640. + cat > conftest.${ac_ext} <<EOF
  641. + #include "confdefs.h"
  642. + #include <stdlib.h>
  643. + #include <stdarg.h>
  644. + #include <string.h>
  645. + #include <float.h>
  646. + EOF
  647. + # Some shells (Coherent) do redirections in the wrong order, so need
  648. + # the parens.
  649. + ac_err=`eval "($ac_cpp conftest.${ac_ext} >/dev/null) 2>&1"`
  650. + if test -z "$ac_err"; then
  651. +   rm -rf conftest*
  652. +   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
  653. + /bin/echo '#include "confdefs.h"
  654. + #include <string.h>' > conftest.${ac_ext}
  655. + eval "$ac_cpp conftest.${ac_ext} > conftest.out 2>&1"
  656. + if egrep "memchr" conftest.out >/dev/null 2>&1; then
  657. +   rm -rf conftest*
  658. +   # SGI's /bin/cc from Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
  659. + cat > conftest.${ac_ext} <<EOF
  660. + #include "confdefs.h"
  661. + #include <ctype.h>
  662. + #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
  663. + #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
  664. + #define XOR(e,f) (((e) && !(f)) || (!(e) && (f)))
  665. + int main () { int i; for (i = 0; i < 256; i++)
  666. + if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
  667. + exit (0); }
  668. + EOF
  669. + eval $ac_compile
  670. + if test -s conftest && (./conftest; exit) 2>/dev/null; then
  671. +   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
  672. + /bin/echo '#include "confdefs.h"
  673. + #include <stdlib.h>' > conftest.${ac_ext}
  674. + eval "$ac_cpp conftest.${ac_ext} > conftest.out 2>&1"
  675. + if egrep "free" conftest.out >/dev/null 2>&1; then
  676. +   rm -rf conftest*
  677. +   
  678. + {
  679. + test -n "$verbose" && \
  680. + /bin/echo "    defining STDC_HEADERS"
  681. + /bin/echo "#define" STDC_HEADERS "1" >> confdefs.h
  682. + DEFS="$DEFS -DSTDC_HEADERS=1"
  683. + ac_sed_defs="${ac_sed_defs}\${ac_dA}STDC_HEADERS\${ac_dB}STDC_HEADERS\${ac_dC}1\${ac_dD}
  684. + \${ac_uA}STDC_HEADERS\${ac_uB}STDC_HEADERS\${ac_uC}1\${ac_uD}
  685. + \${ac_eA}STDC_HEADERS\${ac_eB}STDC_HEADERS\${ac_eC}1\${ac_eD}
  686. + "
  687. + }
  688. + fi
  689. + rm -f conftest*
  690. + fi
  691. + rm -fr conftest*
  692. + fi
  693. + rm -f conftest*
  694. + fi
  695. + rm -f conftest*
  696. + # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
  697. + # for constant arguments.  Useless!
  698. + test -n "$silent" || /bin/echo "checking for working alloca.h"
  699. + cat > conftest.${ac_ext} <<EOF
  700. + #include "confdefs.h"
  701. + #include <alloca.h>
  702. + int main() { return 0; }
  703. + int t() { char *p = alloca(2 * sizeof(int));; return 0; }
  704. + EOF
  705. + if eval $ac_compile; then
  706. +   rm -rf conftest*
  707. +   
  708. + {
  709. + test -n "$verbose" && \
  710. + /bin/echo "    defining HAVE_ALLOCA_H"
  711. + /bin/echo "#define" HAVE_ALLOCA_H "1" >> confdefs.h
  712. + DEFS="$DEFS -DHAVE_ALLOCA_H=1"
  713. + ac_sed_defs="${ac_sed_defs}\${ac_dA}HAVE_ALLOCA_H\${ac_dB}HAVE_ALLOCA_H\${ac_dC}1\${ac_dD}
  714. + \${ac_uA}HAVE_ALLOCA_H\${ac_uB}HAVE_ALLOCA_H\${ac_uC}1\${ac_uD}
  715. + \${ac_eA}HAVE_ALLOCA_H\${ac_eB}HAVE_ALLOCA_H\${ac_eC}1\${ac_eD}
  716. + "
  717. + }
  718. + fi
  719. + rm -f conftest*
  720. + ac_decl="#ifdef __GNUC__
  721. + #define alloca __builtin_alloca
  722. + #else
  723. + #if HAVE_ALLOCA_H
  724. + #include <alloca.h>
  725. + #else
  726. + #ifdef _AIX
  727. +  #pragma alloca
  728. + #else
  729. + char *alloca ();
  730. + #endif
  731. + #endif
  732. + #endif
  733. + "
  734. + test -n "$silent" || /bin/echo "checking for alloca"
  735. + cat > conftest.${ac_ext} <<EOF
  736. + #include "confdefs.h"
  737. + $ac_decl
  738. + int main() { return 0; }
  739. + int t() { char *p = (char *) alloca(1);; return 0; }
  740. + EOF
  741. + if eval $ac_compile; then
  742. +   rm -rf conftest*
  743. +   
  744. + {
  745. + test -n "$verbose" && \
  746. + /bin/echo "    defining HAVE_ALLOCA"
  747. + /bin/echo "#define" HAVE_ALLOCA "1" >> confdefs.h
  748. + DEFS="$DEFS -DHAVE_ALLOCA=1"
  749. + ac_sed_defs="${ac_sed_defs}\${ac_dA}HAVE_ALLOCA\${ac_dB}HAVE_ALLOCA\${ac_dC}1\${ac_dD}
  750. + \${ac_uA}HAVE_ALLOCA\${ac_uB}HAVE_ALLOCA\${ac_uC}1\${ac_uD}
  751. + \${ac_eA}HAVE_ALLOCA\${ac_eB}HAVE_ALLOCA\${ac_eC}1\${ac_eD}
  752. + "
  753. + }
  754. + else
  755. +   rm -rf conftest*
  756. +   ac_alloca_missing=1
  757. + cat > conftest.${ac_ext} <<EOF
  758. + #include "confdefs.h"
  759. + #if defined(CRAY) && ! defined(CRAY2)
  760. + winnitude
  761. + #else
  762. + lossage
  763. + #endif
  764. + EOF
  765. + eval "$ac_cpp conftest.${ac_ext} > conftest.out 2>&1"
  766. + if egrep "winnitude" conftest.out >/dev/null 2>&1; then
  767. +   rm -rf conftest*
  768. +   test -n "$silent" || /bin/echo "checking for _getb67"
  769. + cat > conftest.${ac_ext} <<EOF
  770. + #include "confdefs.h"
  771. + #include <ctype.h>
  772. + int main() { return 0; }
  773. + int t() { 
  774. + /* The GNU C library defines this for functions which it implements
  775. +     to always fail with ENOSYS.  Some functions are actually named
  776. +     something starting with __ and the normal name is an alias.  */
  777. + #if defined (__stub__getb67) || defined (__stub____getb67)
  778. + choke me
  779. + #else
  780. + /* Override any gcc2 internal prototype to avoid an error.  */
  781. + extern char _getb67(); _getb67();
  782. + #endif
  783. + ; return 0; }
  784. + EOF
  785. + if eval $ac_compile; then
  786. +   rm -rf conftest*
  787. +   {
  788. + test -n "$verbose" && \
  789. + /bin/echo "    defining" CRAY_STACKSEG_END to be "_getb67"
  790. + /bin/echo "#define" CRAY_STACKSEG_END "_getb67" >> confdefs.h
  791. + DEFS="$DEFS -DCRAY_STACKSEG_END=_getb67"
  792. + ac_sed_defs="${ac_sed_defs}\${ac_dA}CRAY_STACKSEG_END\${ac_dB}CRAY_STACKSEG_END\${ac_dC}_getb67\${ac_dD}
  793. + \${ac_uA}CRAY_STACKSEG_END\${ac_uB}CRAY_STACKSEG_END\${ac_uC}_getb67\${ac_uD}
  794. + \${ac_eA}CRAY_STACKSEG_END\${ac_eB}CRAY_STACKSEG_END\${ac_eC}_getb67\${ac_eD}
  795. + "
  796. + }
  797. + else
  798. +   rm -rf conftest*
  799. +   test -n "$silent" || /bin/echo "checking for GETB67"
  800. + cat > conftest.${ac_ext} <<EOF
  801. + #include "confdefs.h"
  802. + #include <ctype.h>
  803. + int main() { return 0; }
  804. + int t() { 
  805. + /* The GNU C library defines this for functions which it implements
  806. +     to always fail with ENOSYS.  Some functions are actually named
  807. +     something starting with __ and the normal name is an alias.  */
  808. + #if defined (__stub_GETB67) || defined (__stub___GETB67)
  809. + choke me
  810. + #else
  811. + /* Override any gcc2 internal prototype to avoid an error.  */
  812. + extern char GETB67(); GETB67();
  813. + #endif
  814. + ; return 0; }
  815. + EOF
  816. + if eval $ac_compile; then
  817. +   rm -rf conftest*
  818. +   {
  819. + test -n "$verbose" && \
  820. + /bin/echo "    defining" CRAY_STACKSEG_END to be "GETB67"
  821. + /bin/echo "#define" CRAY_STACKSEG_END "GETB67" >> confdefs.h
  822. + DEFS="$DEFS -DCRAY_STACKSEG_END=GETB67"
  823. + ac_sed_defs="${ac_sed_defs}\${ac_dA}CRAY_STACKSEG_END\${ac_dB}CRAY_STACKSEG_END\${ac_dC}GETB67\${ac_dD}
  824. + \${ac_uA}CRAY_STACKSEG_END\${ac_uB}CRAY_STACKSEG_END\${ac_uC}GETB67\${ac_uD}
  825. + \${ac_eA}CRAY_STACKSEG_END\${ac_eB}CRAY_STACKSEG_END\${ac_eC}GETB67\${ac_eD}
  826. + "
  827. + }
  828. + else
  829. +   rm -rf conftest*
  830. +   test -n "$silent" || /bin/echo "checking for getb67"
  831. + cat > conftest.${ac_ext} <<EOF
  832. + #include "confdefs.h"
  833. + #include <ctype.h>
  834. + int main() { return 0; }
  835. + int t() { 
  836. + /* The GNU C library defines this for functions which it implements
  837. +     to always fail with ENOSYS.  Some functions are actually named
  838. +     something starting with __ and the normal name is an alias.  */
  839. + #if defined (__stub_getb67) || defined (__stub___getb67)
  840. + choke me
  841. + #else
  842. + /* Override any gcc2 internal prototype to avoid an error.  */
  843. + extern char getb67(); getb67();
  844. + #endif
  845. + ; return 0; }
  846. + EOF
  847. + if eval $ac_compile; then
  848. +   rm -rf conftest*
  849. +   {
  850. + test -n "$verbose" && \
  851. + /bin/echo "    defining" CRAY_STACKSEG_END to be "getb67"
  852. + /bin/echo "#define" CRAY_STACKSEG_END "getb67" >> confdefs.h
  853. + DEFS="$DEFS -DCRAY_STACKSEG_END=getb67"
  854. + ac_sed_defs="${ac_sed_defs}\${ac_dA}CRAY_STACKSEG_END\${ac_dB}CRAY_STACKSEG_END\${ac_dC}getb67\${ac_dD}
  855. + \${ac_uA}CRAY_STACKSEG_END\${ac_uB}CRAY_STACKSEG_END\${ac_uC}getb67\${ac_uD}
  856. + \${ac_eA}CRAY_STACKSEG_END\${ac_eB}CRAY_STACKSEG_END\${ac_eC}getb67\${ac_eD}
  857. + "
  858. + }
  859. + fi
  860. + rm -f conftest*
  861. + fi
  862. + rm -f conftest*
  863. + fi
  864. + rm -f conftest*
  865. + fi
  866. + rm -f conftest*
  867. + fi
  868. + rm -f conftest*
  869. + if test -n "$ac_alloca_missing"; then
  870. +   # The SVR3 libPW and SVR4 libucb both contain incompatible functions
  871. +   # that cause trouble.  Some versions do not even contain alloca or
  872. +   # contain a buggy version.  If you still want to use their alloca,
  873. +   # use ar to extract alloca.o from them instead of compiling alloca.c.
  874. +   ALLOCA=alloca.o
  875. +   
  876. + {
  877. + test -n "$verbose" && \
  878. + /bin/echo "    defining C_ALLOCA"
  879. + /bin/echo "#define" C_ALLOCA "1" >> confdefs.h
  880. + DEFS="$DEFS -DC_ALLOCA=1"
  881. + ac_sed_defs="${ac_sed_defs}\${ac_dA}C_ALLOCA\${ac_dB}C_ALLOCA\${ac_dC}1\${ac_dD}
  882. + \${ac_uA}C_ALLOCA\${ac_uB}C_ALLOCA\${ac_uC}1\${ac_uD}
  883. + \${ac_eA}C_ALLOCA\${ac_eB}C_ALLOCA\${ac_eC}1\${ac_eD}
  884. + "
  885. + }
  886. +   test -n "$silent" || /bin/echo "checking stack direction for C alloca"
  887. +   test -n "$silent" || /bin/echo "checking whether cross-compiling"
  888. + # If we cannot run a trivial program, we must be cross compiling.
  889. + cat > conftest.${ac_ext} <<EOF
  890. + #include "confdefs.h"
  891. + main(){exit(0);}
  892. + EOF
  893. + eval $ac_compile
  894. + if test -s conftest && (./conftest; exit) 2>/dev/null; then
  895. +   :
  896. + else
  897. +   cross_compiling=1
  898. + fi
  899. + rm -fr conftest*
  900. + if test -n "$cross_compiling"
  901. + then
  902. +   
  903. + {
  904. + test -n "$verbose" && \
  905. + /bin/echo "    defining" STACK_DIRECTION to be "0"
  906. + /bin/echo "#define" STACK_DIRECTION "0" >> confdefs.h
  907. + DEFS="$DEFS -DSTACK_DIRECTION=0"
  908. + ac_sed_defs="${ac_sed_defs}\${ac_dA}STACK_DIRECTION\${ac_dB}STACK_DIRECTION\${ac_dC}0\${ac_dD}
  909. + \${ac_uA}STACK_DIRECTION\${ac_uB}STACK_DIRECTION\${ac_uC}0\${ac_uD}
  910. + \${ac_eA}STACK_DIRECTION\${ac_eB}STACK_DIRECTION\${ac_eC}0\${ac_eD}
  911. + "
  912. + }
  913. + else
  914. + cat > conftest.${ac_ext} <<EOF
  915. + #include "confdefs.h"
  916. + find_stack_direction ()
  917. + {
  918. +   static char *addr = 0;
  919. +   auto char dummy;
  920. +   if (addr == 0)
  921. +     {
  922. +       addr = &dummy;
  923. +       return find_stack_direction ();
  924. +     }
  925. +   else
  926. +     return (&dummy > addr) ? 1 : -1;
  927. + }
  928. + main ()
  929. + {
  930. +   exit (find_stack_direction() < 0);
  931. + }
  932. + EOF
  933. + eval $ac_compile
  934. + if test -s conftest && (./conftest; exit) 2>/dev/null; then
  935. +   
  936. + {
  937. + test -n "$verbose" && \
  938. + /bin/echo "    defining" STACK_DIRECTION to be "1"
  939. + /bin/echo "#define" STACK_DIRECTION "1" >> confdefs.h
  940. + DEFS="$DEFS -DSTACK_DIRECTION=1"
  941. + ac_sed_defs="${ac_sed_defs}\${ac_dA}STACK_DIRECTION\${ac_dB}STACK_DIRECTION\${ac_dC}1\${ac_dD}
  942. + \${ac_uA}STACK_DIRECTION\${ac_uB}STACK_DIRECTION\${ac_uC}1\${ac_uD}
  943. + \${ac_eA}STACK_DIRECTION\${ac_eB}STACK_DIRECTION\${ac_eC}1\${ac_eD}
  944. + "
  945. + }
  946. + else
  947. +   
  948. + {
  949. + test -n "$verbose" && \
  950. + /bin/echo "    defining" STACK_DIRECTION to be "-1"
  951. + /bin/echo "#define" STACK_DIRECTION "-1" >> confdefs.h
  952. + DEFS="$DEFS -DSTACK_DIRECTION=-1"
  953. + ac_sed_defs="${ac_sed_defs}\${ac_dA}STACK_DIRECTION\${ac_dB}STACK_DIRECTION\${ac_dC}-1\${ac_dD}
  954. + \${ac_uA}STACK_DIRECTION\${ac_uB}STACK_DIRECTION\${ac_uC}-1\${ac_uD}
  955. + \${ac_eA}STACK_DIRECTION\${ac_eB}STACK_DIRECTION\${ac_eC}-1\${ac_eD}
  956. + "
  957. + }
  958. + fi
  959. + fi
  960. + rm -fr conftest*
  961. + fi
  962. + # The preferred way to propogate these variables is regular @ substitutions.
  963. + if test -n "$prefix"; then
  964. +   ac_prsub="s%^prefix\\([     ]*\\)=\\([     ]*\\).*$%prefix\\1=\\2$prefix%"
  965. + else
  966. +   prefix=/usr/local
  967. + fi
  968. + if test -n "$exec_prefix"; then
  969. +   ac_prsub="$ac_prsub
  970. + s%^exec_prefix\\([     ]*\\)=\\([     ]*\\).*$%exec_prefix\\1=\\2$exec_prefix%"
  971. + else
  972. +   exec_prefix='${prefix}' # Let make expand it.
  973. + fi
  974. + # Any assignment to VPATH causes Sun make to only execute
  975. + # the first set of double-colon rules, so remove it if not needed.
  976. + # If there is a colon in the path, we need to keep it.
  977. + if test "x$srcdir" = x.; then
  978. +   ac_vpsub='/^[     ]*VPATH[     ]*=[^:]*$/d'
  979. + fi
  980. + # Quote sed substitution magic chars in DEFS.
  981. + cat >conftest.def <<EOF
  982. + $DEFS
  983. + EOF
  984. + ac_escape_ampersand_and_backslash='s%[&\\]%\\&%g'
  985. + DEFS=`sed "$ac_escape_ampersand_and_backslash" <conftest.def`
  986. + rm -f conftest.def
  987. + # Substitute for predefined variables.
  988. + trap 'rm -f config.status; exit 1' 1 2 15
  989. + /bin/echo creating config.status
  990. + # Some systems, like AmigaDOS, won't allow you to remove a script that is
  991. + # being executed, so just move it out of the way instead.
  992. + if test -f config.status; then mv config.status config.status.old; else true; fi
  993. + cat > config.status <<EOF
  994. + #!/bin/sh
  995. + # Generated automatically by configure.
  996. + # Run this file to recreate the current configuration.
  997. + # This directory was configured as follows,
  998. + # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
  999. + #
  1000. + # $0 $configure_args
  1001. + ac_cs_usage="Usage: config.status [--recheck] [--version] [--help]"
  1002. + for ac_option
  1003. + do
  1004. +   case "\$ac_option" in
  1005. +   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  1006. +     /bin/echo running \${CONFIG_SHELL-/bin/sh} $0 $configure_args --no-create
  1007. +     exec \${CONFIG_SHELL-/bin/sh} $0 $configure_args --no-create ;;
  1008. +   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
  1009. +     /bin/echo "config.status generated by autoconf version 1.11"
  1010. +     exit 0 ;;
  1011. +   -help | --help | --hel | --he | --h)
  1012. +     /bin/echo "\$ac_cs_usage"; exit 0 ;;
  1013. +   *) /bin/echo "\$ac_cs_usage"; exit 1 ;;
  1014. +   esac
  1015. + done
  1016. + trap 'rm -fr Makefile sh/Makefile sh/config.h conftest*; exit 1' 1 2 15
  1017. + CC='$CC'
  1018. + CFLAGS='$CFLAGS'
  1019. + LDFLAGS='$LDFLAGS'
  1020. + CPP='$CPP'
  1021. + INSTALL='$INSTALL'
  1022. + INSTALL_PROGRAM='$INSTALL_PROGRAM'
  1023. + INSTALL_DATA='$INSTALL_DATA'
  1024. + RANLIB='$RANLIB'
  1025. + ALLOCA='$ALLOCA'
  1026. + LIBS='$LIBS'
  1027. + srcdir='$srcdir'
  1028. + top_srcdir='$top_srcdir'
  1029. + prefix='$prefix'
  1030. + exec_prefix='$exec_prefix'
  1031. + ac_prsub='$ac_prsub'
  1032. + ac_vpsub='$ac_vpsub'
  1033. + extrasub='$extrasub'
  1034. + EOF
  1035. + cat >> config.status <<\EOF
  1036. + ac_given_srcdir=$srcdir
  1037. + CONFIG_FILES=${CONFIG_FILES-"Makefile sh/Makefile"}
  1038. + for ac_file in .. ${CONFIG_FILES}; do if test "x$ac_file" != x..; then
  1039. +   # Remove last slash and all that follows it.  Not all systems have dirname.
  1040. +   ac_dir=`/bin/echo $ac_file|sed 's%/[^/][^/]*$%%'`
  1041. +   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
  1042. +     # The file is in a subdirectory.
  1043. +     test ! -d "$ac_dir" && mkdir "$ac_dir"
  1044. +     ac_dir_suffix="/$ac_dir"
  1045. +   else
  1046. +     ac_dir_suffix=
  1047. +   fi
  1048. +   # A "../" for each directory in $ac_dir_suffix.
  1049. +   ac_dots=`/bin/echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
  1050. +   case "$ac_given_srcdir" in
  1051. +   .)  srcdir=.
  1052. +       if test -z "$ac_dir_suffix"; then top_srcdir=.
  1053. +       else top_srcdir=`/bin/echo $ac_dots|sed 's%/$%%'`; fi ;;
  1054. +   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
  1055. +   *) # Relative path.
  1056. +     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
  1057. +     top_srcdir="$ac_dots$ac_given_srcdir" ;;
  1058. +   esac
  1059. +   /bin/echo creating "$ac_file"
  1060. +   rm -f "$ac_file"
  1061. +   comment_str="Generated automatically from `/bin/echo $ac_file|sed 's|.*/||'`.in by configure."
  1062. +   case "$ac_file" in
  1063. +     *.c | *.h | *.C | *.cc | *.m )  /bin/echo "/* $comment_str */" > "$ac_file" ;;
  1064. +     * )          /bin/echo "# $comment_str"     > "$ac_file" ;;
  1065. +   esac
  1066. +   sed -e "
  1067. + $ac_prsub
  1068. + $ac_vpsub
  1069. + $extrasub
  1070. + s%@CC@%$CC%g
  1071. + s%@CFLAGS@%$CFLAGS%g
  1072. + s%@LDFLAGS@%$LDFLAGS%g
  1073. + s%@CPP@%$CPP%g
  1074. + s%@INSTALL@%$INSTALL%g
  1075. + s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
  1076. + s%@INSTALL_DATA@%$INSTALL_DATA%g
  1077. + s%@RANLIB@%$RANLIB%g
  1078. + s%@ALLOCA@%$ALLOCA%g
  1079. + s%@LIBS@%$LIBS%g
  1080. + s%@srcdir@%$srcdir%g
  1081. + s%@top_srcdir@%$top_srcdir%g
  1082. + s%@prefix@%$prefix%g
  1083. + s%@exec_prefix@%$exec_prefix%g
  1084. + s%@DEFS@%-DHAVE_CONFIG_H%" $ac_given_srcdir/${ac_file}.in >> $ac_file
  1085. + fi; done
  1086. + # These sed commands are put into ac_sed_defs when defining a macro.
  1087. + # They are broken into pieces to make the sed script easier to manage.
  1088. + # They are passed to sed as "A NAME B NAME C VALUE D", where NAME
  1089. + # is the cpp macro being defined and VALUE is the value it is being given.
  1090. + # Each defining turns into a single global substitution command.
  1091. + # Hopefully no one uses "!" as a variable value.
  1092. + # Other candidates for the sed separators, like , and @, do get used.
  1093. + #
  1094. + # ac_d sets the value in "#define NAME VALUE" lines.
  1095. + ac_dA='s!^\([     ]*\)#\([     ]*define[     ][     ]*\)'
  1096. + ac_dB='\([     ][     ]*\)[^     ]*!\1#\2'
  1097. + ac_dC='\3'
  1098. + ac_dD='!g'
  1099. + # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
  1100. + ac_uA='s!^\([     ]*\)#\([     ]*\)undef\([     ][     ]*\)'
  1101. + ac_uB='\([     ]\)!\1#\2define\3'
  1102. + ac_uC=' '
  1103. + ac_uD='\4!g'
  1104. + # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
  1105. + ac_eA='s!^\([     ]*\)#\([     ]*\)undef\([     ][     ]*\)'
  1106. + ac_eB='$!\1#\2define\3'
  1107. + ac_eC=' '
  1108. + ac_eD='!g'
  1109. + rm -f conftest.sed
  1110. + EOF
  1111. + # Turn off quoting long enough to insert the sed commands.
  1112. + rm -f conftest.sh
  1113. + cat > conftest.sh <<EOF
  1114. + $ac_sed_defs
  1115. + EOF
  1116. + # Break up $ac_sed_defs (now in conftest.sh) because some shells have a limit
  1117. + # on the size of here documents.
  1118. + # Maximum number of lines to put in a single here document.
  1119. + ac_max_sh_lines=9
  1120. + while :
  1121. + do
  1122. +   # wc gives bogus results for an empty file on some AIX systems.
  1123. +   ac_lines=`grep -c . conftest.sh`
  1124. +   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
  1125. +   rm -f conftest.s1 conftest.s2
  1126. +   sed ${ac_max_sh_lines}q conftest.sh > conftest.s1 # Like head -9.
  1127. +   sed 1,${ac_max_sh_lines}d conftest.sh > conftest.s2 # Like tail +10.
  1128. +   # Write a limited-size here document to append to conftest.sed.
  1129. +   /bin/echo 'cat >> conftest.sed <<CONFEOF' >> config.status
  1130. +   cat conftest.s1 >> config.status
  1131. +   /bin/echo 'CONFEOF' >> config.status
  1132. +   rm -f conftest.s1 conftest.sh
  1133. +   mv conftest.s2 conftest.sh
  1134. + done
  1135. + rm -f conftest.sh
  1136. + # Now back to your regularly scheduled config.status.
  1137. + cat >> config.status <<\EOF
  1138. + # This sed command replaces #undef's with comments.  This is necessary, for
  1139. + # example, in the case of _POSIX_SOURCE, which is predefined and required
  1140. + # on some systems where configure will not decide to define it in
  1141. + # sh/config.h.
  1142. + cat >> conftest.sed <<\CONFEOF
  1143. + s,^[     ]*#[     ]*undef[     ][     ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
  1144. + CONFEOF
  1145. + rm -f conftest.h
  1146. + # Break up the sed commands because old seds have small limits.
  1147. + ac_max_sed_lines=20
  1148. + CONFIG_HEADERS=${CONFIG_HEADERS-"sh/config.h"}
  1149. + for ac_file in .. ${CONFIG_HEADERS}; do if test "x$ac_file" != x..; then
  1150. +   /bin/echo creating $ac_file
  1151. +   cp $ac_given_srcdir/$ac_file.in conftest.h1
  1152. +   cp conftest.sed conftest.stm
  1153. +   while :
  1154. +   do
  1155. +     ac_lines=`grep -c . conftest.stm`
  1156. +     if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
  1157. +     rm -f conftest.s1 conftest.s2 conftest.h2
  1158. +     sed ${ac_max_sed_lines}q conftest.stm > conftest.s1 # Like head -20.
  1159. +     sed 1,${ac_max_sed_lines}d conftest.stm > conftest.s2 # Like tail +21.
  1160. +     sed -f conftest.s1 < conftest.h1 > conftest.h2
  1161. +     rm -f conftest.s1 conftest.h1 conftest.stm
  1162. +     mv conftest.h2 conftest.h1
  1163. +     mv conftest.s2 conftest.stm
  1164. +   done
  1165. +   rm -f conftest.stm conftest.h
  1166. +   /bin/echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
  1167. +   cat conftest.h1 >> conftest.h
  1168. +   rm -f conftest.h1
  1169. +   if cmp -s $ac_file conftest.h 2>/dev/null; then
  1170. +     # The file exists and we would not be changing it.
  1171. +     /bin/echo "$ac_file is unchanged"
  1172. +     rm -f conftest.h
  1173. +   else
  1174. +     rm -f $ac_file
  1175. +     mv conftest.h $ac_file
  1176. +   fi
  1177. + fi; done
  1178. + rm -f conftest.sed
  1179. + exit 0
  1180. + EOF
  1181. + chmod +x config.status
  1182. + # Some shells look in PATH for config.status without the "./".
  1183. + test -n "$no_create" || ${CONFIG_SHELL-/bin/sh} ./config.status
  1184. diff -rc --new-file pdksh-4.9/configure.in /gnu/src/amiga/pdksh-4.9/configure.in
  1185. *** pdksh-4.9/configure.in    Thu Jan  1 00:00:00 1970
  1186. --- /gnu/src/amiga/pdksh-4.9/configure.in    Tue Jun 14 09:37:39 1994
  1187. ***************
  1188. *** 0 ****
  1189. --- 1,23 ----
  1190. + dnl Process this file with autoconf to produce a configure script.
  1191. + AC_INIT(sh/sh.h)
  1192. + AC_CONFIG_HEADER(sh/config.h)
  1193. + # We want these before the checks, so the checks can modify their values.
  1194. + test -z "$CFLAGS" && CFLAGS= auto_cflags=1
  1195. + test -z "$LDFLAGS" && LDFLAGS=
  1196. + AC_PROG_CC
  1197. + # If we're using gcc and the user hasn't specified CFLAGS, add -O to CFLAGS.
  1198. + test -n "$GCC" && test -n "$auto_cflags" && CFLAGS="$CFLAGS -O2"
  1199. + AC_SUBST(CFLAGS)dnl
  1200. + AC_SUBST(LDFLAGS)dnl
  1201. + AC_PROG_CPP
  1202. + AC_GCC_TRADITIONAL
  1203. + AC_PROG_INSTALL
  1204. + AC_PROG_RANLIB
  1205. + AC_STDC_HEADERS
  1206. + AC_ALLOCA
  1207. + AC_OUTPUT(Makefile sh/Makefile)
  1208. diff -rc --new-file pdksh-4.9/sh/Makefile /gnu/src/amiga/pdksh-4.9/sh/Makefile
  1209. *** pdksh-4.9/sh/Makefile    Wed May  4 14:46:32 1994
  1210. --- /gnu/src/amiga/pdksh-4.9/sh/Makefile    Thu Jan  1 00:00:00 1970
  1211. ***************
  1212. *** 1,317 ****
  1213. - # PD Bourne/Korn Shell
  1214. - # $Id: Makefile,v 1.6 93/05/08 15:59:56 sjg Exp $
  1215. - # Makefile is setup for 386bsd
  1216. - SHELL = /bin/sh
  1217. - MAKE  = make
  1218. - LN    = ln -s
  1219. - CHMOD=chmod
  1220. - prefix=/usr/local
  1221. - target=$(prefix)/bin/ksh
  1222. - # You _can_ build this shell without the ../std tree if your
  1223. - # system provides a sufficiently POSIX environment, or if your
  1224. - # BSD system is a Sun or close.  If not try ../std.
  1225. - # gcc is good value on most mc68k's and sun386's if nothing else.
  1226. - # if you don't have gcc cc should do
  1227. - # CC=gcc -pipe
  1228. - CC=gcc -pipe 
  1229. - # The following are the defintions used (or thereabouts) 
  1230. - # to build ksh without ../std
  1231. - #
  1232. - # sun386 SunOS 4.0.2, sun3 SunOS 4.0.3
  1233. - # SYSFLAGS=-D_BSD
  1234. - # XOPTS=-DNOSTDHDRS
  1235. - # copy these from ../std/stdc or ensure they are in libstdc.a
  1236. - # XOBJS = memmove.o strstr.o 
  1237. - #
  1238. - # sun3  SunOS 4.1.1
  1239. - # SYSFLAGS=-D_BSD
  1240. - # XOPTS=-DNOSTDHDRS
  1241. - # copy these from ../std/stdc or ensure they are in libstdc.a
  1242. - # XOBJS = memmove.o
  1243. - #
  1244. - # sun4c (sparc) SunOS 4.1.1
  1245. - # CC=cc -pipe    # don't use gcc
  1246. - # SYSFLAGS=-D_BSD
  1247. - # XOPTS=-DNOSTDHDRS
  1248. - # copy these from ../std/stdc or ensure they are in libstdc.a
  1249. - # XOBJS = memmove.o
  1250. - #
  1251. - # Bull DPX/2 B.O.S. 2.00.45
  1252. - # CC=gcc -ansi
  1253. - # SYSFLAGS=-D_POSIX_SOURCE
  1254. - # XOPTS=
  1255. - # XOBJS=
  1256. - #
  1257. - # Minix-386 1.5.10 with estdio
  1258. - # SYSFLAGS= -D_BSD -D_MINIX -D_POSIX_SOURCE
  1259. - # XOPTS=
  1260. - # XOBJS=
  1261. - #
  1262. - # 386bsd-0.1 pk 0.2.3
  1263. - # SYSFLAGS= -D_BSD -D_POSIX_TERM
  1264. - # XOPTS=
  1265. - # XOBJS=
  1266. - #
  1267. - # BSD/386
  1268. - # SYSFLAGS= -D_BSDI -D_POSIX_TERM -D_POSIX_SOURCE
  1269. - # XOPTS=
  1270. - # XOBJS=
  1271. - #SYSFLAGS= -D_SYSV
  1272. - #SYSFLAGS= -D_BSD -DHAVE_SYS_STDTYPES
  1273. - #SYSFLAGS= -D_BSD 
  1274. - SYSFLAGS= -D_BSD -D_POSIX_TERM
  1275. - CONFLAGS=-DCOMPLEX_HISTORY
  1276. - CONFIG=$(SYSFLAGS) $(CONFLAGS)
  1277. - STD=../std
  1278. - INCL=$(STD)/h
  1279. - #XINCL=-I$(INCL)
  1280. - LDOPTS=-L$(STD)
  1281. - XOBJS=
  1282. - # use -O if you trust it :-)
  1283. - DBG=-g -O
  1284. - CFLAGS = $(DBG) $(CONFIG) $(XINCL) $(XOPTS)
  1285. - LDFLAGS = $(DBG) 
  1286. - COMPATLIBS = #$(LDOPTS) -lstdc -lposix
  1287. - #XLIBS = -lc_s
  1288. - #XLIBS = -ldirent
  1289. - LDLIBS = $(COMPATLIBS) $(XLIBS)
  1290. - HDRS =    sh.h table.h expand.h lex.h tree.h tty.h trace.h
  1291. - SRCS1 =    version.c main.c misc.c trap.c alloc.c io.c \
  1292. -     syn.c lex.c edit.c emacs.c vi.c history.c tree.c 
  1293. - SRCS2 =    exec.c jobs.c \
  1294. -     c_sh.c c_ksh.c c_test.c getopts.c do_ulimit.c \
  1295. -     var.c table.c eval.c expr.c mail.c sigact.c trace.c
  1296. - SRCS =    Makefile $(HDRS) $(SRCS1) $(SRCS2) 
  1297. - OBJS =    version.o main.o misc.o \
  1298. -     syn.o lex.o edit.o emacs.o vi.o tree.o \
  1299. -     exec.o jobs.o trap.o \
  1300. -     c_sh.o c_ksh.o c_test.o \
  1301. -     do_ulimit.o getopts.o expr.o history.o \
  1302. -     var.o table.o alloc.o io.o eval.o mail.o sigact.o trace.o $(XOBJS)
  1303. - ksh: $(OBJS) 
  1304. -     $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LDLIBS)
  1305. - clean:
  1306. -     rm -f *.o *.out core
  1307. - clobber: clean
  1308. -     rm -f ksh
  1309. - link:
  1310. -     ($(SHELL) ../std/mklinks ../std/h stdh.h)
  1311. -     
  1312. - depend:
  1313. -     makedepend $(CFLAGS) $(SRCS1) $(SRCS2)
  1314. - install:
  1315. -     -if test -f $(target); then mv $(target) $(target).old; fi
  1316. -     cp ksh $(target)
  1317. -     $(CHMOD) 755 $(target)
  1318. - .c.s:
  1319. -     $(CC) $(CFLAGS) -S -o $@ $<
  1320. - asms: $(OBJS:.o=.s)
  1321. - # DO NOT DELETE THIS LINE -- make depend depends on it.
  1322. - # If this runs make out of memory, delete /usr/include lines.
  1323. - alloc.o: alloc.c
  1324. - alloc.o: config.h
  1325. - alloc.o: sh.h
  1326. - alloc.o: stdh.h
  1327. - alloc.o: trace.h
  1328. - c_ksh.o: c_ksh.c
  1329. - c_ksh.o: config.h
  1330. - c_ksh.o: sh.h
  1331. - c_ksh.o: stdh.h
  1332. - c_ksh.o: table.h
  1333. - c_ksh.o: trace.h
  1334. - c_sh.o: c_sh.c
  1335. - c_sh.o: config.h
  1336. - c_sh.o: lex.h
  1337. - c_sh.o: sh.h
  1338. - c_sh.o: stdh.h
  1339. - c_sh.o: table.h
  1340. - c_sh.o: trace.h
  1341. - c_sh.o: tree.h
  1342. - c_test.o: c_test.c
  1343. - c_test.o: config.h
  1344. - c_test.o: sh.h
  1345. - c_test.o: stdh.h
  1346. - c_test.o: trace.h
  1347. - edit.o: config.h
  1348. - edit.o: edit.c
  1349. - edit.o: edit.h
  1350. - edit.o: lex.h
  1351. - edit.o: sh.h
  1352. - edit.o: stdh.h
  1353. - edit.o: trace.h
  1354. - edit.o: tty.h
  1355. - emacs.o: config.h
  1356. - emacs.o: edit.h
  1357. - emacs.o: emacs.c
  1358. - emacs.o: expand.h
  1359. - emacs.o: lex.h
  1360. - emacs.o: sh.h
  1361. - emacs.o: stdh.h
  1362. - emacs.o: table.h
  1363. - emacs.o: trace.h
  1364. - emacs.o: tree.h
  1365. - eval.o: config.h
  1366. - eval.o: eval.c
  1367. - eval.o: expand.h
  1368. - eval.o: lex.h
  1369. - eval.o: sh.h
  1370. - eval.o: stdh.h
  1371. - eval.o: table.h
  1372. - eval.o: trace.h
  1373. - eval.o: tree.h
  1374. - exec.o: config.h
  1375. - exec.o: exec.c
  1376. - exec.o: lex.h
  1377. - exec.o: sh.h
  1378. - exec.o: stdh.h
  1379. - exec.o: table.h
  1380. - exec.o: trace.h
  1381. - exec.o: tree.h
  1382. - expr.o: config.h
  1383. - expr.o: expr.c
  1384. - expr.o: sh.h
  1385. - expr.o: stdh.h
  1386. - expr.o: table.h
  1387. - expr.o: trace.h
  1388. - getopts.o: config.h
  1389. - getopts.o: getopts.c
  1390. - getopts.o: sh.h
  1391. - getopts.o: stdh.h
  1392. - getopts.o: table.h
  1393. - getopts.o: trace.h
  1394. - history.o: config.h
  1395. - history.o: history.c
  1396. - history.o: lex.h
  1397. - history.o: sh.h
  1398. - history.o: stdh.h
  1399. - history.o: trace.h
  1400. - io.o: config.h
  1401. - io.o: io.c
  1402. - io.o: sh.h
  1403. - io.o: stdh.h
  1404. - io.o: trace.h
  1405. - jobs.o: config.h
  1406. - jobs.o: jobs.c
  1407. - jobs.o: sh.h
  1408. - jobs.o: stdh.h
  1409. - jobs.o: trace.h
  1410. - jobs.o: tree.h
  1411. - lex.o: config.h
  1412. - lex.o: expand.h
  1413. - lex.o: lex.c
  1414. - lex.o: lex.h
  1415. - lex.o: sh.h
  1416. - lex.o: stdh.h
  1417. - lex.o: table.h
  1418. - lex.o: trace.h
  1419. - lex.o: tree.h
  1420. - mail.o: config.h
  1421. - mail.o: mail.c
  1422. - mail.o: sh.h
  1423. - mail.o: stdh.h
  1424. - mail.o: table.h
  1425. - mail.o: trace.h
  1426. - main.o: config.h
  1427. - main.o: lex.h
  1428. - main.o: main.c
  1429. - main.o: sh.h
  1430. - main.o: stdh.h
  1431. - main.o: table.h
  1432. - main.o: trace.h
  1433. - main.o: tree.h
  1434. - memmove.o: memmove.c
  1435. - memmove.o: stdh.h
  1436. - misc.o: config.h
  1437. - misc.o: expand.h
  1438. - misc.o: misc.c
  1439. - misc.o: sh.h
  1440. - misc.o: stdh.h
  1441. - misc.o: trace.h
  1442. - strstr.o: stdh.h
  1443. - strstr.o: strstr.c
  1444. - syn.o: config.h
  1445. - syn.o: expand.h
  1446. - syn.o: lex.h
  1447. - syn.o: sh.h
  1448. - syn.o: stdh.h
  1449. - syn.o: syn.c
  1450. - syn.o: table.h
  1451. - syn.o: trace.h
  1452. - syn.o: tree.h
  1453. - sigact.o: sigact.h sigact.c
  1454. - table.o: config.h
  1455. - table.o: sh.h
  1456. - table.o: stdh.h
  1457. - table.o: table.c
  1458. - table.o: table.h
  1459. - table.o: trace.h
  1460. - times.o: times.c
  1461. - trace.o: trace.c
  1462. - trap.o: config.h
  1463. - trap.o: sh.h
  1464. - trap.o: stdh.h
  1465. - trap.o: trace.h
  1466. - trap.o: trap.c
  1467. - tree.o: config.h
  1468. - tree.o: sh.h
  1469. - tree.o: stdh.h
  1470. - tree.o: trace.h
  1471. - tree.o: tree.c
  1472. - tree.o: tree.h
  1473. - do_ulimit.o: config.h
  1474. - do_ulimit.o: sh.h
  1475. - do_ulimit.o: stdh.h
  1476. - do_ulimit.o: trace.h
  1477. - do_ulimit.o: do_ulimit.c
  1478. - var.o: config.h
  1479. - var.o: expand.h
  1480. - var.o: sh.h
  1481. - var.o: stdh.h
  1482. - var.o: table.h
  1483. - var.o: trace.h
  1484. - var.o: var.c
  1485. - version.o: config.h
  1486. - version.o: sh.h
  1487. - version.o: stdh.h
  1488. - version.o: trace.h
  1489. - version.o: version.c
  1490. - vi.o: config.h
  1491. - vi.o: edit.h
  1492. - vi.o: expand.h
  1493. - vi.o: lex.h
  1494. - vi.o: sh.h
  1495. - vi.o: stdh.h
  1496. - vi.o: table.h
  1497. - vi.o: trace.h
  1498. - vi.o: tree.h
  1499. - vi.o: vi.c
  1500. - # WARNING: Put nothing here or make depend will gobble it up!
  1501. --- 0 ----
  1502. diff -rc --new-file pdksh-4.9/sh/Makefile.in /gnu/src/amiga/pdksh-4.9/sh/Makefile.in
  1503. *** pdksh-4.9/sh/Makefile.in    Thu Jan  1 00:00:00 1970
  1504. --- /gnu/src/amiga/pdksh-4.9/sh/Makefile.in    Sat Jul  9 12:17:14 1994
  1505. ***************
  1506. *** 0 ****
  1507. --- 1,283 ----
  1508. + # PD Bourne/Korn Shell
  1509. + # $Id: Makefile,v 1.6 93/05/08 15:59:56 sjg Exp $
  1510. + #### Start of system configuration section. ####
  1511. + VPATH = @srcdir@
  1512. + srcdir = @srcdir@
  1513. + # Common prefix for machine-independent installed files.
  1514. + prefix = /gnu
  1515. + # Common prefix for machine-dependent installed files.
  1516. + exec_prefix = $(prefix)
  1517. + # Directory to install executables in.
  1518. + bindir = $(exec_prefix)/bin
  1519. + # Directory to install libraries in.
  1520. + libdir = $(exec_prefix)/lib
  1521. + # Directory to install the Info files in.
  1522. + infodir = $(prefix)/info
  1523. + # Directory to install the man page in.
  1524. + mandir = $(prefix)/man/man$(manext)
  1525. + # Number to put on the man page filename.
  1526. + manext = 1
  1527. + # Program to install executables.
  1528. + INSTALL_PROGRAM = @INSTALL_PROGRAM@
  1529. + # Program to install data like man pages.
  1530. + INSTALL_DATA = @INSTALL_DATA@
  1531. + # Generic install program.
  1532. + INSTALL = @INSTALL@
  1533. + # For now we need to use an older gcc, so name it explicitly.
  1534. + #CC = @CC@
  1535. + CC=gcc-2.3.3
  1536. + DEFS = @DEFS@ -D_BSD -DUSE_TRACE -DDEBUG_AFREE
  1537. + CFLAGS = @CFLAGS@ -resident
  1538. + LDFLAGS = @LDFLAGS@ -resident
  1539. + LIBS = @LIBS@
  1540. + # AmigaDOS hack.  Symbolic links are available, but the actual link
  1541. + # name needs to be AmigaDOS format (device:path1/path2/...).  When
  1542. + # ixemul.library makes them in this format, this can be enabled.
  1543. + #LN_S = @LN_S@
  1544. + LN_S = cp
  1545. + #### End of system configuration section. ####
  1546. + # "-I." is needed to find config.h in the build directory.
  1547. + .c.o:
  1548. +     $(CC) -c -I. -I$(srcdir) $(DEFS) $(CFLAGS) $< $(OUTPUT_OPTION)
  1549. + SHELL =    /bin/sh
  1550. + MAKE  = make
  1551. + CHMOD =    chmod
  1552. + XOBJS=amiga.o
  1553. + COMPATLIBS =
  1554. + LDLIBS = $(COMPATLIBS) $(XLIBS)
  1555. + HDRS =    sh.h table.h expand.h lex.h tree.h tty.h trace.h
  1556. + SRCS1 =    version.c main.c misc.c trap.c alloc.c io.c \
  1557. +     syn.c lex.c edit.c emacs.c vi.c history.c tree.c 
  1558. + SRCS2 =    exec.c jobs.c \
  1559. +     c_sh.c c_ksh.c c_test.c getopts.c do_ulimit.c \
  1560. +     var.c table.c eval.c expr.c mail.c sigact.c trace.c
  1561. + SRCS =    Makefile $(HDRS) $(SRCS1) $(SRCS2) 
  1562. + OBJS =    version.o main.o misc.o \
  1563. +     syn.o lex.o edit.o emacs.o vi.o tree.o \
  1564. +     exec.o jobs.o trap.o \
  1565. +     c_sh.o c_ksh.o c_test.o \
  1566. +     do_ulimit.o getopts.o expr.o history.o \
  1567. +     var.o table.o alloc.o io.o eval.o mail.o sigact.o trace.o $(XOBJS)
  1568. + ksh: $(OBJS) 
  1569. +     $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LDLIBS)
  1570. + clean:
  1571. +     rm -f *.o *.out core
  1572. + clobber: clean
  1573. +     rm -f ksh
  1574. + link:
  1575. +     ($(SHELL) ../std/mklinks ../std/h stdh.h)
  1576. +     
  1577. + depend:
  1578. +     makedepend $(CFLAGS) $(SRCS1) $(SRCS2)
  1579. + install: ksh
  1580. +     $(INSTALL_PROGRAM) -c ksh $(bindir)/ksh
  1581. +     $(INSTALL_PROGRAM) -c ksh $(bindir)/sh
  1582. + .c.s:
  1583. +     $(CC) $(CFLAGS) -S -o $@ $<
  1584. + asms: $(OBJS:.o=.s)
  1585. + # DO NOT DELETE THIS LINE -- make depend depends on it.
  1586. + # If this runs make out of memory, delete /usr/include lines.
  1587. + alloc.o: alloc.c
  1588. + alloc.o: config.h
  1589. + alloc.o: sh.h
  1590. + alloc.o: stdh.h
  1591. + alloc.o: trace.h
  1592. + c_ksh.o: c_ksh.c
  1593. + c_ksh.o: config.h
  1594. + c_ksh.o: sh.h
  1595. + c_ksh.o: stdh.h
  1596. + c_ksh.o: table.h
  1597. + c_ksh.o: trace.h
  1598. + c_sh.o: c_sh.c
  1599. + c_sh.o: config.h
  1600. + c_sh.o: lex.h
  1601. + c_sh.o: sh.h
  1602. + c_sh.o: stdh.h
  1603. + c_sh.o: table.h
  1604. + c_sh.o: trace.h
  1605. + c_sh.o: tree.h
  1606. + c_test.o: c_test.c
  1607. + c_test.o: config.h
  1608. + c_test.o: sh.h
  1609. + c_test.o: stdh.h
  1610. + c_test.o: trace.h
  1611. + edit.o: config.h
  1612. + edit.o: edit.c
  1613. + edit.o: edit.h
  1614. + edit.o: lex.h
  1615. + edit.o: sh.h
  1616. + edit.o: stdh.h
  1617. + edit.o: trace.h
  1618. + edit.o: tty.h
  1619. + emacs.o: config.h
  1620. + emacs.o: edit.h
  1621. + emacs.o: emacs.c
  1622. + emacs.o: expand.h
  1623. + emacs.o: lex.h
  1624. + emacs.o: sh.h
  1625. + emacs.o: stdh.h
  1626. + emacs.o: table.h
  1627. + emacs.o: trace.h
  1628. + emacs.o: tree.h
  1629. + eval.o: config.h
  1630. + eval.o: eval.c
  1631. + eval.o: expand.h
  1632. + eval.o: lex.h
  1633. + eval.o: sh.h
  1634. + eval.o: stdh.h
  1635. + eval.o: table.h
  1636. + eval.o: trace.h
  1637. + eval.o: tree.h
  1638. + exec.o: config.h
  1639. + exec.o: exec.c
  1640. + exec.o: lex.h
  1641. + exec.o: sh.h
  1642. + exec.o: stdh.h
  1643. + exec.o: table.h
  1644. + exec.o: trace.h
  1645. + exec.o: tree.h
  1646. + expr.o: config.h
  1647. + expr.o: expr.c
  1648. + expr.o: sh.h
  1649. + expr.o: stdh.h
  1650. + expr.o: table.h
  1651. + expr.o: trace.h
  1652. + getopts.o: config.h
  1653. + getopts.o: getopts.c
  1654. + getopts.o: sh.h
  1655. + getopts.o: stdh.h
  1656. + getopts.o: table.h
  1657. + getopts.o: trace.h
  1658. + history.o: config.h
  1659. + history.o: history.c
  1660. + history.o: lex.h
  1661. + history.o: sh.h
  1662. + history.o: stdh.h
  1663. + history.o: trace.h
  1664. + io.o: config.h
  1665. + io.o: io.c
  1666. + io.o: sh.h
  1667. + io.o: stdh.h
  1668. + io.o: trace.h
  1669. + jobs.o: config.h
  1670. + jobs.o: jobs.c
  1671. + jobs.o: sh.h
  1672. + jobs.o: stdh.h
  1673. + jobs.o: trace.h
  1674. + jobs.o: tree.h
  1675. + lex.o: config.h
  1676. + lex.o: expand.h
  1677. + lex.o: lex.c
  1678. + lex.o: lex.h
  1679. + lex.o: sh.h
  1680. + lex.o: stdh.h
  1681. + lex.o: table.h
  1682. + lex.o: trace.h
  1683. + lex.o: tree.h
  1684. + mail.o: config.h
  1685. + mail.o: mail.c
  1686. + mail.o: sh.h
  1687. + mail.o: stdh.h
  1688. + mail.o: table.h
  1689. + mail.o: trace.h
  1690. + main.o: config.h
  1691. + main.o: lex.h
  1692. + main.o: main.c
  1693. + main.o: sh.h
  1694. + main.o: stdh.h
  1695. + main.o: table.h
  1696. + main.o: trace.h
  1697. + main.o: tree.h
  1698. + memmove.o: memmove.c
  1699. + memmove.o: stdh.h
  1700. + misc.o: config.h
  1701. + misc.o: expand.h
  1702. + misc.o: misc.c
  1703. + misc.o: sh.h
  1704. + misc.o: stdh.h
  1705. + misc.o: trace.h
  1706. + strstr.o: stdh.h
  1707. + strstr.o: strstr.c
  1708. + syn.o: config.h
  1709. + syn.o: expand.h
  1710. + syn.o: lex.h
  1711. + syn.o: sh.h
  1712. + syn.o: stdh.h
  1713. + syn.o: syn.c
  1714. + syn.o: table.h
  1715. + syn.o: trace.h
  1716. + syn.o: tree.h
  1717. + sigact.o: sigact.h sigact.c
  1718. + table.o: config.h
  1719. + table.o: sh.h
  1720. + table.o: stdh.h
  1721. + table.o: table.c
  1722. + table.o: table.h
  1723. + table.o: trace.h
  1724. + times.o: times.c
  1725. + trace.o: trace.c
  1726. + trap.o: config.h
  1727. + trap.o: sh.h
  1728. + trap.o: stdh.h
  1729. + trap.o: trace.h
  1730. + trap.o: trap.c
  1731. + tree.o: config.h
  1732. + tree.o: sh.h
  1733. + tree.o: stdh.h
  1734. + tree.o: trace.h
  1735. + tree.o: tree.c
  1736. + tree.o: tree.h
  1737. + do_ulimit.o: config.h
  1738. + do_ulimit.o: sh.h
  1739. + do_ulimit.o: stdh.h
  1740. + do_ulimit.o: trace.h
  1741. + do_ulimit.o: do_ulimit.c
  1742. + var.o: config.h
  1743. + var.o: expand.h
  1744. + var.o: sh.h
  1745. + var.o: stdh.h
  1746. + var.o: table.h
  1747. + var.o: trace.h
  1748. + var.o: var.c
  1749. + version.o: config.h
  1750. + version.o: sh.h
  1751. + version.o: stdh.h
  1752. + version.o: trace.h
  1753. + version.o: version.c
  1754. + vi.o: config.h
  1755. + vi.o: edit.h
  1756. + vi.o: expand.h
  1757. + vi.o: lex.h
  1758. + vi.o: sh.h
  1759. + vi.o: stdh.h
  1760. + vi.o: table.h
  1761. + vi.o: trace.h
  1762. + vi.o: tree.h
  1763. + vi.o: vi.c
  1764. + # WARNING: Put nothing here or make depend will gobble it up!
  1765. diff -rc --new-file pdksh-4.9/sh/alloc.c /gnu/src/amiga/pdksh-4.9/sh/alloc.c
  1766. *** pdksh-4.9/sh/alloc.c    Wed May  4 14:46:32 1994
  1767. --- /gnu/src/amiga/pdksh-4.9/sh/alloc.c    Wed May  4 22:24:28 1994
  1768. ***************
  1769. *** 95,100 ****
  1770. --- 95,104 ----
  1771.                   aerror(ap, "cannot allocate");
  1772.                   return NULL;
  1773.               }
  1774. +             /* either this or find the bug where uninitialized
  1775. +                memory is referenced.. hint: must be somewhere 
  1776. +                in path-parsing and -searching */
  1777. +             bzero (bp, offsetof(Block, cell[ICELLS + cells]));
  1778.               if (ap->free == &aempty)
  1779.                   bp->next = bp;
  1780.               else {
  1781. ***************
  1782. *** 173,182 ****
  1783. --- 177,194 ----
  1784.       return (void*) ptr;
  1785.   }
  1786.   
  1787. + #ifdef DEBUG_AFREE
  1788. + void
  1789. + _afree(ptr, ap, file, line)
  1790. +     void *ptr;
  1791. +     register Area *ap;
  1792. +     char *file; int line;
  1793. + #else
  1794.   void
  1795.   afree(ptr, ap)
  1796.       void *ptr;
  1797.       register Area *ap;
  1798. + #endif
  1799.   {
  1800.       register Block *bp;
  1801.       register Cell *fp, *fpp;
  1802. ***************
  1803. *** 187,192 ****
  1804. --- 199,215 ----
  1805.           if (bp->cell <= dp && dp < bp->last)
  1806.               break;
  1807.           if (bp->next == ap->free) {
  1808. + #ifdef DEBUG_AFREE
  1809. +             fprintf (shlout, "%s:%d: ap=$%lx, APERM=$%lx\n", file, line, ap, APERM);
  1810. +             {
  1811. +               struct block *b;
  1812. +               fprintf (shlout, "%s:%d:ATEMPs: ", file, line);
  1813. +               for (b = e.loc; b; b=b->next)
  1814. +                 fprintf (shlout, "$%lx ", &b->area);
  1815. +               fprintf (shlout, "\n");
  1816. +             }
  1817. +             fprintf (shlout, "%s:%d:", file, line);
  1818. + #endif
  1819.               aerror(ap, "freeing with invalid area");
  1820.               return;
  1821.           }
  1822. ***************
  1823. *** 197,202 ****
  1824. --- 220,228 ----
  1825.           ;
  1826.   
  1827.       if (fp == dp) {
  1828. + #ifdef DEBUG_AFREE
  1829. +         fprintf (shlout, "%s:%d:", file, line);
  1830. + #endif
  1831.           aerror(ap, "freeing free object");
  1832.           return;
  1833.       }
  1834. ***************
  1835. *** 223,229 ****
  1836.   
  1837.   Area a;
  1838.   
  1839. ! main(int argc, char **argv) {
  1840.       int i;
  1841.       char *p [9];
  1842.   
  1843. --- 249,255 ----
  1844.   
  1845.   Area a;
  1846.   
  1847. ! main(int argc, char **argv, char **envp) {
  1848.       int i;
  1849.       char *p [9];
  1850.   
  1851. diff -rc --new-file pdksh-4.9/sh/amiga.c /gnu/src/amiga/pdksh-4.9/sh/amiga.c
  1852. *** pdksh-4.9/sh/amiga.c    Thu Jan  1 00:00:00 1970
  1853. --- /gnu/src/amiga/pdksh-4.9/sh/amiga.c    Thu May  5 09:50:48 1994
  1854. ***************
  1855. *** 0 ****
  1856. --- 1,30 ----
  1857. + #include <errno.h>
  1858. + #include <fcntl.h>
  1859. + int
  1860. + fork()
  1861. + {
  1862. +   /* we don't have fork(). If I missed some fork-call (or if there's one
  1863. +      in a later version of the shell), just return with out-of-processes. */
  1864. +   errno = EPROCLIM;
  1865. +   return -1;
  1866. + }
  1867. + int
  1868. + tty_read (int fd, char *buf, int len)
  1869. + {
  1870. +   int mask = 1<<fd;
  1871. +   
  1872. +   /* read by itself is not interruptible, select() is. Perhaps this will
  1873. +      change some time in the future.. */
  1874. +   while (select (fd+1, &mask, 0, 0, 0) <= 0) ;
  1875. +   return read (fd, buf, len);
  1876. + }
  1877. + /* should update the library.... the header prototypes are *pgid(), and
  1878. +    POSIX *pgrp(), but the library doesn't contain the Posix versions yet,
  1879. +    and uses oldstyle BSD *pgrp() functions... */
  1880. + int setpgid (int p, int q) { return setpgrp (p, q); }
  1881. + int getpgid (int p) { return getpgrp (p); }
  1882. diff -rc --new-file pdksh-4.9/sh/c_ksh.c /gnu/src/amiga/pdksh-4.9/sh/c_ksh.c
  1883. *** pdksh-4.9/sh/c_ksh.c    Wed May  4 14:46:33 1994
  1884. --- /gnu/src/amiga/pdksh-4.9/sh/c_ksh.c    Tue Jun 14 12:02:42 1994
  1885. ***************
  1886. *** 47,52 ****
  1887. --- 47,53 ----
  1888.       register int done = 0;
  1889.       register int prt = 0;
  1890.       register struct tbl *v_pwd = NULL, *v_oldpwd = NULL;
  1891. +     extern char *getcwd ();
  1892.   
  1893.       if ((dir = wp[1]) == NULL && (dir = strval(global("HOME"))) == NULL)
  1894.           errorf("no home directory");
  1895. ***************
  1896. *** 146,152 ****
  1897.       register char **wp;
  1898.   {
  1899.       int nl = 1;
  1900. !     int expand = 1;
  1901.       FILE *f = stdout;
  1902.   
  1903.       for (wp++; *wp != NULL && **wp == '-'; wp++) {
  1904. --- 147,153 ----
  1905.       register char **wp;
  1906.   {
  1907.       int nl = 1;
  1908. !     int expand = 0;        /* don't expand by default, causes weird problems.. */
  1909.       FILE *f = stdout;
  1910.   
  1911.       for (wp++; *wp != NULL && **wp == '-'; wp++) {
  1912. ***************
  1913. *** 176,182 ****
  1914.           register char *s = *wp;
  1915.           register int c;
  1916.           while ((c = *s++) != '\0')
  1917. !             if (expand && c == '\\') {
  1918.                   switch ((c = *s++)) {
  1919.                   case 'b': c = '\b'; break;
  1920.                   case 'c': nl = 0; continue; /* AT&T brain damage */
  1921. --- 177,183 ----
  1922.           register char *s = *wp;
  1923.           register int c;
  1924.           while ((c = *s++) != '\0')
  1925. !             if (expand && c == '\\' && s[1]) {
  1926.                   switch ((c = *s++)) {
  1927.                   case 'b': c = '\b'; break;
  1928.                   case 'c': nl = 0; continue; /* AT&T brain damage */
  1929. diff -rc --new-file pdksh-4.9/sh/c_sh.c /gnu/src/amiga/pdksh-4.9/sh/c_sh.c
  1930. *** pdksh-4.9/sh/c_sh.c    Wed May  4 14:46:34 1994
  1931. --- /gnu/src/amiga/pdksh-4.9/sh/c_sh.c    Fri Jul 29 10:15:33 1994
  1932. ***************
  1933. *** 10,17 ****
  1934.   #include <errno.h>
  1935.   #include <signal.h>
  1936.   #include <setjmp.h>
  1937. - #include <unistd.h>        /* getcwd */
  1938.   #include <sys/times.h>
  1939.   #include "sh.h"
  1940.   
  1941.   static char *   clocktos    ARGS((clock_t t));
  1942. --- 10,18 ----
  1943.   #include <errno.h>
  1944.   #include <signal.h>
  1945.   #include <setjmp.h>
  1946.   #include <sys/times.h>
  1947. + #include <unistd.h>        /* getcwd */
  1948. + #include <limits.h>
  1949.   #include "sh.h"
  1950.   
  1951.   static char *   clocktos    ARGS((clock_t t));
  1952. ***************
  1953. *** 74,80 ****
  1954.           return 0;
  1955.       file = search(cp, path, 0);
  1956.       if (file == NULL)
  1957. !         errorf("%s: not found\n", cp);
  1958.       if (include(file))
  1959.           return exstat;
  1960.       return -1;
  1961. --- 75,81 ----
  1962.           return 0;
  1963.       file = search(cp, path, 0);
  1964.       if (file == NULL)
  1965. !         errorf("sh: %s: not found\n", cp);
  1966.       if (include(file))
  1967.           return exstat;
  1968.       return -1;
  1969. ***************
  1970. *** 306,312 ****
  1971.       if ((cp = *++wp) == NULL) {
  1972.           static char * const args [] = {"set", "-", NULL};
  1973.           extern int c_typeset ARGS((char **args));
  1974. !         return c_typeset(args);
  1975.       }
  1976.       
  1977.       for (; (cp = *wp) != NULL && (*cp == '-' || *cp == '+');) {
  1978. --- 307,313 ----
  1979.       if ((cp = *++wp) == NULL) {
  1980.           static char * const args [] = {"set", "-", NULL};
  1981.           extern int c_typeset ARGS((char **args));
  1982. !         return c_typeset((char **)args);
  1983.       }
  1984.       
  1985.       for (; (cp = *wp) != NULL && (*cp == '-' || *cp == '+');) {
  1986. ***************
  1987. *** 443,452 ****
  1988.       register int i;
  1989.       register char *cp = temp + sizeof(temp);
  1990.   
  1991. ! #if CLK_TCK != 100        /* convert to 1/100'ths */
  1992. !     t = (t < 1000000000/CLK_TCK) ?
  1993. !         (t * 100) / CLK_TCK : (t / CLK_TCK) * 100;
  1994. ! #endif
  1995.   
  1996.       *--cp = '\0';
  1997.       *--cp = 's';
  1998. --- 444,453 ----
  1999.       register int i;
  2000.       register char *cp = temp + sizeof(temp);
  2001.   
  2002. !     /* CLK_TCK may actually be a _sysconf() function call */
  2003. !     if (CLK_TCK != 100)    /* convert to 1/100'ths */
  2004. !       t = (t < 1000000000/CLK_TCK) ?
  2005. !         (t * 100) / CLK_TCK : (t / CLK_TCK) * 100;
  2006.   
  2007.       *--cp = '\0';
  2008.       *--cp = 's';
  2009. diff -rc --new-file pdksh-4.9/sh/config.h /gnu/src/amiga/pdksh-4.9/sh/config.h
  2010. *** pdksh-4.9/sh/config.h    Wed May  4 14:46:35 1994
  2011. --- /gnu/src/amiga/pdksh-4.9/sh/config.h    Thu Jan  1 00:00:00 1970
  2012. ***************
  2013. *** 1,67 ****
  2014. - /*
  2015. -  * Configuration file for the PD ksh
  2016. -  *
  2017. -  * RCSid: $Id: config.h,v 1.7 93/05/05 21:16:20 sjg Exp $
  2018. -  */
  2019. - #ifndef    _CONFIG_H
  2020. - #define    _CONFIG_H
  2021. - /*
  2022. -  * Builtin edit modes
  2023. -  */
  2024. - #define    EMACS                /* EMACS-like mode */
  2025. - #define    VI                /* vi-like mode */
  2026. - #define    JOBS                /* job control */
  2027. - #ifndef SIGINT
  2028. - #include <signal.h>
  2029. - #endif
  2030. - /*
  2031. -  * leave USE_SIGACT defined.
  2032. -  * if you don't have sigaction(2) and the
  2033. -  * implementation in sigact.c doesn't work for your system,
  2034. -  * fix it.
  2035. -  * 
  2036. -  * Of course if your system has a real sigaction() 
  2037. -  * implementation that is faulty! undef JOBS and add USE_SIGNAL
  2038. -  * or whatever does work.  You may find it necessary to undef
  2039. -  * USE_SIGACT, if so please report it.
  2040. -  */
  2041. - #define USE_SIGACT            /* POSIX signal handling */
  2042. - /* 
  2043. -  * These control how sigact.c implements sigaction()
  2044. -  * If you don't define any of them it will try and work it out 
  2045. -  * for itself.  The are listed in order of preference (usefulness).
  2046. -  */
  2047. - /* #define USE_SIGMASK            /* BSD4.2 ? signal handling */
  2048. - /* #define USE_SIGSET            /* BSD4.1 ? signal handling */
  2049. - /* #define USE_SIGNAL            /* plain old signal(2) */
  2050. - #if defined(JOBS) && (!defined(SIGCONT) || (defined(_SYSV) && defined(USE_SIGNAL)))
  2051. - #undef JOBS
  2052. - #endif
  2053. - /* #define    FASCIST            /* Fascist getopts */
  2054. - #define    SHARPBANG            /* Hack to handle #! */
  2055. - /* #define    SILLY            /* Game of life in EMACS mode */
  2056. - /* #define    SWTCH            /* Handle SWTCH for shl(1) */
  2057. - /*
  2058. -  * ALTERNATIONS is csh not ksh, but it is such a nice feature...
  2059. -  */
  2060. - #define ALTERNATIONS            /* csh {a,b,c} arg expansion */
  2061. - /* #define COMPLEX_HISTORY            /* Peter Collinson's history */
  2062. - /*
  2063. -  * if you don't have mmap() you can't use Peter Collinson's history
  2064. -  * mechanism.  If that is the case, then define EASY_HISTORY
  2065. -  */
  2066. - #if !defined(COMPLEX_HISTORY) || defined(NO_MMAP)
  2067. - # define EASY_HISTORY            /* sjg's trivial history file */
  2068. - #endif
  2069. -   
  2070. - #endif    /* _CONFIG_H */
  2071. --- 0 ----
  2072. diff -rc --new-file pdksh-4.9/sh/config.h.in /gnu/src/amiga/pdksh-4.9/sh/config.h.in
  2073. *** pdksh-4.9/sh/config.h.in    Thu Jan  1 00:00:00 1970
  2074. --- /gnu/src/amiga/pdksh-4.9/sh/config.h.in    Wed May  4 22:24:30 1994
  2075. ***************
  2076. *** 0 ****
  2077. --- 1,67 ----
  2078. + /*
  2079. +  * Configuration file for the PD ksh
  2080. +  *
  2081. +  * RCSid: $Id: config.h,v 1.7 93/05/05 21:16:20 sjg Exp $
  2082. +  */
  2083. + #ifndef    _CONFIG_H
  2084. + #define    _CONFIG_H
  2085. + /*
  2086. +  * Builtin edit modes
  2087. +  */
  2088. + #define    EMACS                /* EMACS-like mode */
  2089. + #define    VI                /* vi-like mode */
  2090. + #define    JOBS                /* job control */
  2091. + #ifndef SIGINT
  2092. + #include <signal.h>
  2093. + #endif
  2094. + /*
  2095. +  * leave USE_SIGACT defined.
  2096. +  * if you don't have sigaction(2) and the
  2097. +  * implementation in sigact.c doesn't work for your system,
  2098. +  * fix it.
  2099. +  * 
  2100. +  * Of course if your system has a real sigaction() 
  2101. +  * implementation that is faulty! undef JOBS and add USE_SIGNAL
  2102. +  * or whatever does work.  You may find it necessary to undef
  2103. +  * USE_SIGACT, if so please report it.
  2104. +  */
  2105. + #define USE_SIGACT            /* POSIX signal handling */
  2106. + /* 
  2107. +  * These control how sigact.c implements sigaction()
  2108. +  * If you don't define any of them it will try and work it out 
  2109. +  * for itself.  The are listed in order of preference (usefulness).
  2110. +  */
  2111. + /* #define USE_SIGMASK            /* BSD4.2 ? signal handling */
  2112. + /* #define USE_SIGSET            /* BSD4.1 ? signal handling */
  2113. + /* #define USE_SIGNAL            /* plain old signal(2) */
  2114. + #if defined(JOBS) && (!defined(SIGCONT) || (defined(_SYSV) && defined(USE_SIGNAL)))
  2115. + #undef JOBS
  2116. + #endif
  2117. + /* #define    FASCIST            /* Fascist getopts */
  2118. + /* #define    SHARPBANG        /* Hack to handle #! */
  2119. + /* #define    SILLY            /* Game of life in EMACS mode */
  2120. + /* #define    SWTCH            /* Handle SWTCH for shl(1) */
  2121. + /*
  2122. +  * ALTERNATIONS is csh not ksh, but it is such a nice feature...
  2123. +  */
  2124. + #define ALTERNATIONS            /* csh {a,b,c} arg expansion */
  2125. + /* #define COMPLEX_HISTORY            /* Peter Collinson's history */
  2126. + /*
  2127. +  * if you don't have mmap() you can't use Peter Collinson's history
  2128. +  * mechanism.  If that is the case, then define EASY_HISTORY
  2129. +  */
  2130. + #if !defined(COMPLEX_HISTORY) || defined(NO_MMAP)
  2131. + # define EASY_HISTORY            /* sjg's trivial history file */
  2132. + #endif
  2133. +   
  2134. + #endif    /* _CONFIG_H */
  2135. diff -rc --new-file pdksh-4.9/sh/edit.c /gnu/src/amiga/pdksh-4.9/sh/edit.c
  2136. *** pdksh-4.9/sh/edit.c    Wed May  4 14:47:33 1994
  2137. --- /gnu/src/amiga/pdksh-4.9/sh/edit.c    Wed May  4 22:24:31 1994
  2138. ***************
  2139. *** 59,65 ****
  2140. --- 59,69 ----
  2141.           x_init();
  2142.   
  2143.       if (x_noecho)
  2144. + #ifdef amigados
  2145. +         return(tty_read(ttyfd, buf, len));
  2146. + #else
  2147.           return(read(ttyfd, buf, len));
  2148. + #endif
  2149.   
  2150.       (void)x_mode(TRUE);
  2151.       if (rcp = strrchr(ps1, '\n'))
  2152. ***************
  2153. *** 99,105 ****
  2154. --- 103,113 ----
  2155.      * either. 
  2156.      */
  2157.    retry:
  2158. + #ifdef amigados
  2159. +     if (tty_read(ttyfd, &c, 1) != 1)
  2160. + #else
  2161.       if (read(ttyfd, &c, 1) != 1)
  2162. + #endif
  2163.       {
  2164.         if (sigchld_caught)        /* just a SIGCHLD ? */
  2165.         {
  2166. diff -rc --new-file pdksh-4.9/sh/emacs.c /gnu/src/amiga/pdksh-4.9/sh/emacs.c
  2167. *** pdksh-4.9/sh/emacs.c    Wed May  4 14:46:38 1994
  2168. --- /gnu/src/amiga/pdksh-4.9/sh/emacs.c    Tue Jun 14 11:47:21 1994
  2169. ***************
  2170. *** 1191,1197 ****
  2171.   
  2172.       ainit(AEDIT);
  2173.   
  2174. !     x_tab = (struct x_ftab *(*)[X_TABSZ]) alloc(sizeofN(*x_tab, 3), AEDIT);
  2175.       for (j = 0; j < 128; j++)
  2176.           x_tab[0][j] = xft_insert;
  2177.       for (i = 1; i < 3; i++)
  2178. --- 1191,1197 ----
  2179.   
  2180.       ainit(AEDIT);
  2181.   
  2182. !     x_tab = (struct x_ftab const *(*)[X_TABSZ]) alloc(sizeofN(*x_tab, 3), AEDIT);
  2183.       for (j = 0; j < 128; j++)
  2184.           x_tab[0][j] = xft_insert;
  2185.       for (i = 1; i < 3; i++)
  2186. diff -rc --new-file pdksh-4.9/sh/exec.c /gnu/src/amiga/pdksh-4.9/sh/exec.c
  2187. *** pdksh-4.9/sh/exec.c    Wed May  4 14:46:40 1994
  2188. --- /gnu/src/amiga/pdksh-4.9/sh/exec.c    Fri Jul 29 10:15:05 1994
  2189. ***************
  2190. *** 396,407 ****
  2191.                *
  2192.                * So, we assume that if the file exists, it
  2193.                * doesn't have execute privs; else, it really
  2194. !              * is not found.
  2195.                */
  2196.               if (access(cp, 0) < 0)
  2197. !                 shellf("%s: not found\n", cp);
  2198.               else
  2199. !                 shellf("%s: cannot execute\n", cp);
  2200.               rv = 1;
  2201.               break;
  2202.           }
  2203. --- 396,409 ----
  2204.                *
  2205.                * So, we assume that if the file exists, it
  2206.                * doesn't have execute privs; else, it really
  2207. !              * is not found.  If it isn't found, identify
  2208. !              * that it is the shell that is complaining about
  2209. !              * it.
  2210.                */
  2211.               if (access(cp, 0) < 0)
  2212. !                 shellf("sh: %s: not found\n", cp);
  2213.               else
  2214. !                 shellf("sh: %s: cannot execute\n", cp);
  2215.               rv = 1;
  2216.               break;
  2217.           }
  2218. diff -rc --new-file pdksh-4.9/sh/expr.c /gnu/src/amiga/pdksh-4.9/sh/expr.c
  2219. *** pdksh-4.9/sh/expr.c    Wed May  4 14:46:41 1994
  2220. --- /gnu/src/amiga/pdksh-4.9/sh/expr.c    Tue Jun 14 12:04:06 1994
  2221. ***************
  2222. *** 206,212 ****
  2223.               ;
  2224.           c = *--cp;
  2225.           *cp = 0;
  2226. !         val = global(tokp);
  2227.           *cp = c;
  2228.           tok = VAR;
  2229.       } else
  2230. --- 206,212 ----
  2231.               ;
  2232.           c = *--cp;
  2233.           *cp = 0;
  2234. !         val = global((char *)tokp);
  2235.           *cp = c;
  2236.           tok = VAR;
  2237.       } else
  2238. ***************
  2239. *** 216,222 ****
  2240.           c = *--cp;
  2241.           *cp = 0;
  2242.           val = tempvar();
  2243. !         setstr(val, tokp);
  2244.           val->flag |= RDONLY;
  2245.           *cp = c;
  2246.           tok = LIT;
  2247. --- 216,222 ----
  2248.           c = *--cp;
  2249.           *cp = 0;
  2250.           val = tempvar();
  2251. !         setstr(val, (char *)tokp);
  2252.           val->flag |= RDONLY;
  2253.           *cp = c;
  2254.           tok = LIT;
  2255. diff -rc --new-file pdksh-4.9/sh/getopts.c /gnu/src/amiga/pdksh-4.9/sh/getopts.c
  2256. *** pdksh-4.9/sh/getopts.c    Wed May  4 14:46:42 1994
  2257. --- /gnu/src/amiga/pdksh-4.9/sh/getopts.c    Wed May  4 22:24:32 1994
  2258. ***************
  2259. *** 20,25 ****
  2260. --- 20,30 ----
  2261.   # define getopt    local_getopt
  2262.   #endif
  2263.   
  2264. + #ifdef amigados
  2265. + /* redefine it, or it collides with stdlib.h, it's static anyway */
  2266. + #define getopt(argc,argv,opts) static_getopt(argc,argv,opts)
  2267. + #endif
  2268.   /*
  2269.    * The following is derived from getopt() source placed into the public
  2270.    * domain by AT&T (the only time they're known to have done that).
  2271. diff -rc --new-file pdksh-4.9/sh/io.c /gnu/src/amiga/pdksh-4.9/sh/io.c
  2272. *** pdksh-4.9/sh/io.c    Wed May  4 14:46:44 1994
  2273. --- /gnu/src/amiga/pdksh-4.9/sh/io.c    Wed May  4 22:30:18 1994
  2274. ***************
  2275. *** 98,103 ****
  2276. --- 98,104 ----
  2277.   {
  2278.       if (shf[fd] != NULL)
  2279.           return;
  2280. + #ifndef amigados
  2281.       if (fd <= 2)
  2282.   #if defined(__386BSD__) || defined(_BSDI)
  2283.           /* Chris Torek's stdio replacement */
  2284. ***************
  2285. *** 106,115 ****
  2286. --- 107,152 ----
  2287.   #ifdef _MINIX
  2288.           /* ? */;
  2289.   #else
  2290. + #ifdef __STDC__
  2291. +         __iob[fd]._flag = 0; /* re-use stdin, stdout, stderr */
  2292. + #else
  2293.           _iob[fd]._flag = 0; /* re-use stdin, stdout, stderr */
  2294.   #endif
  2295.   #endif
  2296. + #endif
  2297. + #else
  2298. +     if (fd <= 2)
  2299. +       shf[fd] = (fd == 0) ? __sF[0] : (fd == 1 ? __sF[1] : __sF[2]);
  2300. +     else
  2301. + #endif
  2302. +     /* "r+" is too lazy.. modern stdio implementation don't allow you
  2303. +        to open a O_RDONLY file this way, nor a O_WRONLY one... */
  2304. + #ifdef amigados
  2305. +     {
  2306. +       int mode = fcntl (fd, F_GETFL, 0);
  2307. +       
  2308. +       if (mode >= 0)
  2309. +         switch (mode & 3)
  2310. +           {
  2311. +           case 0:
  2312. +             shf[fd] = fdopen (fd, "r");
  2313. +             break;
  2314. +             
  2315. +           case 1:
  2316. +             shf[fd] = fdopen (fd, "w");
  2317. +             break;
  2318. +             
  2319. +           case 2:
  2320. +             shf[fd] = fdopen (fd, "r+");
  2321. +             break;
  2322. +           }
  2323. +       else
  2324. +         shf[fd] = 0;
  2325. +     }
  2326. + #else
  2327.       shf[fd] = fdopen(fd, "r+");
  2328. + #endif
  2329.       if (shf[fd] == NULL)
  2330.           return;
  2331.       setvbuf(shf[fd], (char*)NULL, _IOFBF, (size_t)BUFSIZ);
  2332. ***************
  2333. *** 122,128 ****
  2334.       int fd;
  2335.   {
  2336.       if (shf[fd] != NULL) {
  2337. ! #if !defined(__386BSD__) && !defined(_BSDI)
  2338.           /* Chris Torek's stdio replacement */
  2339.           fseek(shf[fd], 0L, 1); /* V7 derived */
  2340.   #endif
  2341. --- 159,165 ----
  2342.       int fd;
  2343.   {
  2344.       if (shf[fd] != NULL) {
  2345. ! #if !defined(__386BSD__) && !defined(_BSDI) && !defined(__amigados__)
  2346.           /* Chris Torek's stdio replacement */
  2347.           fseek(shf[fd], 0L, 1); /* V7 derived */
  2348.   #endif
  2349. diff -rc --new-file pdksh-4.9/sh/jobs.c /gnu/src/amiga/pdksh-4.9/sh/jobs.c
  2350. *** pdksh-4.9/sh/jobs.c    Wed May  4 14:46:45 1994
  2351. --- /gnu/src/amiga/pdksh-4.9/sh/jobs.c    Fri Dec 23 13:04:28 1994
  2352. ***************
  2353. *** 84,89 ****
  2354. --- 84,90 ----
  2355.   
  2356.   #ifdef JOBS
  2357.   #ifdef _BSD            /* _BSD 4.* */
  2358. + #ifndef __amigados__
  2359.   #define    setpgid(p, pg)    setpgrp(p, pg)
  2360.   #if defined(_POSIX_SOURCE) || defined(__386BSD__) || defined(_BSDI)
  2361.   #define    getpgid(p)    getpgrp()
  2362. ***************
  2363. *** 91,96 ****
  2364. --- 92,98 ----
  2365.   #define    getpgid(p)    getpgrp(p)
  2366.   #define    tcsetpgrp(fd,p)    ioctl(fd, TIOCSPGRP, &(p))
  2367.   #endif
  2368. + #endif
  2369.   #else                /* POSIX-compatible */
  2370.   #define    getpgid(p)    getpgrp() /* 1003.1 stupidity */
  2371.   #define    killpg(p, s)    kill(-(p), s)
  2372. ***************
  2373. *** 159,165 ****
  2374.   static int      j_newjob    ARGS((void));
  2375.   static Proc *   j_search    ARGS((int job));
  2376.   static void    j_sigchld   ARGS((int sig));
  2377. !   
  2378.   /* initialize job control */
  2379.   void
  2380.   j_init()
  2381. --- 161,188 ----
  2382.   static int      j_newjob    ARGS((void));
  2383.   static Proc *   j_search    ARGS((int job));
  2384.   static void    j_sigchld   ARGS((int sig));
  2385. ! #ifdef amigados
  2386. ! /* those are needed for later relocation support after vfork() */
  2387. ! u_int inline static 
  2388. ! get_a4 ()
  2389. ! {
  2390. !   u_int res;
  2391. !   asm ("movel    a4,%0" : "=g" (res));
  2392. !   return res;
  2393. ! }
  2394. ! static inline int dbsize() 
  2395. ! {
  2396. !   int res;
  2397. !   asm ("movel #___data_size,%0; addl #___bss_size,%0" : "=r" (res));
  2398. !   return res;
  2399. ! }
  2400. ! extern int __datadata_relocs();
  2401. ! #endif
  2402. !     
  2403.   /* initialize job control */
  2404.   void
  2405.   j_init()
  2406. ***************
  2407. *** 182,188 ****
  2408.       sm_sigchld = sigmask(SIGCHLD);
  2409.       _TRACE(5, ("j_init: sm_sigchld == 0x%x", sm_sigchld));
  2410.   # endif
  2411. ! #endif 
  2412.   #ifndef JOBS
  2413.   # ifdef USE_SIGACT
  2414.       sigaction(SIGCHLD, &Sigact_dfl, NULL);
  2415. --- 205,211 ----
  2416.       sm_sigchld = sigmask(SIGCHLD);
  2417.       _TRACE(5, ("j_init: sm_sigchld == 0x%x", sm_sigchld));
  2418.   # endif
  2419. ! #endif
  2420.   #ifndef JOBS
  2421.   # ifdef USE_SIGACT
  2422.       sigaction(SIGCHLD, &Sigact_dfl, NULL);
  2423. ***************
  2424. *** 289,305 ****
  2425.   }
  2426.   #endif
  2427.   
  2428.   /* execute tree in child subprocess */
  2429.   int
  2430. ! exchild(t, flags)
  2431. !     struct op *t;
  2432. !     int flags;
  2433.   {
  2434.       register int i;
  2435.       register Proc *j;
  2436.       int rv = 0;
  2437.       int forksleep;
  2438.   
  2439.       flags &= ~XFORK;
  2440.       if ((flags&XEXEC))
  2441.           return execute(t, flags);
  2442. --- 312,348 ----
  2443.   }
  2444.   #endif
  2445.   
  2446. + #ifdef amigados
  2447. + /* stack slots are volatile when vfork_resume is called.... the solution
  2448. +    is to buffer the parameters in global variables, that are relocated with
  2449. +    the ix_resident() call (so the solution is even reentrant ;-)) */
  2450. + static struct op *t;
  2451. + static int flags;
  2452. + static struct table *o_homedirs;
  2453. + #endif
  2454.   /* execute tree in child subprocess */
  2455.   int
  2456. ! exchild(_t, _flags)
  2457. !     struct op *_t;
  2458. !     int _flags;
  2459.   {
  2460.       register int i;
  2461.       register Proc *j;
  2462. + #ifndef amigados
  2463. +     register struct op *t;
  2464. +     register int flags;
  2465. + #endif
  2466.       int rv = 0;
  2467.       int forksleep;
  2468.   
  2469. +     flags = _flags;
  2470. +     t = _t;
  2471. + #ifdef amigados
  2472. +     o_homedirs = &homedirs;
  2473. + #endif
  2474.       flags &= ~XFORK;
  2475.       if ((flags&XEXEC))
  2476.           return execute(t, flags);
  2477. ***************
  2478. *** 314,320 ****
  2479.       procs = j;
  2480.     Found:
  2481.   
  2482. !     j->prev = ((flags&XPIPEI)) ? j_lastj : NULL;
  2483.       j->proc = j->pgrp = 0;
  2484.       j->flags = flags;
  2485.       j->job = (flags&XPIPEI) ? j_lastjob : j_newjob();
  2486. --- 357,367 ----
  2487.       procs = j;
  2488.     Found:
  2489.   
  2490. !     j->notify = 0;
  2491. !     bzero (&j->status, sizeof (j->status));
  2492. !     bzero (&j->utime, sizeof (j->utime));
  2493. !     bzero (&j->stime, sizeof (j->stime));
  2494. !     j->prev = (flags&XPIPEI) ? j_lastj : NULL;
  2495.       j->proc = j->pgrp = 0;
  2496.       j->flags = flags;
  2497.       j->job = (flags&XPIPEI) ? j_lastjob : j_newjob();
  2498. ***************
  2499. *** 335,340 ****
  2500. --- 382,391 ----
  2501.       sigsetmask(sm_sigchld);
  2502.   # endif
  2503.   #endif
  2504. + #ifdef __amigados__
  2505. + /* use vfork () instead of fork(), and later try to do fork() `by hand'... */
  2506. + #define fork vfork
  2507. + #endif
  2508.       /* create child process */
  2509.       forksleep = 0;
  2510.       while ((i = fork()) < 0 && errno == EAGAIN && forksleep < 32) {
  2511. ***************
  2512. *** 346,355 ****
  2513.       }
  2514.       if (i < 0) {
  2515.           j->state = JFREE;
  2516. !         errorf("cannot fork - try again\n");
  2517.       }
  2518.       j->proc = (i != 0) ? i : getpid();
  2519.   
  2520.   #ifdef JOBS
  2521.       /* job control set up */
  2522.       if (flag[FMONITOR] && !(flags&XXCOM))
  2523. --- 397,410 ----
  2524.       }
  2525.       if (i < 0) {
  2526.           j->state = JFREE;
  2527. !         errorf("cannot fork - try again - errno %d\n", errno);
  2528.       }
  2529.       j->proc = (i != 0) ? i : getpid();
  2530.   
  2531. + #ifdef amigados
  2532. +     if (i)
  2533. + #endif
  2534.   #ifdef JOBS
  2535.       /* job control set up */
  2536.       if (flag[FMONITOR] && !(flags&XXCOM))
  2537. ***************
  2538. *** 364,370 ****
  2539. --- 419,496 ----
  2540.       j_lastj = j;
  2541.   
  2542.       if (i == 0) {        /* child */
  2543. + #ifdef amigados
  2544. +         /* you don't really *have* to understand all the magic that's
  2545. +            happening here ;-) In short, it duplicates the data/bss
  2546. +            segment (without malloc'd data!), re-relocates data-to-data
  2547. +            relocs, reinits stdio (into new malloc'd buffers), gets
  2548. +            a fresh copy of environ, and that's about it. */
  2549. +         extern char **_ctype_, **environ;
  2550. +         extern int sys_nerr;
  2551. +         extern int SysBase, DOSBase;
  2552. +         
  2553. +         /* this re-relocates the data segment */
  2554. +             ix_resident (4, get_a4(), dbsize(), __datadata_relocs);
  2555. +         ix_get_vars2 (7, &_ctype_, &sys_nerr, &SysBase, &DOSBase, &__sF, &environ, &environ);
  2556. +         e.type = E_NONE;
  2557. +         ainit (APERM);
  2558. +         /* don't copy `commands', this is just a hash cache for
  2559. +            commands, and the child just searches its paths again
  2560. +            if it doesn't find a command there */
  2561. +         tinit (& commands, APERM);
  2562. +         /* don't do anything to `builtins'. This table represents
  2563. +            shell builtins and is as such static. Using vfork I
  2564. +            can't allow the parent shell to quit before the child,
  2565. +            so the child can reuse the shared table. But set the
  2566. +            area of the table to 0, that way we get an error (or
  2567. +            a crash if the child nevertheless tries to manipulate
  2568. +            the table */
  2569. +         builtins.areap = 0;
  2570. +         /* same applies to lexicals, these are shell keywords */
  2571. +         lexicals.areap = 0;
  2572. +         /* although homedirs is hardly used, it's not static,
  2573. +            so copy it. */
  2574. +         tbl_copy (o_homedirs, &homedirs, APERM);
  2575. +             ainit (ATEMP);
  2576. +         blk_copy (e.loc);
  2577. +         if (e.savefd)
  2578. +           {
  2579. +             short *old = e.savefd;
  2580. +             e.savefd = (short*) alloc(sizeofN(short, NUFILE), ATEMP);
  2581. +             bcopy (old, e.savefd, sizeofN(short, NUFILE));
  2582. +           }
  2583. +         /* cancel the previous stdio pointers, they're no longer
  2584. +            valid */
  2585. +         {
  2586. +           register int fd;
  2587. +           for (fd = 0; fd < NUFILE; fd++)
  2588. +             if (shf[fd])
  2589. +               {
  2590. +                 shf[fd] = 0;
  2591. +                 fopenshf (fd);
  2592. +               }
  2593. +         }
  2594. +         /* copy the argument tree */
  2595. +             t = tcopy (t, ATEMP);
  2596. +             e.temps = 0;
  2597. +             /* dup any allocated trap command strings */
  2598. +             child_dup_traps ();
  2599. +         /* don't do this past vfork_resume(), as `e' is cached in a
  2600. +            register by the compiler.. */
  2601. +         e.oenv = NULL;
  2602. +         /* tell the parent it's ok to continue, just as if the child
  2603. +            did an exec() or an _exit(). Switch to child's stack. */
  2604. +             vfork_resume ();
  2605. + #else
  2606.           e.oenv = NULL;
  2607. + #endif
  2608.           if (flag[FTALKING])
  2609.               restoresigs();
  2610.           if ((flags&XBGND) && !flag[FMONITOR])
  2611. ***************
  2612. *** 386,393 ****
  2613. --- 512,524 ----
  2614.                   close(i);
  2615.               }
  2616.           }
  2617. + #ifdef amigados
  2618. +         /* don't need them, and don't own them, so toss them ;-)) */
  2619. +         procs = 0;
  2620. + #else
  2621.           for (j = procs; j != NULL; j = j->next)
  2622.               j->state = JFREE;
  2623. + #endif
  2624.           ttyfd = -1;
  2625.   #ifdef JOBS
  2626.           /* is this needed in the child? */
  2627. ***************
  2628. *** 616,622 ****
  2629. --- 747,756 ----
  2630.             break;
  2631.           }
  2632.           if (pid <= 0)    /* return if would block (0) ... */
  2633. +           {
  2634. +             _TRACE(5, ("j_reapchld: would block"));
  2635.               break;    /* ... or no children or interrupted (-1) */
  2636. +           }
  2637.           (void) times(&t1);
  2638.   
  2639.           _TRACE(5, ("j_reapchld: looking for pid==%d", pid));
  2640. diff -rc --new-file pdksh-4.9/sh/lex.c /gnu/src/amiga/pdksh-4.9/sh/lex.c
  2641. *** pdksh-4.9/sh/lex.c    Wed May  4 14:46:46 1994
  2642. --- /gnu/src/amiga/pdksh-4.9/sh/lex.c    Wed May  4 22:24:36 1994
  2643. ***************
  2644. *** 123,128 ****
  2645. --- 123,129 ----
  2646.                       break;
  2647.                     case '"': case '\\':
  2648.                     case '$': case '`':
  2649. +                       Xcheck(ws, wp);
  2650.                       *wp++ = QCHAR, *wp++ = c;
  2651.                       break;
  2652.                     default:
  2653. ***************
  2654. *** 542,548 ****
  2655. --- 543,553 ----
  2656.               else
  2657.   #endif
  2658.   #endif
  2659. + #ifdef amigados
  2660. +                 c = tty_read(ttyfd, line, LINE);
  2661. + #else
  2662.                   c = read(ttyfd, line, LINE);
  2663. + #endif
  2664.               if (c < 0 && sigchld_caught)
  2665.               {
  2666.                 goto retry;
  2667. diff -rc --new-file pdksh-4.9/sh/main.c /gnu/src/amiga/pdksh-4.9/sh/main.c
  2668. *** pdksh-4.9/sh/main.c    Wed May  4 14:46:48 1994
  2669. --- /gnu/src/amiga/pdksh-4.9/sh/main.c    Wed May  4 22:38:56 1994
  2670. ***************
  2671. *** 39,46 ****
  2672. --- 39,50 ----
  2673.   #ifdef sun                /* sun's don't have a real /bin */
  2674.     "${SHELL:=/bin/sh} ${PATH:=/usr/bin:/usr/ucb:.} ${HOME:=/} ${PS1:=$ } ${PS2:=> } ${PS3:=#? } ${MAILCHECK:=600}";
  2675.   #else
  2676. + #ifdef __amigados__
  2677. +   "${SHELL:=/bin/sh} ${PATH:=.:/bin:/c} ${HOME:=/ram} ${PS1:=$ } ${PS2:=> } ${PS3:=#? } ${MAILCHECK:=600}";
  2678. + #else
  2679.     "${SHELL:=/bin/sh} ${PATH:=/bin:/usr/bin:.} ${HOME:=/} ${PS1:=$ } ${PS2:=> } ${PS3:=#? } ${MAILCHECK:=600}";
  2680.   #endif
  2681. + #endif
  2682.   
  2683.   static    const    char *initcoms [] = {
  2684.       "cd", ".", NULL,        /* set up $PWD */
  2685. ***************
  2686. *** 140,145 ****
  2687. --- 144,157 ----
  2688.   
  2689.       init_histvec();
  2690.       
  2691. + #ifdef __amigados__
  2692. +     /* there's a bug here that doesn't set the special meaning of
  2693. +        PATH if it's not already in the environment. Since it's pretty
  2694. +        nasty to get this right (local stuff in var.c..), I'll `import'
  2695. +        the default before actually handling the environment */
  2696. +     import ("PATH=.:/bin:/c");
  2697. + #endif
  2698.       /* import enviroment */
  2699.       if (envp != NULL)
  2700.           for (wp = envp; *wp != NULL; wp++)
  2701. ***************
  2702. *** 158,165 ****
  2703. --- 170,184 ----
  2704.       (void) signal(SIGUSR1, set_TraceLev);
  2705.       (void) signal(SIGUSR2, set_TraceLev);
  2706.   #endif
  2707. + #ifdef amigados
  2708. +     /* I want trace support permanent in the shell, but I don't want
  2709. +        it to show up unless I want it to ;-) */
  2710. +     if (getenv ("TRACE_LEVEL"))
  2711. +       _TRACE(0, ("Traces enabled, main @$lx\n", main));
  2712. + #else
  2713.       _TRACE(0, ("Traces enabled.")); /* allow _TRACE to setup */
  2714.   #endif
  2715. + #endif /* USE_TRACE */
  2716.   
  2717.       /* define shell keywords */
  2718.       keywords();
  2719. diff -rc --new-file pdksh-4.9/sh/misc.c /gnu/src/amiga/pdksh-4.9/sh/misc.c
  2720. *** pdksh-4.9/sh/misc.c    Wed May  4 14:46:49 1994
  2721. --- /gnu/src/amiga/pdksh-4.9/sh/misc.c    Wed May  4 22:24:38 1994
  2722. ***************
  2723. *** 173,178 ****
  2724. --- 173,181 ----
  2725.       return (*as == '-') ? -n : n;
  2726.   }
  2727.   
  2728. + /* since I'm using a shared library, there's no reason NOT to use the
  2729. +    system strerror() function under amigados. */
  2730. + #ifndef amigados
  2731.   /*
  2732.    * stripped down strerror for kill and exec
  2733.    */
  2734. ***************
  2735. *** 203,208 ****
  2736. --- 206,212 ----
  2737.           return "Unknown system error";
  2738.       }
  2739.   }
  2740. + #endif
  2741.   
  2742.   /* -------- gmatch.c -------- */
  2743.   
  2744. diff -rc --new-file pdksh-4.9/sh/proto.h /gnu/src/amiga/pdksh-4.9/sh/proto.h
  2745. *** pdksh-4.9/sh/proto.h    Wed May  4 14:46:55 1994
  2746. --- /gnu/src/amiga/pdksh-4.9/sh/proto.h    Wed May  4 22:24:39 1994
  2747. ***************
  2748. *** 16,22 ****
  2749. --- 16,27 ----
  2750.   void     afreeall     ARGS((Area *ap));
  2751.   void *    alloc         ARGS((size_t size, Area *ap));
  2752.   void *    aresize         ARGS((void *ptr, size_t size, Area *ap));
  2753. + #ifdef DEBUG_AFREE
  2754. + #define afree(ptr,ap) _afree((ptr), (ap), __FILE__, __LINE__)
  2755. + void     _afree         ARGS((void *ptr, Area *ap, char *, int));
  2756. + #else
  2757.   void     afree         ARGS((void *ptr, Area *ap));
  2758. + #endif
  2759.   /* c_ksh.c */
  2760.   int     c_hash         ARGS((char **wp));
  2761.   int     c_cd         ARGS((char **wp));
  2762. ***************
  2763. *** 197,202 ****
  2764. --- 202,210 ----
  2765.   void     twalk         ARGS((struct table *tp));
  2766.   struct tbl *    tnext     ARGS((void));
  2767.   struct tbl **    tsort     ARGS((struct table *tp));
  2768. + #ifdef amigados
  2769. + void    tbl_copy     ARGS((struct table *src, struct table *dst, Area *ap));
  2770. + #endif
  2771.   /* trace.c */
  2772.   /* trap.c */
  2773.   Trap *    gettrap         ARGS((char *name));
  2774. ***************
  2775. *** 206,211 ****
  2776. --- 214,222 ----
  2777.   int     cleartraps     ARGS((void));
  2778.   int     ignoresig     ARGS((int i));
  2779.   int     restoresigs     ARGS((void));
  2780. + #ifdef amigados
  2781. + void    child_dup_traps     ARGS((void));
  2782. + #endif
  2783.   /* tree.c */
  2784.   void     ptree         ARGS((struct op *t, FILE *f));
  2785.   int     pioact         ARGS((FILE *f, struct ioword *iop));
  2786. ***************
  2787. *** 230,235 ****
  2788. --- 241,249 ----
  2789.   void     unset         ARGS((struct tbl *vp));
  2790.   int     isassign     ARGS((char *s));
  2791.   char **    makenv         ARGS((void));
  2792. + #ifdef amigados
  2793. + void    blk_copy     ARGS((struct block *src));
  2794. + #endif
  2795.   /* version.c */
  2796.   /* vi.c */
  2797.   void     vi_reset     ARGS((char *buf, int len));
  2798. diff -rc --new-file pdksh-4.9/sh/table.c /gnu/src/amiga/pdksh-4.9/sh/table.c
  2799. *** pdksh-4.9/sh/table.c    Wed May  4 14:46:59 1994
  2800. --- /gnu/src/amiga/pdksh-4.9/sh/table.c    Wed May  4 22:24:40 1994
  2801. ***************
  2802. *** 199,201 ****
  2803. --- 199,256 ----
  2804.       return p;
  2805.   }
  2806.   
  2807. + #ifdef amigados
  2808. + /* need to copy tables, since I only have vfork (), no real fork () */
  2809. + /* assume initialized source and destination tables */
  2810. + void
  2811. + tbl_copy (struct table *src, struct table *dst, Area *ap)
  2812. + {
  2813. +   struct tbl *t, *tn;
  2814. +   twalk (src);
  2815. +   tinit (dst, ap);
  2816. +   while (t = tnext ())
  2817. +     {
  2818. + #ifdef DEBUG
  2819. + fprintf (shlout, "%s: type %d, val $%lx, flag ",
  2820. +      t->name, t->type, t->val.i);
  2821. + #define PRFLAG(fl) \
  2822. +       if (t->flag & fl) fprintf (shlout, #fl "|");
  2823. + PRFLAG(ALLOC);
  2824. + PRFLAG(DEFINED);
  2825. + PRFLAG(ISSET);
  2826. + PRFLAG(SPECIAL);
  2827. + PRFLAG(INTEGER);
  2828. + PRFLAG(RDONLY);
  2829. + PRFLAG(EXPORT);
  2830. + PRFLAG(LOCAL);
  2831. + PRFLAG(TRACE);
  2832. + PRFLAG(FUNCT);
  2833. + PRFLAG(EXPALIAS);
  2834. + fprintf (shlout, "\n");
  2835. + #endif
  2836. +       tn = tenter (dst, t->name, hash (t->name));
  2837. +       tn->flag = t->flag;
  2838. +       tn->type = t->type;
  2839. +       if (t->flag & INTEGER)
  2840. +         tn->val.i = t->val.i;
  2841. +       else if (t->flag & FUNCT)
  2842. +     if (t->type == CFUNC)
  2843. +       tn->val.t = t->val.t ? tcopy (t->val.t, ap) : 0;
  2844. +     else
  2845. +       tn->val.f = t->val.f;
  2846. +       else if (t->flag & EXPORT)
  2847. +     tn->val.s = strsave (t->val.s, ap);
  2848. +       else
  2849. +     {
  2850. +       tn->type = 0;
  2851. +       tn->val.s = (t->flag & ALLOC) ? 
  2852. +             strsave (t->val.s + t->type, ap) : 0;
  2853. +     }
  2854. +     }
  2855. +   lastarea = ap;
  2856. + }
  2857. + #endif
  2858. diff -rc --new-file pdksh-4.9/sh/trace.c /gnu/src/amiga/pdksh-4.9/sh/trace.c
  2859. *** pdksh-4.9/sh/trace.c    Wed May  4 14:45:01 1994
  2860. --- /gnu/src/amiga/pdksh-4.9/sh/trace.c    Wed May  4 22:24:41 1994
  2861. ***************
  2862. *** 145,152 ****
  2863.       fp = stderr;
  2864.     if (fp != (FILE *)NULL)
  2865.     {
  2866.       vfprintf(fp, fmt, arg_ptr);
  2867. !     fputc('\n', fp);
  2868.       if (fp == stderr)
  2869.         fflush(fp);
  2870.       else
  2871. --- 145,153 ----
  2872.       fp = stderr;
  2873.     if (fp != (FILE *)NULL)
  2874.     {
  2875. +     fprintf(fp, "$%lx:", getpid());
  2876.       vfprintf(fp, fmt, arg_ptr);
  2877. !     fprintf(fp, "\r\n", fp);
  2878.       if (fp == stderr)
  2879.         fflush(fp);
  2880.       else
  2881. diff -rc --new-file pdksh-4.9/sh/trap.c /gnu/src/amiga/pdksh-4.9/sh/trap.c
  2882. *** pdksh-4.9/sh/trap.c    Wed May  4 14:47:01 1994
  2883. --- /gnu/src/amiga/pdksh-4.9/sh/trap.c    Wed May  4 22:24:42 1994
  2884. ***************
  2885. *** 111,116 ****
  2886. --- 111,132 ----
  2887.   #endif
  2888.   }
  2889.   
  2890. + #ifdef amigados
  2891. + /* need to copy any allocated trap command strings in child, or we free
  2892. +    memory of the parent when afree() is invoked */
  2893. + void
  2894. + child_dup_traps ()
  2895. + {
  2896. +   Trap *p;
  2897. +   
  2898. +   for (p = sigtraps; p < &sigtraps[sizeof (sigtraps) / sizeof (Trap)]; p++)
  2899. +     if (p->trap)
  2900. +       p->trap = strsave (p->trap, APERM);
  2901. + }
  2902. + #endif /* amigados */
  2903. +     
  2904.   /*
  2905.    * run any pending traps
  2906.    */
  2907. diff -rc --new-file pdksh-4.9/sh/tty.h /gnu/src/amiga/pdksh-4.9/sh/tty.h
  2908. *** pdksh-4.9/sh/tty.h    Wed May  4 14:47:03 1994
  2909. --- /gnu/src/amiga/pdksh-4.9/sh/tty.h    Wed May  4 22:40:59 1994
  2910. ***************
  2911. *** 29,34 ****
  2912. --- 29,37 ----
  2913.   #       define TIOCSETN    TIOCSETP
  2914.   #     else
  2915.   #       include <sys/ioctl.h>
  2916. + #    ifdef __amigados__
  2917. + #      include <sys/ioctl_compat.h>
  2918. + #    endif
  2919.   #     endif
  2920.   #   else
  2921.   #     include <termio.h>
  2922. diff -rc --new-file pdksh-4.9/sh/var.c /gnu/src/amiga/pdksh-4.9/sh/var.c
  2923. *** pdksh-4.9/sh/var.c    Wed May  4 14:47:04 1994
  2924. --- /gnu/src/amiga/pdksh-4.9/sh/var.c    Wed May  4 22:24:43 1994
  2925. ***************
  2926. *** 555,560 ****
  2927. --- 555,617 ----
  2928.       }
  2929.   }
  2930.   
  2931. + #ifdef amigados
  2932. + /* have to copy stuff lacking real fork () (vfork is a bitch..) */
  2933. + /* assume e already set up for new block, so we use ATEMP for storage */
  2934. + void
  2935. + blk_copy (struct block *src)
  2936. + {
  2937. +   struct block *l;
  2938. +   char **tw, **rw;
  2939. +   static char *empty[] = {""};
  2940. +   /* this is the deepest nested block, also called `globals' */
  2941. +   if (! src->next)
  2942. +     {
  2943. +       /* note: taking &globals yields another address in the child
  2944. +                than src, since src points to the parents &globals. The
  2945. +                child has relocated global data, but not malloc space */
  2946. +       l = &globals;
  2947. +       bzero (l, sizeof (*l));
  2948. +       e.loc = l;
  2949. +     }
  2950. +   else
  2951. +     {
  2952. +       blk_copy (src->next);
  2953. +       l = (struct block*) alloc(sizeof(struct block), ATEMP);
  2954. +       l->next = e.loc; e.loc = l;
  2955. +     }
  2956. +   newblock();
  2957. +   l->argc = src->argc;
  2958. +   if (l->argc)
  2959. +     {
  2960. +       /* copy the argument vector */
  2961. +       for (tw = src->argv; *tw++ != NULL; ) ;
  2962. +       rw = l->argv = (char **) alloc((int)(tw - src->argv) * sizeof(*tw), 
  2963. +                           & l->area);
  2964. +       for (tw = src->argv; *tw != NULL; )
  2965. +          *rw++ = wdcopy(*tw++, & l->area);
  2966. +       *rw = NULL;
  2967. +     }
  2968. +   else
  2969. +     l->argv = empty;
  2970. +   tbl_copy (& src->vars, & l->vars, & l->area);
  2971. +   tbl_copy (& src->funs, & l->funs, & l->area);
  2972. +   /* they're not used anyway (ie. always 0), but something like this
  2973. +      will have to be done when they ARE used. Perhaps it will be ATEMP
  2974. +      instead of APERM? */
  2975. +   l->error = src->error ? strsave (src->error, APERM) : 0;
  2976. +   l->exit  = src->exit ? strsave (src->exit, APERM) : 0;
  2977. + }
  2978. + #endif
  2979.   static void
  2980.   setspec(vp)
  2981.       register struct tbl *vp;
  2982. diff -rc --new-file pdksh-4.9/sh/vi.c /gnu/src/amiga/pdksh-4.9/sh/vi.c
  2983. *** pdksh-4.9/sh/vi.c    Wed May  4 14:47:05 1994
  2984. --- /gnu/src/amiga/pdksh-4.9/sh/vi.c    Wed May  4 22:24:44 1994
  2985. ***************
  2986. *** 1666,1672 ****
  2987. --- 1666,1676 ----
  2988.   {
  2989.       char    buf;
  2990.   
  2991. + #ifdef amigados
  2992. +     if (tty_read(ttyfd, &buf, 1) != 1)
  2993. + #else
  2994.       if (read(ttyfd, &buf, 1) != 1)
  2995. + #endif
  2996.           return -1;
  2997.       if ((buf & 0x7f) == Ctrl('c')) {
  2998.           /*
  2999. diff -rc --new-file pdksh-4.9/std/h/dirent.h /gnu/src/amiga/pdksh-4.9/std/h/dirent.h
  3000. *** pdksh-4.9/std/h/dirent.h    Thu Jan  1 00:00:00 1970
  3001. --- /gnu/src/amiga/pdksh-4.9/std/h/dirent.h    Wed May  4 15:03:28 1994
  3002. ***************
  3003. *** 0 ****
  3004. --- 1,5 ----
  3005. + /* <dirent.h> based on BSD <sys/dir.h> */
  3006. + #include <sys/dir.h>
  3007. + #define dirent direct
  3008. diff -rc --new-file pdksh-4.9/std/h/fcntl.h /gnu/src/amiga/pdksh-4.9/std/h/fcntl.h
  3009. *** pdksh-4.9/std/h/fcntl.h    Thu Jan  1 00:00:00 1970
  3010. --- /gnu/src/amiga/pdksh-4.9/std/h/fcntl.h    Wed May  4 15:03:28 1994
  3011. ***************
  3012. *** 0 ****
  3013. --- 1,26 ----
  3014. + /* P1003.1 fcntl/open definitions */
  3015. + /* Based on a version by Terrence W. Holm */
  3016. + /*  for fcntl(2)  */
  3017. + /* $Id: fcntl.h,v 1.3 93/05/05 21:17:47 sjg Exp $ */
  3018. + #define    F_DUPFD        0
  3019. + #define    F_GETFD        1
  3020. + #define    F_SETFD        2
  3021. + #define    F_GETFL        3
  3022. + #define    F_SETFL        4
  3023. + #define    FD_CLEXEC    1        /* fcntl F_SETFD close on exec mode */
  3024. + /*  for open(2)  */
  3025. + #define    O_RDONLY    0
  3026. + #define    O_WRONLY    1
  3027. + #define    O_RDWR        2
  3028. + #if _BSD
  3029. + #undef    O_RDONLY
  3030. + #undef    O_WRONLY
  3031. + #undef    O_RDWR
  3032. + #include "/./usr/include/fcntl.h"
  3033. + #endif
  3034. diff -rc --new-file pdksh-4.9/std/h/io.h /gnu/src/amiga/pdksh-4.9/std/h/io.h
  3035. *** pdksh-4.9/std/h/io.h    Thu Jan  1 00:00:00 1970
  3036. --- /gnu/src/amiga/pdksh-4.9/std/h/io.h    Wed May  4 15:03:27 1994
  3037. ***************
  3038. *** 0 ****
  3039. --- 1,59 ----
  3040. + /* POSIX IO functions */
  3041. + /* $Id: io.h,v 1.3 93/05/05 21:17:48 sjg Exp $ */
  3042. + /*
  3043. +  * the incomplete type "struct stat"
  3044. +  * will get warnings from GCC,
  3045. +  * errors from Turbo C. Too bad.
  3046. +  */
  3047. + /* include <unistd.h> to get this */
  3048. + #if ! _IO_H
  3049. + #define    _IO_H    1
  3050. + #include <unistd.h>
  3051. + #if _ST                /* dLibs hack */
  3052. + #define    unlink    remove
  3053. + #endif
  3054. + struct stat;            /* create global incompletely-typed structure */
  3055. + int chdir ARGS ((const char *path));
  3056. + #ifndef sparc
  3057. + int umask ARGS ((int mode));
  3058. + #endif
  3059. + int open ARGS ((const char *path, int flags, ... /*mode*/));
  3060. + int creat ARGS ((const char *path, int mode));
  3061. + int pipe ARGS ((int pv[2]));
  3062. + int close ARGS ((int fd));
  3063. + int fcntl ARGS ((int fd, int cmd, int arg));
  3064. + int dup ARGS ((int fd));
  3065. + int dup2 ARGS ((int ofd, int nfd));
  3066. + int link ARGS ((const char *opath, const char *npath));
  3067. + int unlink ARGS ((const char *path));
  3068. + int rename ARGS ((const char *opath, const char *npath));
  3069. + int mkdir ARGS ((const char *path, int mode));
  3070. + long lseek ARGS ((int fd, long off, int how));
  3071. + int read ARGS ((int fd, char *buf, unsigned len));
  3072. + int write ARGS ((int fd, char *buf, unsigned len));
  3073. + int access ARGS ((const char *path, int mode));
  3074. + int stat ARGS ((const char *path, struct stat *sp));
  3075. + int fstat ARGS ((int fd, struct stat *sp));
  3076. + int chmod ARGS ((const char *path, int mode));
  3077. + int chown ARGS ((const char *path, int uid));
  3078. + int chgrp ARGS ((const char *path, int gid));
  3079. + int utime ARGS ((const char *path, long tv[2]));
  3080. + #if _BSD || _V7
  3081. + int ioctl ARGS ((int fd, int cmd, void *argp)); /* BSD is "uns long cmd" */
  3082. + #endif
  3083. + #endif
  3084. diff -rc --new-file pdksh-4.9/std/h/limits.h /gnu/src/amiga/pdksh-4.9/std/h/limits.h
  3085. *** pdksh-4.9/std/h/limits.h    Thu Jan  1 00:00:00 1970
  3086. --- /gnu/src/amiga/pdksh-4.9/std/h/limits.h    Wed May  4 15:03:29 1994
  3087. ***************
  3088. *** 0 ****
  3089. --- 1,38 ----
  3090. + /* Implementation-defined limits */
  3091. + #if __STDC__
  3092. + #define    Signed    signed
  3093. + #else
  3094. + #define    Signed    
  3095. + #endif
  3096. + #define    CHAR_BIT    8
  3097. + #define    _S_MIN(type)    (-(Signed type)((unsigned type) ~0 >> 1) - 1)
  3098. + #define    _S_MAX(type)    ((Signed type)((unsigned type) ~0 >> 1))
  3099. + #define    UCHAR_MIN    ((unsigned char) 0)
  3100. + #define    UCHAR_MAX    ((unsigned char) ~0)
  3101. + #define    SCHAR_MIN    _S_MIN(char)
  3102. + #define    SCHAR_MAX    _S_MAX(char)
  3103. + /* some PCC compilers don't like the "elegant" definition of _UCHAR */
  3104. + /* let the poor user provide -D_UCHAR=0 or 1 */
  3105. + #ifndef _UCHAR
  3106. + #define    _UCHAR        ((char) ~0 == (unsigned char) ~0)
  3107. + #endif
  3108. + #define    CHAR_MIN    (_UCHAR ? UCHAR_MIN : SCHAR_MIN)
  3109. + #define    CHAR_MAX    (_UCHAR ? UCHAR_MAX : SCHAR_MAX)
  3110. + #define    USHRT_MAX    ((unsigned short) ~0)
  3111. + #define    SHRT_MIN    _S_MIN(short)
  3112. + #define    SHRT_MAX    _S_MAX(short)
  3113. + #define    UINT_MAX    ((unsigned int) ~0)
  3114. + #define    INT_MIN        _S_MIN(int)
  3115. + #define    INT_MAX        _S_MAX(int)
  3116. + #define    ULONG_MAX    ((unsigned long) ~0)
  3117. + #define    LONG_MIN    _S_MIN(long)
  3118. + #define    LONG_MAX    _S_MAX(long)
  3119. diff -rc --new-file pdksh-4.9/std/h/stddef.h /gnu/src/amiga/pdksh-4.9/std/h/stddef.h
  3120. *** pdksh-4.9/std/h/stddef.h    Thu Jan  1 00:00:00 1970
  3121. --- /gnu/src/amiga/pdksh-4.9/std/h/stddef.h    Wed May  4 15:03:29 1994
  3122. ***************
  3123. *** 0 ****
  3124. --- 1,41 ----
  3125. + /* ANSI common definitions */
  3126. + /* $Id: stddef.h,v 1.3 93/05/05 21:18:23 sjg Exp $ */
  3127. + #ifndef NULL
  3128. + #if __STDC__
  3129. + #define    NULL    (void*)0
  3130. + #else
  3131. + #define    NULL    0
  3132. + #endif
  3133. + #endif
  3134. + #ifndef _STDDEF_H
  3135. + #define    _STDDEF_H
  3136. + /* doesn't really belong here, but the library function need it */
  3137. + #ifndef ARGS
  3138. + # ifdef  __STDC__
  3139. + #   define ARGS(args) args
  3140. + # else
  3141. + #   define ARGS(args) ()
  3142. + #   ifdef VOID
  3143. + #     define void VOID
  3144. + #   endif
  3145. + #   define const
  3146. + #   define volatile
  3147. + # endif
  3148. + #endif
  3149. + #ifdef HAVE_SYS_STDTYPES
  3150. + # include <sys/stdtypes.h>
  3151. + #else
  3152. + typedef unsigned size_t;        /* may need long */
  3153. + typedef int ptrdiff_t;
  3154. + #endif /* HAVE_SYS_STDTYPES */
  3155. + #define    offsetof(type,id) ((size_t)&((type*)NULL)->id)
  3156. + extern    int errno;        /* really belongs in <errno.h> */
  3157. + #endif
  3158. diff -rc --new-file pdksh-4.9/std/h/stdh.h /gnu/src/amiga/pdksh-4.9/std/h/stdh.h
  3159. *** pdksh-4.9/std/h/stdh.h    Thu Jan  1 00:00:00 1970
  3160. --- /gnu/src/amiga/pdksh-4.9/std/h/stdh.h    Wed May  4 15:03:27 1994
  3161. ***************
  3162. *** 0 ****
  3163. --- 1,86 ----
  3164. + /* NAME:
  3165. +  *      stdh.h - standard headers
  3166. +  *
  3167. +  * SYNOPSIS:
  3168. +  *      #include "stdh.h"
  3169. +  *
  3170. +  * DESCRIPTION:
  3171. +  *      We use this header to encapsulate all the stddef et al 
  3172. +  *      inclusion so that most of the source can ignore the 
  3173. +  *      problems that their lack might cause.
  3174. +  *
  3175. +  * SEE ALSO:
  3176. +  *      
  3177. +  *
  3178. +  * AMENDED:
  3179. +  *      91/11/25  13:33:12  (sjg)
  3180. +  *
  3181. +  * RELEASED:
  3182. +  *      91/11/25  13:33:17  v1.3
  3183. +  *
  3184. +  * SCCSID:
  3185. +  *      @(#)stdh.h  1.3  91/11/25  13:33:12  (sjg)
  3186. +  *
  3187. +  */
  3188. + #ifndef ARGS
  3189. + # ifdef __STDC__
  3190. + #   define ARGS(args) args
  3191. + # else
  3192. + #   define ARGS(args) ()
  3193. + #   ifdef VOID
  3194. + #     define void VOID
  3195. + #   endif
  3196. + #   define const
  3197. + #   define volatile
  3198. + # endif
  3199. + #endif
  3200. + #include <stdio.h>
  3201. + /* if we have std headers then include them here
  3202. +  * otherwise make allowances
  3203. +  */
  3204. + #ifndef NOSTDHDRS
  3205. + # include <stddef.h>
  3206. + # include <stdlib.h>
  3207. + # include <string.h>
  3208. + # include <sys/types.h>
  3209. + #else
  3210. + # ifdef HAVE_SYS_STDTYPES
  3211. + #   include <sys/stdtypes.h>
  3212. + # else
  3213. + #   include <sys/types.h>
  3214. + /* just in case they have sys/stdtypes and don't know it
  3215. +  */
  3216. + #   ifndef    __sys_stdtypes_h
  3217. + #define _PID_T
  3218. + #define _CLOCK_T
  3219. + typedef int pid_t;
  3220. + typedef long clock_t;
  3221. + #   endif
  3222. + # endif
  3223. + # ifdef _SYSV
  3224. + #   include <string.h>
  3225. + # else
  3226. + #   include <strings.h>
  3227. + #   define strchr index
  3228. + #   define strrchr rindex
  3229. + # endif
  3230. + /* just a useful subset of what stdlib.h would have
  3231. +  */
  3232. + extern char * getenv  ARGS((const char *));
  3233. + extern void * malloc  ARGS((size_t));
  3234. + extern int    free    ARGS((void *));
  3235. + extern int    exit    ARGS((int));
  3236. + /* these _should_ match ANSI */
  3237. + extern char * strstr  ARGS((const char *, const char *));
  3238. + extern void * memmove ARGS((void *, const void *, size_t));
  3239. + extern void * memcpy  ARGS((void *, const void *, size_t));
  3240. + #endif /* NOSTDHDRS */
  3241. +   
  3242. + #ifndef offsetof
  3243. + #define    offsetof(type,id) ((size_t)&((type*)NULL)->id)
  3244. + #endif
  3245. diff -rc --new-file pdksh-4.9/std/h/stdlib.h /gnu/src/amiga/pdksh-4.9/std/h/stdlib.h
  3246. *** pdksh-4.9/std/h/stdlib.h    Thu Jan  1 00:00:00 1970
  3247. --- /gnu/src/amiga/pdksh-4.9/std/h/stdlib.h    Wed May  4 15:03:29 1994
  3248. ***************
  3249. *** 0 ****
  3250. --- 1,34 ----
  3251. + /* ANSI utility functions */
  3252. + /* $Id: stdlib.h,v 1.3 93/05/05 21:18:29 sjg Exp $ */
  3253. + #if ! _STDLIB_H
  3254. + #define    _STDLIB_H 1
  3255. + #include <stddef.h>
  3256. + double    atof ARGS((const char *s));
  3257. + int    atoi ARGS((const char *s));
  3258. + long    atol ARGS((const char *s));
  3259. + double    strtod ARGS((const char *s, char **));
  3260. + long    strtol ARGS((const char *s, char **, int base));
  3261. + unsigned long    strtoul ARGS((const char *s, char **, int base));
  3262. + int    rand ARGS((void));
  3263. + void    srand ARGS((unsigned int seed));
  3264. + void   *malloc ARGS((size_t size));
  3265. + void   *realloc ARGS((void *ptr, size_t size));
  3266. + void   *calloc ARGS((size_t n, size_t size));
  3267. + void    free ARGS((void *ptr));
  3268. + void    abort ARGS((void));
  3269. + int    atexit ARGS((void (*func)(void)));
  3270. + void    exit ARGS((int status));
  3271. + char   *getenv ARGS((const char *name));
  3272. + int    system ARGS((const char *cmd));
  3273. + void   *bsearch ARGS ((const void *key, const void *base, size_t n, size_t size,
  3274. +                int (*compar)(const void *, const void *)));
  3275. + void   *qsort ARGS ((const void *base, size_t n, size_t size,
  3276. +              int (*compar)(const void *, const void *)));
  3277. + #define    abs(a)    ((a) < 0 : -(a) : (a))
  3278. + #endif
  3279. diff -rc --new-file pdksh-4.9/std/h/string.h /gnu/src/amiga/pdksh-4.9/std/h/string.h
  3280. *** pdksh-4.9/std/h/string.h    Thu Jan  1 00:00:00 1970
  3281. --- /gnu/src/amiga/pdksh-4.9/std/h/string.h    Wed May  4 15:03:29 1994
  3282. ***************
  3283. *** 0 ****
  3284. --- 1,33 ----
  3285. + /* ANSI string handling (missing wide char stuff) */
  3286. + /* $Id: string.h,v 1.3 93/05/05 21:18:42 sjg Exp $ */
  3287. + #if ! _STRING_H
  3288. + #define _STRING_H 1
  3289. + #include <stddef.h>        /* define NULL and size_t */
  3290. + #ifndef __GNUC__
  3291. + void   *memcpy ARGS((void *s1, const void *s2, size_t));
  3292. + int    memcmp ARGS((const void *s1, const void *s2, size_t));
  3293. + size_t    strlen ARGS((const char *s));
  3294. + #endif
  3295. + void   *memmove ARGS((void *s1, const void *s2, size_t));
  3296. + void   *memchr ARGS((const void *s, int c, size_t));
  3297. + void   *memset ARGS((void *s, int c, size_t));
  3298. + char   *strcpy ARGS((char *s1, const char *s2));
  3299. + char   *strncpy ARGS((char *s1, const char *s2, size_t));
  3300. + char   *strcat ARGS((char *s1, const char *s2));
  3301. + char   *strncat ARGS((char *s1, const char *s2, size_t));
  3302. + int    strcmp ARGS((const char *s1, const char *s2));
  3303. + int    strncmp ARGS((const char *s1, const char *s2, size_t));
  3304. + char   *strchr ARGS((const char *s1, int c));
  3305. + char   *strrchr ARGS((const char *s1, int c));
  3306. + size_t    strspn ARGS((const char *s1, const char *s2));
  3307. + size_t    strcspn ARGS((const char *s1, const char *s2));
  3308. + char   *strpbrk ARGS((const char *s1, const char *s2));
  3309. + char   *strstr ARGS((const char *s1, const char *s2));
  3310. + char   *strtok ARGS((char *s1, const char *s2));
  3311. + char   *strerror ARGS((int errno));
  3312. + #endif /* _STRING_H */
  3313. diff -rc --new-file pdksh-4.9/std/h/sys/time.h /gnu/src/amiga/pdksh-4.9/std/h/sys/time.h
  3314. *** pdksh-4.9/std/h/sys/time.h    Thu Jan  1 00:00:00 1970
  3315. --- /gnu/src/amiga/pdksh-4.9/std/h/sys/time.h    Wed May  4 15:03:28 1994
  3316. ***************
  3317. *** 0 ****
  3318. --- 1,15 ----
  3319. + /*
  3320. +  * Replacement for BSD <sys/time.h>
  3321. +  * because Ultrix screws it up.
  3322. +  */
  3323. + /* $Id: time.h,v 1.3 93/05/05 21:17:50 sjg Exp $ */
  3324. + struct timeval {
  3325. +     long tv_sec;        /* time_t */
  3326. +     long tv_usec;        /* microsex */
  3327. + };
  3328. + struct timezone {
  3329. +     int tz_minuteswest;    /* of Greenwinch */
  3330. +     int tz_dsttime;        /* type of dst correction to apply */
  3331. + };
  3332. diff -rc --new-file pdksh-4.9/std/h/sys/times.h /gnu/src/amiga/pdksh-4.9/std/h/sys/times.h
  3333. *** pdksh-4.9/std/h/sys/times.h    Thu Jan  1 00:00:00 1970
  3334. --- /gnu/src/amiga/pdksh-4.9/std/h/sys/times.h    Wed May  4 15:03:28 1994
  3335. ***************
  3336. *** 0 ****
  3337. --- 1,29 ----
  3338. + /*
  3339. +  * sys/times.h: POSIX times()
  3340. +  */
  3341. + /* $Id: times.h,v 1.3 93/05/05 21:17:53 sjg Exp $ */
  3342. + #if ! _TIMES_H
  3343. + #define    _TIMES_H 1
  3344. + #include <time.h>        /* defines CLK_TCK */
  3345. + #if __STDC__
  3346. + #define    ARGS(args)    args
  3347. + #else
  3348. + #define    ARGS(args)    ()
  3349. + #endif
  3350. + struct tms {
  3351. +     clock_t    tms_utime, tms_stime;
  3352. +     clock_t    tms_cutime, tms_cstime;
  3353. + };
  3354. + #if _V7
  3355. + #define times times_
  3356. + #endif
  3357. + clock_t    times ARGS((struct tms *tmsp));
  3358. + #endif
  3359. diff -rc --new-file pdksh-4.9/std/h/sys/types.h /gnu/src/amiga/pdksh-4.9/std/h/sys/types.h
  3360. *** pdksh-4.9/std/h/sys/types.h    Thu Jan  1 00:00:00 1970
  3361. --- /gnu/src/amiga/pdksh-4.9/std/h/sys/types.h    Wed May  4 15:03:30 1994
  3362. ***************
  3363. *** 0 ****
  3364. --- 1,15 ----
  3365. + /* work around multiple typedefs in stddef.h and sys/types.h */
  3366. + /* $Id: types.h,v 1.3 93/05/05 21:19:01 sjg Exp $ */
  3367. + #include <stddef.h>        /* defines size_t and ptrdiff_t */
  3368. + #include <time.h>        /* defines time_t and clock_t */
  3369. + /* "inhibit" the typedefs in sys/types.h */
  3370. + #define size_t _size_t
  3371. + #define    time_t _time_t
  3372. + #define    clock_t _clock_t
  3373. + #include "/./usr/include/sys/types.h"
  3374. + #undef    size_t
  3375. + #undef    time_t
  3376. + #undef    clock_t
  3377. diff -rc --new-file pdksh-4.9/std/h/sys/wait.h /gnu/src/amiga/pdksh-4.9/std/h/sys/wait.h
  3378. *** pdksh-4.9/std/h/sys/wait.h    Thu Jan  1 00:00:00 1970
  3379. --- /gnu/src/amiga/pdksh-4.9/std/h/sys/wait.h    Wed May  4 15:03:28 1994
  3380. ***************
  3381. *** 0 ****
  3382. --- 1,49 ----
  3383. + /*
  3384. +  * POSIX <sys/wait.h>
  3385. +  */
  3386. + /* $Id: wait.h,v 1.3 93/05/05 21:18:00 sjg Exp $ */
  3387. + #if __STDC__
  3388. + #define    ARGS(args)    args
  3389. + #else
  3390. + #define    ARGS(args)    ()
  3391. + #endif
  3392. + #ifdef HAVE_SYS_STDTYPES
  3393. + # include <sys/stdtypes.h>
  3394. + #else
  3395. + # ifndef _PID_T
  3396. + #   define _PID_T
  3397. + typedef int pid_t;        /* belong in sys/types.h */
  3398. + # endif
  3399. + #endif
  3400. + #ifdef sun
  3401. + # include "/./usr/include/sys/wait.h"
  3402. + #else
  3403. + #define WAIT_T int
  3404. + /* waitpid options */
  3405. + #define WNOHANG        1    /* don't hang in wait */
  3406. + #define WUNTRACED    2    /* tell about stopped, untraced children */
  3407. + #define    WSTOPPED    0x7F    /* process is stopped */
  3408. + #define WIFSTOPPED(x)    (((x)&0xFF) == 0x7F)
  3409. + #define WIFSIGNALED(x)    (((x)&0xFF) != 0x7F && ((x)&0x7F) != 0)
  3410. + #define WIFEXITED(x)    (((x)&0xFF) != 0x7F && ((x)&0x7F) == 0)
  3411. + #define    WIFCORED(x)    (!!((x)&0x80)) /* non-standard */
  3412. + #define    WEXITSTATUS(x)    ((x)>>8&0xFF)
  3413. + #define    WTERMSIG(x)    ((x)&0x7F)
  3414. + #define    WSTOPSIG(x)    ((x)>>8&0xFF)
  3415. + pid_t wait ARGS((int *statp));
  3416. + #if _BSD
  3417. + pid_t wait3 ARGS((int *statp, int options, void *));
  3418. + /* todo: does not emulate pid argument */
  3419. + #define    waitpid(pid, sp, opts)    wait3(sp, opts, (void*)NULL)
  3420. + #else
  3421. + pid_t waitpid ARGS((pid_t pid, int *statp, int options));
  3422. + #endif
  3423. + #endif /* sparc */
  3424. diff -rc --new-file pdksh-4.9/std/h/time.h /gnu/src/amiga/pdksh-4.9/std/h/time.h
  3425. *** pdksh-4.9/std/h/time.h    Thu Jan  1 00:00:00 1970
  3426. --- /gnu/src/amiga/pdksh-4.9/std/h/time.h    Wed May  4 15:03:30 1994
  3427. ***************
  3428. *** 0 ****
  3429. --- 1,47 ----
  3430. + /* time, time/date conversion */
  3431. + /* $Id: time.h,v 1.3 93/05/05 21:19:00 sjg Exp $ */
  3432. + #if ! _TIME_H
  3433. + #define    _TIME_H 1
  3434. + #include <stddef.h>        /* need size_t */
  3435. + #ifndef HAVE_SYS_STDTYPES
  3436. + #ifndef _TIME_T
  3437. + typedef long time_t;
  3438. + #endif
  3439. + typedef long clock_t;        /* seconds/CLK_TCK */
  3440. + #endif
  3441. + #if _V7 || _SYSV
  3442. + #define    CLK_TCK    60        /* todo: get from <sys/param.h> */
  3443. + #endif
  3444. + #if _BSD
  3445. + #define    CLK_TCK    100
  3446. + #endif
  3447. + #if _ST
  3448. + #define    CLK_TCK    200        /* ST system clock */
  3449. + #endif
  3450. + struct tm {
  3451. +     int    tm_sec, tm_min, tm_hour;
  3452. +     int    tm_mday, tm_mon, tm_year, tm_wday, tm_yday;
  3453. +     int    tm_isdst;
  3454. +     long    tm_gmtoff;    /* BSD */
  3455. +     char   *tm_zone;    /* BSD */
  3456. + };
  3457. + clock_t    clock ARGS((void));
  3458. + time_t    time ARGS((time_t *tp));
  3459. + #define    difftime(t1, t2)    (double)((t2)-(t1))
  3460. + time_t    mktime ARGS((struct tm *tmp));
  3461. + char   *asctime ARGS((const struct tm *tmp));
  3462. + char   *ctime ARGS((const time_t *tp));
  3463. + struct tm *gmtime ARGS((const time_t *tp));
  3464. + struct tm *localtime ARGS((const time_t *tp));
  3465. + size_t    strftime ARGS((char *buf, size_t len, const char *fmt, const struct tm *tmp));
  3466. + #endif
  3467. diff -rc --new-file pdksh-4.9/std/h/unistd.h /gnu/src/amiga/pdksh-4.9/std/h/unistd.h
  3468. *** pdksh-4.9/std/h/unistd.h    Thu Jan  1 00:00:00 1970
  3469. --- /gnu/src/amiga/pdksh-4.9/std/h/unistd.h    Wed May  4 15:03:28 1994
  3470. ***************
  3471. *** 0 ****
  3472. --- 1,49 ----
  3473. + /* unistd.h: misc. P1003.1 definitions */
  3474. + /* Based on a version by Terrence W. Holm */
  3475. + /* $Id: unistd.h,v 1.3 93/05/05 21:17:58 sjg Exp $ */
  3476. + #if ! _UNISTD_H
  3477. + #define    _UNISTD_H 1
  3478. + #include <stddef.h>
  3479. + /* doesn't really belong here, but the library function need it */
  3480. + /* todo: use _ARGS, _void, _const */
  3481. + #if __STDC__
  3482. + #define    ARGS(args)    args
  3483. + #define void    void
  3484. + #define    const    const
  3485. + #else
  3486. + #define    ARGS(args)    ()
  3487. + #define    void    char
  3488. + #define    const
  3489. + #endif
  3490. + #include <io.h>            /* POSIX IO functions */
  3491. + /*  for access(2)  */
  3492. + #define    R_OK    4
  3493. + #define    W_OK    2
  3494. + #define    X_OK    1
  3495. + #define    F_OK    0
  3496. + /*  for lockf(2)  */
  3497. + #define    F_ULOCK    0
  3498. + #define    F_LOCK    1
  3499. + #define    F_TLOCK    2
  3500. + #define    F_TEST    3
  3501. + /*  for lseek(2)  */
  3502. + #define    SEEK_SET    0
  3503. + #define    SEEK_CUR    1
  3504. + #define    SEEK_END    2
  3505. + #define    IN_PATH    "/usr/include"
  3506. + char   *getcwd ARGS ((char *buf, size_t len));
  3507. + #endif
  3508.